Skip to content

Commit 748df0a

Browse files
authored
Merge pull request #3896 from hove-io/fix_modify_release
fix new release workflow 🤞
2 parents 453aebf + 074ba91 commit 748df0a

6 files changed

+43
-37
lines changed

.github/workflows/build_dockers.yml

+25-31
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- dev
77
tags:
88
- '*'
9+
910
env:
1011
debian_version: debian8
1112

@@ -14,31 +15,24 @@ jobs:
1415

1516
runs-on: ubuntu-latest
1617

17-
container:
18-
image: navitia/${{env.debian_version}}_dev
19-
volumes:
20-
# Mount so we can delete files from docker and free up space (>20GB)
21-
- /usr/share/dotnet:/usr/share/dotnet
22-
- /usr/local/lib/android:/usr/local/lib/android
23-
24-
2518
steps:
2619
- name: Free up space
2720
run: |
28-
rm -rf /usr/share/dotnet/*
29-
rm -rf /usr/local/lib/android/*
21+
sudo rm -rf /usr/share/dotnet/*
22+
sudo rm -rf /usr/local/lib/android/*
3023
echo "Free space:"
3124
df -h
3225
3326
- name: Install dependencies
3427
run: |
35-
apt update && apt install -y --force-yes zip httpie dh-python
28+
sudo apt update && sudo apt install -y --force-yes zip httpie
3629
3730
- name: Checkout core_team_ci_tools
3831
uses: actions/checkout@v3
3932
with:
40-
path: core_team_ci_tools
4133
repository : 'hove-io/core_team_ci_tools'
34+
path: core_team_ci_tools
35+
token: ${{ secrets.access_token_github }}
4236

4337
- name: Setup core_team_ci_tools python environment
4438
run: |
@@ -51,7 +45,7 @@ jobs:
5145
-o hove-io \
5246
-r mimirsbrunn \
5347
-t ${{secrets.access_token_github}} \
54-
-w release.yml \
48+
-w release7.yml \
5549
-a $mimirsbrunn_package \
5650
--output-dir .
5751
unzip -qo $mimirsbrunn_package
@@ -74,36 +68,38 @@ jobs:
7468
run: |
7569
wget http://prdownloads.sourceforge.net/libkeepalive/libkeepalive-0.3.tar.gz
7670
77-
- name: Restore ccache
78-
uses: hendrikmuhs/[email protected]
79-
with:
80-
key: ${{env.debian_version}-package
81-
max-size: 2000M
82-
save: ${{ github.event_name == 'push' }}
83-
8471
- name: Checkout navitia
8572
uses: actions/checkout@v3
8673
with:
8774
submodules : recursive
8875
path: navitia
8976
fetch-depth: 0
9077

91-
- name: Build navitia packages
92-
working-directory: navitia
93-
# Will build navitia-*.deb packages in folder ../
78+
- name: Restore ccache
79+
uses: hendrikmuhs/[email protected]
80+
with:
81+
key: build_dockers
82+
max-size: 2000M
83+
84+
- name: Create master docker
9485
run: |
95-
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b
86+
docker build -f navitia/docker/${{env.debian_version}}/Dockerfile-master -t navitia/master .
87+
88+
- name: Build packages in master docker
89+
# Will build navitia-*.deb packages in current folder
90+
run: |
91+
docker run -v `pwd`:/build/ -w /navitia/ navitia/master
9692
9793
9894
# see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
99-
- name: Choose dev navitia tag
95+
- name: Choose dev tag
10096
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
10197
run: |
10298
echo "building version dev"
10399
echo "navitia_tag=dev" >> $GITHUB_ENV
104100
echo "aws_branch=dev" >> $GITHUB_ENV
105101
106-
- name: Choose release navitia tag
102+
- name: Choose release tag
107103
if: startsWith(github.ref, 'refs/tags/')
108104
run: |
109105
cd navitia
@@ -114,15 +110,13 @@ jobs:
114110
115111
- name: Create dockers images and push them
116112
run: |
117-
docker build -f navitia/docker/${{env.debian_version}}/Dockerfile-master -t navitia/master .
118-
119113
components='jormungandr kraken tyr-beat tyr-worker tyr-web instances-configurator mock-kraken eitri'
120114
for component in $components; do
121115
echo "********* Building $component ***************"
122116
docker build -t navitia/$component:${{env.navitia_tag}} -f navitia/docker/${{env.debian_version}}/Dockerfile-${component} .
123117
124-
# add latest tag if navitia_tag != dev
125-
if [[ "${{env.navitia_tag}}" != "dev" ]]; then
118+
# add latest tag if we are making a release
119+
if [[ "${{env.aws_branch}}" = "release" ]]; then
126120
docker tag navitia/$component:${{env.navitia_tag}} navitia/$component:latest
127121
fi
128122
done
@@ -173,4 +167,4 @@ jobs:
173167
- name: success notification on navitia core team
174168
if: success()
175169
run: |
176-
echo '{"text":":octopus: Github Actions: build_dockers succeeded. New navitia ${{env.navitia_tag}} image available.' | http --json POST ${{secrets.SLACK_NAVITIA_CORE_TEAM_URL}}
170+
echo '{"text":":octopus: Github Actions: build_dockers succeeded. New navitia ${{env.navitia_tag}} images available.' | http --json POST ${{secrets.SLACK_NAVITIA_CORE_TEAM_URL}}

.github/workflows/build_navitia_packages_for_dev_multi_distribution.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build Navitia Packages For Dev Multi Distributions
33
on:
44
push:
55
branches:
6-
- dev
6+
- dev_
77

88
jobs:
99
build:

.github/workflows/build_navitia_packages_for_release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build Navitia Packages For Release
33
on:
44
push:
55
branches:
6-
- release
6+
- release_
77

88

99
jobs:

docker/build_kraken.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
cd /build/navitia/
3+
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b
4+
cd ..
5+
chmod -R 777 .

docker/debian10/Dockerfile-master

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ FROM debian:10-slim
33
# update package list from providers
44
RUN apt-get update && \
55
apt-get upgrade -y && \
6-
apt-get install -y ca-certificates && \
6+
apt-get install -y ca-certificates dh-python && \
77
apt-get clean && \
88
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
99

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

docker/debian8/Dockerfile-master

100644100755
+6-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
FROM navitia/debian8_dev
22

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

6-
# upgrade installed packages
7-
RUN apt-get upgrade -y --force-yes
86

97
# install postgresql-client for tyr-beat
108
# netcat for kraken
119
# curl for jormun
1210
RUN apt-get install -y --force-yes postgresql-client \
1311
ca-certificates \
1412
netcat \
13+
dh-python \
1514
curl
1615

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

0 commit comments

Comments
 (0)