Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
574d615ec5 | |||
cfe9d3eba7 | |||
d6162dc83d | |||
550faf9c6b | |||
30d9006d70 | |||
a864c9c815 | |||
a41e79f7ae | |||
05cc6b573a | |||
aed408096c | |||
22b5342e38 | |||
527b90605c | |||
d898fcca59 | |||
e2ae5bab94 |
@@ -1,13 +1,15 @@
|
||||
name: OSC Pull Custom Image Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches: [ factory ]
|
||||
jobs:
|
||||
osc_job:
|
||||
runs-on: ubuntu-latest
|
||||
name: opensuse osc custom container checkout test
|
||||
steps:
|
||||
- name: Build action step
|
||||
uses: https://src.opensuse.org/alexlau/bc@v2
|
||||
uses: https://src.opensuse.org/alexlau/bc@v4
|
||||
with:
|
||||
osc_user: 'alexlau'
|
||||
osc_path: 'home:alexlau:branches:Base:System'
|
||||
|
12
Dockerfile
12
Dockerfile
@@ -4,7 +4,11 @@ RUN zypper --non-interactive update
|
||||
RUN zypper --non-interactive install osc expect
|
||||
RUN zypper --non-interactive clean --all
|
||||
|
||||
COPY test.sh /test.sh
|
||||
#COPY runner.sh /runner.sh
|
||||
# RUN chmod +x /runner.sh
|
||||
ENTRYPOINT ["/test.sh"]
|
||||
#COPY test.sh /test.sh
|
||||
COPY runner.sh /runner.sh
|
||||
COPY osc_buildlog.sh /osc_buildlog.sh
|
||||
RUN chmod +x /osc_buildlog.sh
|
||||
COPY osc_checkout /osc_checkout
|
||||
RUN chmod +x /osc_checkout
|
||||
# ENTRYPOINT ["/test.sh"]
|
||||
ENTRYPOINT ["/runner.sh"]
|
||||
|
15
osc_buildlog.sh
Executable file
15
osc_buildlog.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh -l
|
||||
|
||||
# echo $1 $2 $3
|
||||
# echo "${osc_user} ${osc_path} ${osc_package}"
|
||||
# echo "${INPUT_OSC_USER} ${INPUT_OSC_PATH} ${INPUT_OSC_PACKAGE}"
|
||||
# osc checkout $INPUT_OSC_PATH $INPUT_OSC_PACKAGE
|
||||
|
||||
cd "${INPUT_OSC_PATH}/${INPUT_OSC_PACKAGE}"
|
||||
osc buildlog openSUSE_Factory x86_64
|
||||
echo "Getting binaries from the obs";
|
||||
osc getbinaries openSUSE_Factory x86_64
|
||||
ls binaries
|
||||
rpm -Uvh binaries/*.rpm
|
||||
|
||||
|
20
osc_checkout
Executable file
20
osc_checkout
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
|
||||
# echo $1 $2 $3
|
||||
# echo "${osc_user} ${osc_path} ${osc_package}"
|
||||
# echo "${INPUT_OSC_USER} ${INPUT_OSC_PATH} ${INPUT_OSC_PACKAGE}"
|
||||
|
||||
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";
|
||||
send "osc buildlog openSUSE_Factory x86_64\r";
|
||||
exp_continue }
|
||||
}
|
||||
|
@@ -5,4 +5,5 @@ echo "${osc_user} ${osc_path} ${osc_package}"
|
||||
echo "${INPUT_OSC_USER} ${INPUT_OSC_PATH} ${INPUT_OSC_PACKAGE}"
|
||||
# osc checkout $INPUT_OSC_PATH $INPUT_OSC_PACKAGE
|
||||
# osc buildlog openSUSE_Factory x86_64
|
||||
|
||||
/usr/bin/expect /osc_checkout
|
||||
/osc_buildlog.sh
|
||||
|
13
test.sh
13
test.sh
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/expect
|
||||
|
||||
|
||||
# echo $1 $2 $3
|
||||
# echo "${osc_user} ${osc_path} ${osc_package}"
|
||||
# echo "${INPUT_OSC_USER} ${INPUT_OSC_PATH} ${INPUT_OSC_PACKAGE}"
|
||||
spawn osc checkout $INPUT_OSC_PATH $INPUT_OSC_PACKAGE
|
||||
expect "Username [api.opensuse.org]:\n"
|
||||
send "$env(INPUT_OSC_USER)\n"
|
||||
expect "Password [@api.opensuse.org]:\n"
|
||||
send "$env(osc_pass)\n"
|
||||
spawn osc buildlog openSUSE_Factory x86_64
|
||||
|
Reference in New Issue
Block a user