Skip to content

Commit 6d6703a

Browse files
author
Pascal Benchimol
committed
split front and back images building in two separate jobs
1 parent 799bbe1 commit 6d6703a

File tree

1 file changed

+86
-19
lines changed

1 file changed

+86
-19
lines changed

.github/workflows/dockers_builder.yml

+86-19
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ jobs:
129129
rm -rf ./*
130130
rm -rf ./.??*
131131
132-
debian8_images:
133-
runs-on: [self-hosted, corefront, sandbox]
134-
name: Build debian8 images
132+
debian8_back_images:
133+
runs-on: [self-hosted, kraken, sandbox]
134+
name: Build debian8 back images
135135
needs: common_variables
136136
steps:
137137
- name: force chown to avoid errors
@@ -187,7 +187,6 @@ jobs:
187187
with:
188188
# 162230498103 : shared
189189
# 110444322584 : kraken sbx
190-
# 051314639660 : corefront sbx
191190
registries: "162230498103,110444322584,051314639660"
192191

193192
- name: Create master docker
@@ -201,10 +200,6 @@ jobs:
201200

202201
- name: Create navitia images
203202
run: |
204-
for component in ${{env.front_debian8_components}}; do
205-
echo "********* Building $component ***************"
206-
docker build -t navitia/$component -f docker/debian8/Dockerfile-${component} .
207-
done
208203
for component in ${{env.backend_debian8_components}}; do
209204
echo "********* Building $component ***************"
210205
docker build -t navitia/$component --build-arg GITHUB_TOKEN=${{ steps.ci-core-app-token.outputs.token }} -f docker/debian8/Dockerfile-${component} .
@@ -213,11 +208,6 @@ jobs:
213208
- name: Push dev images on SBX ECR
214209
if: github.ref == 'refs/heads/dev'
215210
run: |
216-
for component in ${{env.front_debian8_components}}; do
217-
component_tag=${SBX_ECR_REGISTRY_FRONT}/${component}:dev
218-
docker tag navitia/$component ${component_tag}
219-
docker push ${component_tag}
220-
done
221211
for component in ${{env.backend_debian8_components}}; do
222212
component_tag=${SBX_ECR_REGISTRY_BACKEND}/${component}:dev
223213
docker tag navitia/$component ${component_tag}
@@ -227,11 +217,6 @@ jobs:
227217
- name: Push release images on PRD ECR
228218
if: startsWith(github.ref, 'refs/tags/')
229219
run: |
230-
# Tyr-web
231-
tyr_web_tag=${PRD_ECR_REGISTRY}/navitia-tyr-web-tyr-web:${{ needs.common_variables.outputs.RELEASE_TAG }}
232-
docker tag navitia/tyr-web ${tyr_web_tag}
233-
docker push ${tyr_web_tag}
234-
235220
# Kraken
236221
kraken_tag=${PRD_ECR_REGISTRY}/navitia-kraken-kraken:${{ needs.common_variables.outputs.RELEASE_TAG }}
237222
docker tag navitia/kraken ${kraken_tag}
@@ -264,11 +249,93 @@ jobs:
264249
rm -rf ./*
265250
rm -rf ./.??*
266251
252+
debian8_front_images:
253+
runs-on: [self-hosted, corefront, sandbox]
254+
name: Build debian8 front images
255+
needs: common_variables
256+
steps:
257+
- name: force chown to avoid errors
258+
run: sudo chown -R $USER:$USER .
259+
260+
- name: Git config
261+
run: git config --global --add safe.directory /__w/navitia/navitia
262+
263+
- name: Generate github private access token
264+
id: ci-core-app-token
265+
uses: getsentry/[email protected]
266+
with:
267+
app_id: ${{ secrets.CI_CORE_APP_ID }}
268+
private_key: ${{ secrets.CI_CORE_APP_PEM }}
269+
270+
- name: Checkout
271+
uses: actions/checkout@v3
272+
with:
273+
submodules: recursive
274+
token: ${{ steps.ci-core-app-token.outputs.token }}
275+
276+
277+
- name: Login to Amazon ECR
278+
uses: aws-actions/amazon-ecr-login@v1
279+
env:
280+
AWS_REGION: eu-west-1
281+
with:
282+
# 162230498103 : shared
283+
# 051314639660 : corefront sbx
284+
registries: "162230498103,110444322584,051314639660"
285+
286+
- name: Create master docker
287+
run: |
288+
docker build -f docker/debian8/Dockerfile-master -t navitia/master .
289+
docker build -f docker/debian8/Dockerfile-builder -t navitia/builder .
290+
291+
- name: Build packages in master docker
292+
# Will build navitia-*.deb packages in current folder
293+
run: docker run -v `pwd`:/build/navitia/ navitia/builder
294+
295+
- name: Create navitia images
296+
run: |
297+
for component in ${{env.front_debian8_components}}; do
298+
echo "********* Building $component ***************"
299+
docker build -t navitia/$component -f docker/debian8/Dockerfile-${component} .
300+
done
301+
302+
- name: Push dev images on SBX ECR
303+
if: github.ref == 'refs/heads/dev'
304+
run: |
305+
for component in ${{env.front_debian8_components}}; do
306+
component_tag=${SBX_ECR_REGISTRY_FRONT}/${component}:dev
307+
docker tag navitia/$component ${component_tag}
308+
docker push ${component_tag}
309+
done
310+
311+
- name: Push release images on PRD ECR
312+
if: startsWith(github.ref, 'refs/tags/')
313+
run: |
314+
# Tyr-web
315+
tyr_web_tag=${PRD_ECR_REGISTRY}/navitia-tyr-web-tyr-web:${{ needs.common_variables.outputs.RELEASE_TAG }}
316+
docker tag navitia/tyr-web ${tyr_web_tag}
317+
docker push ${tyr_web_tag}
318+
319+
- name: failure notification
320+
if: failure()
321+
run: |
322+
sudo apt update && sudo apt install -y httpie
323+
echo '{"text":":warning: Github Actions: workflow dockers_builder debian8_images failed !"}' | http --json POST ${{secrets.SLACK_NAVITIA_TEAM_URL}}
324+
325+
- name: clean up workspace
326+
if: ${{ always() }}
327+
run: |
328+
# some files are created by a docker container
329+
sudo chown -R $USER:$USER .
330+
rm -rf ./*
331+
rm -rf ./.??*
332+
333+
267334
268335
publish_aws:
269336
runs-on: [self-hosted, corefront, sandbox]
270337
name: Aws Dispatch (Dev)
271-
needs: [debian8_images, debian11_images, common_variables]
338+
needs: [debian8_front_images, debian8_back_images, debian11_images, common_variables]
272339
steps:
273340

274341
- name: Generate token for aws images

0 commit comments

Comments
 (0)