Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix new release workflow #3896

Merged
merged 12 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 25 additions & 31 deletions .github/workflows/build_dockers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- dev
tags:
- '*'

env:
debian_version: debian8

Expand All @@ -14,31 +15,24 @@ jobs:

runs-on: ubuntu-latest

container:
image: navitia/${{env.debian_version}}_dev
volumes:
# Mount so we can delete files from docker and free up space (>20GB)
- /usr/share/dotnet:/usr/share/dotnet
- /usr/local/lib/android:/usr/local/lib/android


steps:
- name: Free up space
run: |
rm -rf /usr/share/dotnet/*
rm -rf /usr/local/lib/android/*
sudo rm -rf /usr/share/dotnet/*
sudo rm -rf /usr/local/lib/android/*
echo "Free space:"
df -h

- name: Install dependencies
run: |
apt update && apt install -y --force-yes zip httpie dh-python
sudo apt update && sudo apt install -y --force-yes zip httpie

- name: Checkout core_team_ci_tools
uses: actions/checkout@v3
with:
path: core_team_ci_tools
repository : 'hove-io/core_team_ci_tools'
path: core_team_ci_tools
token: ${{ secrets.access_token_github }}

- name: Setup core_team_ci_tools python environment
run: |
Expand All @@ -51,7 +45,7 @@ jobs:
-o hove-io \
-r mimirsbrunn \
-t ${{secrets.access_token_github}} \
-w release.yml \
-w release7.yml \
-a $mimirsbrunn_package \
--output-dir .
unzip -qo $mimirsbrunn_package
Expand All @@ -74,36 +68,38 @@ jobs:
run: |
wget http://prdownloads.sourceforge.net/libkeepalive/libkeepalive-0.3.tar.gz

- name: Restore ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{env.debian_version}-package
max-size: 2000M
save: ${{ github.event_name == 'push' }}

- name: Checkout navitia
uses: actions/checkout@v3
with:
submodules : recursive
path: navitia
fetch-depth: 0

- name: Build navitia packages
working-directory: navitia
# Will build navitia-*.deb packages in folder ../
- name: Restore ccache
uses: hendrikmuhs/[email protected]
with:
key: build_dockers
max-size: 2000M

- name: Create master docker
run: |
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b
docker build -f navitia/docker/${{env.debian_version}}/Dockerfile-master -t navitia/master .

- name: Build packages in master docker
# Will build navitia-*.deb packages in current folder
run: |
docker run -v `pwd`:/build/ -w /navitia/ navitia/master


# see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Choose dev navitia tag
- name: Choose dev tag
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
run: |
echo "building version dev"
echo "navitia_tag=dev" >> $GITHUB_ENV
echo "aws_branch=dev" >> $GITHUB_ENV

- name: Choose release navitia tag
- name: Choose release tag
if: startsWith(github.ref, 'refs/tags/')
run: |
cd navitia
Expand All @@ -114,15 +110,13 @@ jobs:

- name: Create dockers images and push them
run: |
docker build -f navitia/docker/${{env.debian_version}}/Dockerfile-master -t navitia/master .

components='jormungandr kraken tyr-beat tyr-worker tyr-web instances-configurator mock-kraken eitri'
for component in $components; do
echo "********* Building $component ***************"
docker build -t navitia/$component:${{env.navitia_tag}} -f navitia/docker/${{env.debian_version}}/Dockerfile-${component} .

# add latest tag if navitia_tag != dev
if [[ "${{env.navitia_tag}}" != "dev" ]]; then
# add latest tag if we are making a release
if [[ "${{env.aws_branch}}" = "release" ]]; then
docker tag navitia/$component:${{env.navitia_tag}} navitia/$component:latest
fi
done
Expand Down Expand Up @@ -173,4 +167,4 @@ jobs:
- name: success notification on navitia core team
if: success()
run: |
echo '{"text":":octopus: Github Actions: build_dockers succeeded. New navitia ${{env.navitia_tag}} image available.' | http --json POST ${{secrets.SLACK_NAVITIA_CORE_TEAM_URL}}
echo '{"text":":octopus: Github Actions: build_dockers succeeded. New navitia ${{env.navitia_tag}} images available.' | http --json POST ${{secrets.SLACK_NAVITIA_CORE_TEAM_URL}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build Navitia Packages For Dev Multi Distributions
on:
push:
branches:
- dev
- dev_

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_navitia_packages_for_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build Navitia Packages For Release
on:
push:
branches:
- release
- release_


jobs:
Expand Down
5 changes: 5 additions & 0 deletions docker/build_kraken.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
cd /build/navitia/
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b
cd ..
chmod -R 777 .
6 changes: 5 additions & 1 deletion docker/debian10/Dockerfile-master
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ FROM debian:10-slim
# update package list from providers
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y ca-certificates && \
apt-get install -y ca-certificates dh-python && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY navitia/docker/ca-certificates/*.crt /usr/local/share/ca-certificates/
COPY navitia/docker/build_kraken.sh /build_kraken.sh
RUN chmod +x /build_kraken.sh
RUN update-ca-certificates
# Python 'requests' package handle its own CA certificate list
# Let's force it to use the OS's list
ENV REQUESTS_CA_BUNDLE /etc/ssl/certs

ENTRYPOINT /build_kraken.sh
9 changes: 6 additions & 3 deletions docker/debian8/Dockerfile-master
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
FROM navitia/debian8_dev

# update package list from providers
RUN apt-get update --fix-missing
RUN apt-get update --force-yes --fix-missing || exit 0

# upgrade installed packages
RUN apt-get upgrade -y --force-yes

# install postgresql-client for tyr-beat
# netcat for kraken
# curl for jormun
RUN apt-get install -y --force-yes postgresql-client \
ca-certificates \
netcat \
dh-python \
curl

COPY navitia/docker/ca-certificates/*.crt /usr/local/share/ca-certificates/
COPY navitia/docker/build_kraken.sh /build_kraken.sh
RUN chmod +x /build_kraken.sh
RUN update-ca-certificates
# Python 'requests' package handle its own CA certificate list
# Let's force it to use the OS's list
ENV REQUESTS_CA_BUNDLE /etc/ssl/certs

ENTRYPOINT /build_kraken.sh