diff --git a/Tumbleweed/Dockerfile b/Tumbleweed/Dockerfile new file mode 100644 index 0000000..25a5ffb --- /dev/null +++ b/Tumbleweed/Dockerfile @@ -0,0 +1,8 @@ +FROM opensuse/tumbleweed:latest + +RUN zypper --non-interactive update +RUN zypper --non-interactive install osc expect obs-service-source_validator +RUN zypper --non-interactive clean --all + +COPY osc_checkout /usr/bin/osc_checkout +RUN chmod +x /usr/bin/osc_checkout diff --git a/Tumbleweed/README.md b/Tumbleweed/README.md new file mode 100644 index 0000000..d6e1efd --- /dev/null +++ b/Tumbleweed/README.md @@ -0,0 +1,9 @@ +# Gitea Action Custom Label CI Container Image for Tumbleweed + +Before the [osc cli taking envrionment variable for username and password](https://github.com/openSUSE/osc/issues/1453) +being implementated. The osc commnad cli require an interaction session to input the +username and password. Once this feature is completed, the osc_checkout and the +expect package will no longer be needed. + + + diff --git a/Tumbleweed/osc_checkout b/Tumbleweed/osc_checkout new file mode 100755 index 0000000..50e1775 --- /dev/null +++ b/Tumbleweed/osc_checkout @@ -0,0 +1,13 @@ +#!/usr/bin/expect -f + +set timeout -1 +spawn osc checkout "$env(INPUT_OSC_PATH)" "$env(INPUT_OSC_PACKAGE)" +expect { + -re "..*Username \\\[api.opensuse.org\\\]: " { send "$env(INPUT_OSC_USER)\r"; exp_continue } + -re "..*Password \\\[..*\@api.opensuse.org\\\]: " { send "$env(osc_pass)\r"; exp_continue } + -re "..*Select credentials manager \\\[default=1\\\]:" { send "3\r"; exp_continue } + -re "..*Password \\\[..*\@api.opensuse.org\\\]: " { send "$env(osc_pass)\r"; exp_continue } + -re "..*At revision (..*)" { puts $expect_out(1,string); + send "cd $env(INPUT_OSC_PATH)\r"; send "cd $env(INPUT_OSC_PACKAGE)\r"; + exp_continue } +}