Adding TW Dockerfile and osc_checkout script

Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
This commit is contained in:
Alex Lau 2023-12-04 16:03:27 +08:00
parent 9a990aef5b
commit 6acfc0eb7a
No known key found for this signature in database
GPG Key ID: 3F28752074CC2261
3 changed files with 30 additions and 0 deletions

8
Tumbleweed/Dockerfile Normal file
View File

@ -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

9
Tumbleweed/README.md Normal file
View File

@ -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.

13
Tumbleweed/osc_checkout Executable file
View File

@ -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 }
}