20 Commits
v1 ... factory

Author SHA1 Message Date
1362de0801 Testing runs-on: my_custom_label
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 21s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-11-22 18:11:20 +08:00
4deaf112fa Adding osc local build option in the workflow
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 20s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-11-20 14:27:07 +08:00
574d615ec5 Installing the rpm in binaryies folder
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 6s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-11-15 16:28:05 +08:00
cfe9d3eba7 Testing the getbinaries in the workflow
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 7s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-11-15 16:06:42 +08:00
d6162dc83d Back to normal test runner update container image
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 4s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-11-13 16:26:03 +08:00
550faf9c6b Test new runner by just updating the Dockerfile
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 2s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-11-13 16:20:07 +08:00
30d9006d70 test build
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 1m35s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 15:00:38 +08:00
a864c9c815 Remove test
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 54s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 14:29:05 +08:00
a41e79f7ae Testing another build syntax
Some checks failed
OSC Pull Custom Image Demo / build (push) Failing after 5s
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 4s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 14:24:20 +08:00
05cc6b573a Adding a build command
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 0s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 14:13:03 +08:00
aed408096c Create v4 flag to trigger rebuild
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 1s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 13:36:47 +08:00
22b5342e38 Copy the new script to dockerfile
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 1s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 13:12:58 +08:00
527b90605c Finish a checkout and buildlog cycle
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 1s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 13:07:52 +08:00
d898fcca59 Push v3 for test
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 1s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-31 10:49:06 +08:00
e2ae5bab94 test build
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 1s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-30 16:49:51 +08:00
c157ed7013 Adding expect to input username password
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 44s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-30 16:23:09 +08:00
fac40dee31 update action workflow to v2 to trigger docker build
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Has been cancelled
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-25 11:24:40 +08:00
1924414090 Change Dockerfile add a test.sh
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 1s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-25 11:21:23 +08:00
197606cee9 Push @ref factory
All checks were successful
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Successful in 24s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-25 11:16:29 +08:00
78d68b0790 Remove tag v1 recreate error image
Some checks failed
OSC Pull Custom Image Demo / opensuse osc custom container checkout test (push) Failing after 18s
Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
2023-10-25 11:12:36 +08:00
7 changed files with 66 additions and 9 deletions

View File

@@ -1,17 +1,28 @@
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
runs-on: my_custom_label
name: opensuse osc custom container checkout test
steps:
- name: Build action step
uses: https://src.opensuse.org/alexlau/bc@v1
- name: Get OBS Buildlog step
uses: https://src.opensuse.org/alexlau/bc@v4
with:
osc_user: 'alexlau'
osc_path: 'home:alexlau:branches:Base:System'
osc_package: 'bc'
osc_action: 'buildlog'
env: # Or as an environment variable
osc_pass: ${{ secrets.OSCPASS }}
- name: Run a local build step
uses: https://src.opensuse.org/alexlau/bc@v4
with:
osc_user: 'alexlau'
osc_path: 'home:alexlau:branches:Base:System'
osc_package: 'bc'
osc_action: 'build'
env: # Or as an environment variable
osc_pass: ${{ secrets.OSCPASS }}
id: osc-demo

View File

@@ -1,9 +1,14 @@
FROM opensuse/tumbleweed:latest
RUN zypper --non-interactive update
RUN zypper --non-interactive install osc
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
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"]

View File

@@ -16,3 +16,4 @@ runs:
- ${{ inputs.osc_user}}
- ${{ inputs.osc_path}}
- ${{ inputs.osc_package}}
- ${{ inputs.osc_action}}

10
osc_buildlog.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh -l
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

14
osc_checkout Executable file
View File

@@ -0,0 +1,14 @@
#!/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";
send "osc buildlog openSUSE_Factory x86_64\r";
exp_continue }
}

7
osc_local_build.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh -l
cd "${INPUT_OSC_PATH}/${INPUT_OSC_PACKAGE}"
echo "Building binaries in the local container";
osc build openSUSE_Factory x86_64

View File

@@ -1,8 +1,17 @@
#!/bin/sh -l
echo $1 $2 $3
echo $1 $2 $3 $4
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
if [ "$4" = "buildlog" ]; then
echo "OBS buildlog ..."
/usr/bin/expect /osc_checkout
/osc_buildlog.sh
elif [ "$4" = "build" ]; then
echo "Triggering local build..."
/usr/bin/expect /osc_checkout
/osc_local_build.sh
fi