generated from github/welcome-to-github
-
-
Notifications
You must be signed in to change notification settings - Fork 12
157 lines (126 loc) · 7.03 KB
/
tasks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Run rpm and deb tasks
on:
push:
branches: [ devel ]
pull_request:
push:
branches: [ stable ]
jobs:
run-deb-tasks:
runs-on: ubuntu-latest
container:
image: lbr38/repomanager:latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Print PHP version
run: php --version
# TODO : temporaire
# A retirer une fois que 4.12.0 est publiée
- name: Install PHP yaml extension
run: apt-get update -y && apt-get install -y php8.3-yaml
# Copy latest source code to the root directory
- name: Setup latest source code
run: |
rm -fr /var/www/repomanager
mkdir -p /var/www/repomanager
cp -r $GITHUB_WORKSPACE/www/* /var/www/repomanager/
cp $GITHUB_WORKSPACE/www/version /var/lib/repomanager/version.available
echo "repomanager-ci.localhost" > /var/www/repomanager/.fqdn
chown -R www-data:repomanager /var/www/repomanager /var/lib/repomanager
# Entrypoint is not executed, so we need to run most of the commands manually
- name: Execute entrypoint
run: |
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/initialize.php" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php" www-data
/bin/bash /var/www/repomanager/bin/repomanager -p
# Create deb tasks jobs in database
- name: Create deb tasks jobs
run: |
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/deb/mirror'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/deb/update'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/deb/duplicate'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/deb/env'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/deb/rebuild'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/deb/delete'" www-data
# Create some environments for the tasks to run
- name: Set basic configuration
run: |
sqlite3 /var/lib/repomanager/db/repomanager.db "INSERT INTO env ('Name') VALUES ('pprd');"
sqlite3 /var/lib/repomanager/db/repomanager.db "INSERT INTO env ('Name') VALUES ('prod');"
# Run deb tasks
- name: Run job - Mirror deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='1'" www-data
- name: Print mirrored deb repo content
run: ls -l /home/repo/debian/bookworm/contrib_pprd/pool/contrib/
- name: Run job - Update deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='2'" www-data
- name: Run job - Duplicate deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='3'" www-data
- name: Print duplicated deb repo content
run: ls -l /home/repo/debian-copy/bookworm/contrib_pprd/pool/contrib/*.deb
- name: Run job - Point environment to deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='4'" www-data
- name: Run job - Rebuild deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='5'" www-data
- name: Run job - Delete deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='6'" www-data
run-rpm-tasks:
runs-on: ubuntu-latest
container:
image: lbr38/repomanager:latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Print PHP version
run: php --version
# TODO : temporaire
# A retirer une fois que 4.12.0 est publiée
- name: Install PHP yaml extension
run: apt-get update -y && apt-get install -y php8.3-yaml
# Copy latest source code to the root directory
- name: Setup latest source code
run: |
rm -fr /var/www/repomanager
mkdir -p /var/www/repomanager
cp -r $GITHUB_WORKSPACE/www/* /var/www/repomanager/
cp $GITHUB_WORKSPACE/www/version /var/lib/repomanager/version.available
echo "repomanager-ci.localhost" > /var/www/repomanager/.fqdn
chown -R www-data:repomanager /var/www/repomanager /var/lib/repomanager
# Entrypoint is not executed, so we need to run most of the commands manually
- name: Execute entrypoint
run: |
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/initialize.php" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php" www-data
/bin/bash /var/www/repomanager/bin/repomanager -p
# Create rpm tasks jobs in database
- name: Create rpm tasks jobs
run: |
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/rpm/mirror'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/rpm/update'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/rpm/duplicate'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/rpm/env'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/rpm/rebuild'" www-data
/bin/su -s /bin/bash -c "php /var/www/repomanager/tools/database/update.php --release='ci/rpm/delete'" www-data
# Create some environments for the tasks to run
- name: Set basic configuration
run: |
sqlite3 /var/lib/repomanager/db/repomanager.db "INSERT INTO env ('Name') VALUES ('pprd');"
sqlite3 /var/lib/repomanager/db/repomanager.db "INSERT INTO env ('Name') VALUES ('prod');"
# Run rpm tasks
- name: Run job - Mirror rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='1'" www-data
- name: Print mirrored rpm repo content
run: ls -l /home/repo/
- name: Run job - Update rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='2'" www-data
- name: Run job - Duplicate rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='3'" www-data
- name: Print duplicated rpm repo content
run: ls -l /home/repo/centos9-extras-common-copy_pprd/packages/*/*.rpm
- name: Run job - Point environment to rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='4'" www-data
- name: Run job - Rebuild rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='5'" www-data
- name: Run job - Delete rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/tasks/execute.php --id='6'" www-data