-
Notifications
You must be signed in to change notification settings - Fork 7
150 lines (139 loc) · 4.88 KB
/
updater.yaml
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
name: 'Test and release Updater'
on:
push:
branches:
- master
paths:
- '.github/workflows/updater.yaml'
- 'updater/sis-updater-worker/**'
- 'updater/sis-updater-scheduler/**'
jobs:
build_worker:
name: 'Build Updater worker'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: 'Build the image'
uses: docker/build-push-action@v3
with:
context: updater/sis-updater-worker/
push: false
outputs: type=docker,dest=/tmp/worker.tar
tags: toska/sis-updater-worker:latest
- name: 'Store built image'
uses: actions/upload-artifact@v3
with:
path: /tmp/worker.tar
build_scheduler:
name: 'Build Updater scheduler'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- name: 'Build the image'
uses: docker/build-push-action@v3
with:
context: updater/sis-updater-scheduler/
push: false
outputs: type=docker,dest=/tmp/scheduler.tar
tags: toska/sis-updater-scheduler:latest
- name: 'Store built image'
uses: actions/upload-artifact@v3
with:
path: /tmp/scheduler.tar
# test_updater:
# name: 'Test Updater'
# runs-on: ubuntu-latest
# needs:
# - build_worker
# - build_scheduler
# steps:
# - uses: actions/checkout@v3
# - name: 'Login to toska docker registry'
# uses: docker/login-action@v2
# with:
# registry: registry-toska.ext.ocp-prod-0.k8s.it.helsinki.fi
# username: ${{ secrets.TOSKAREGISTRY_USERNAME }}
# password: ${{ secrets.TOSKAREGISTRY_PASSWORD }}
# - name: 'Download built images'
# uses: actions/download-artifact@v3
# with:
# path: /tmp/
# - name: 'Load worker image'
# run: docker load --input /tmp/artifact/worker.tar
# - name: 'Load scheduler image'
# run: docker load --input /tmp/artifact/scheduler.tar
# - name: 'Start worker'
# run: docker-compose --file docker-compose.ci.yml up --detach --no-recreate sis-updater-worker
# - name: 'Run hourly jobs'
# run: docker-compose --file docker-compose.ci.yml run sis-updater-scheduler npm start
# env:
# SCHEDULE_IMMEDIATE: hourly
# EXIT_AFTER_IMMEDIATES: yes
# - name: 'Run daily jobs'
# run: docker-compose --file docker-compose.ci.yml run sis-updater-scheduler npm start
# env:
# SCHEDULE_IMMEDIATE: daily
# EXIT_AFTER_IMMEDIATES: yes
# - name: 'Run weekly jobs'
# run: docker-compose --file docker-compose.ci.yml run sis-updater-scheduler npm start
# env:
# SCHEDULE_IMMEDIATE: weekly
# EXIT_AFTER_IMMEDIATES: yes
# - name: 'Run prepurge'
# run: docker-compose --file docker-compose.ci.yml run sis-updater-scheduler npm start
# env:
# SCHEDULE_IMMEDIATE: prepurge
# EXIT_AFTER_IMMEDIATES: yes
# - name: 'Run purge'
# run: docker-compose --file docker-compose.ci.yml run sis-updater-scheduler npm start
# env:
# SCHEDULE_IMMEDIATE: purge
# EXIT_AFTER_IMMEDIATES: yes
release_worker:
name: 'Build and release Updater worker'
runs-on: ubuntu-latest
# needs: test_updater
steps:
- uses: actions/checkout@v3
- name: Build worker image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: updater-worker
tags: staging production ${{ github.sha }}
context: updater/sis-updater-worker
containerfiles: |
updater/sis-updater-worker/Dockerfile
- name: Push to quay.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/toska
username: toska+github
password: ${{ secrets.QUAY_IO_TOKEN }}
release_scheduler:
name: 'Build and release Updater scheduler'
runs-on: ubuntu-latest
needs: test_updater
steps:
- uses: actions/checkout@v3
- name: Build scheduler image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: updater-scheduler
tags: staging production ${{ github.sha }}
context: updater/sis-updater-scheduler
containerfiles: |
updater/sis-updater-scheduler/Dockerfile
- name: Push to quay.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/toska
username: toska+github
password: ${{ secrets.QUAY_IO_TOKEN }}