Skip to content

Commit

Permalink
fix: add PR to build all Dockers
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien3d committed Oct 2, 2024
1 parent 8454a5f commit 71cc18c
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 43 deletions.
81 changes: 41 additions & 40 deletions .github/workflows/dockers_builder.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build Navitia Dockers

on:
pull_request:
push:
branches:
- dev
Expand All @@ -12,8 +13,8 @@ env:
backend_components: 'kraken tyr-beat tyr-worker mock-kraken eitri'
backend_core_components: 'jormungandr kraken tyr-beat tyr-worker'

SBX_ECR_REGISTRY_BACKEND: "110444322584.dkr.ecr.eu-west-1.amazonaws.com"
SBX_ECR_REGISTRY_FRONT: "051314639660.dkr.ecr.eu-west-1.amazonaws.com"
SBX_ECR_REGISTRY_BACKEND: "110444322584.dkr.ecr.eu-west-1.amazonaws.com" # navitia-kraken-sandbox
SBX_ECR_REGISTRY_FRONT: "051314639660.dkr.ecr.eu-west-1.amazonaws.com" # navitia-corefront-sandbox
PRD_ECR_REGISTRY: "162230498103.dkr.ecr.eu-west-1.amazonaws.com"

jobs:
Expand Down Expand Up @@ -87,7 +88,7 @@ jobs:
- name: Create master&builder docker
run: |
docker build -f docker/debian11/Dockerfile-master -t navitia/master_debian11 .
docker build -f docker/debian11/Dockerfile-builder -t navitia/builder_debian11 .
docker build -f docker/debian11/Dockerfile-builder-kraken -t navitia/builder_debian11 .
- name: Build packages in master docker
run: |
Expand Down Expand Up @@ -185,7 +186,7 @@ jobs:
- name: Create navitia images
run: |
echo "********* Building Tyr Web ***************"
docker build -t navitia/$component --build-arg GITHUB_TOKEN=${{ steps.ci-core-app-token.outputs.token }} -f docker/debian11/Dockerfile-tyr-web .
docker build -t navitia/tyr-web --build-arg GITHUB_TOKEN=${{ steps.ci-core-app-token.outputs.token }} -f docker/debian11/Dockerfile-tyr-web .
- name: Push dev images on SBX ECR
if: github.ref == 'refs/heads/dev'
Expand Down Expand Up @@ -414,46 +415,46 @@ jobs:
rm -rf ./.??*
publish_aws:
runs-on: [self-hosted, corefront, sandbox]
name: Aws Dispatch (Dev)
needs: [debian8_front_images, debian8_back_images, debian11_images, common_variables]
steps:
- name: Generate token for aws images
id: app-token
uses: getsentry/[email protected]
with:
app_id: ${{ secrets.GA_OS_WORKFLOW_TRIGGER_APP_ID }}
private_key: ${{ secrets.GA_OS_WORKFLOW_TRIGGER_APP_PEM }}

- name: Aws Dispatch Frontend for dev
if: github.ref == 'refs/heads/dev'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ steps.app-token.outputs.token }}
repository: hove-io/corefront-aws-assets
event-type: build-trigger
client-payload: '{"branch": "dev", "tag": "dev"}'

- name: Aws Dispatch Frontend for release
if: startsWith(github.ref, 'refs/tags/')
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ steps.app-token.outputs.token }}
repository: hove-io/corefront-aws-assets
event-type: build-trigger
client-payload: '{"branch": "release", "tag": "${{ needs.common_variables.outputs.RELEASE_TAG }}"}'

- name: failure notification
if: failure()
run: |
sudo apt update && sudo apt install -y httpie
echo '{"text":":warning: Github Actions: dockers_builder the job publish_aws failed !"}' | http --json POST ${{secrets.SLACK_NAVITIA_TEAM_URL}}
# publish_aws:
# runs-on: [self-hosted, corefront, sandbox]
# name: Aws Dispatch (Dev)
# needs: [debian8_front_images, debian8_back_images, debian11_images, common_variables]
# steps:
# - name: Generate token for aws images
# id: app-token
# uses: getsentry/[email protected]
# with:
# app_id: ${{ secrets.GA_OS_WORKFLOW_TRIGGER_APP_ID }}
# private_key: ${{ secrets.GA_OS_WORKFLOW_TRIGGER_APP_PEM }}

# - name: Aws Dispatch Frontend for dev
# if: github.ref == 'refs/heads/dev'
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ steps.app-token.outputs.token }}
# repository: hove-io/corefront-aws-assets
# event-type: build-trigger
# client-payload: '{"branch": "dev", "tag": "dev"}'

# - name: Aws Dispatch Frontend for release
# if: startsWith(github.ref, 'refs/tags/')
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ steps.app-token.outputs.token }}
# repository: hove-io/corefront-aws-assets
# event-type: build-trigger
# client-payload: '{"branch": "release", "tag": "${{ needs.common_variables.outputs.RELEASE_TAG }}"}'

# - name: failure notification
# if: failure()
# run: |
# sudo apt update && sudo apt install -y httpie
# echo '{"text":":warning: Github Actions: dockers_builder the job publish_aws failed !"}' | http --json POST ${{secrets.SLACK_NAVITIA_TEAM_URL}}


run_artemis:
runs-on: [self-hosted, corefront, sandbox]
needs: [publish_aws]
needs: [debian11_back_images, debian11_front_images]
name: Run artemis Dispatch (Dev)
if: github.ref == 'refs/heads/dev'
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ jobs:
if: ${{ matrix.os.docker_image == 'mutable-debian8_dev'}}
run: |
apt remove --yes cmake
apt install wget -y
mkdir local_bin
cd local_bin
wget https://cmake.org/files/v3.18/cmake-3.18.6-Linux-x86_64.tar.gz
Expand Down
3 changes: 2 additions & 1 deletion docker/debian11/Dockerfile-master
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ RUN apt-get install -y --force-yes ca-certificates \
postgresql-client \
netcat \
dh-python \
curl
curl \
wget

COPY docker/ca-certificates/*.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion docker/debian11/Dockerfile-tyr-web
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN apt-get update --fix-missing \
# Let's force it to use the OS's list
ENV REQUESTS_CA_BUNDLE /etc/ssl/certs

RUN cp /usr/bin/manage_tyr.py /usr/src/app/manage_tyr.py
RUN cp tyr/manage_tyr.py /usr/src/app/manage_tyr.py

COPY docker/run_tyr_web.sh /usr/src/app/run.sh
RUN chmod +x /usr/src/app/run.sh
Expand Down
6 changes: 6 additions & 0 deletions docker/debian11/Dockerfile-tyr-worker
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM debian:bullseye-slim

RUN apt-get update \
&& apt install -y python git libgeos-c1v5 libpq5 curl

RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
RUN python2 get-pip.py

# Install some binaries from tartare-tools
ENV TARTARE_TOOLS_VERSION="v0.46.0"
ARG GITHUB_TOKEN
Expand Down
3 changes: 2 additions & 1 deletion docker/debian8/Dockerfile-master
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ RUN apt-get install -y --force-yes ca-certificates \
postgresql-client \
netcat \
dh-python \
curl
curl \
wget

COPY docker/ca-certificates/*.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates
Expand Down

0 comments on commit 71cc18c

Please sign in to comment.