Skip to content

Commit a7c9418

Browse files
committed
Update cgimap start and github action
1 parent 7d9409d commit a7c9418

File tree

2 files changed

+68
-56
lines changed

2 files changed

+68
-56
lines changed

.github/workflows/chartpress.yaml

+39-41
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,42 @@ jobs:
44
build:
55
runs-on: ubuntu-22.04
66
steps:
7-
- uses: actions/checkout@v3
8-
- name: Login to DockerHub
9-
uses: docker/login-action@v2
10-
with:
11-
username: ${{ secrets.DOCKER_USERNAME }}
12-
password: ${{ secrets.DOCKER_PASSWORD }}
13-
- name: Setup Python
14-
uses: actions/setup-python@v4
15-
with:
16-
python-version: '3.11'
17-
- name: Setup Git
18-
run: |
19-
git config --global user.email "[email protected]"
20-
git config --global user.name "Github Action"
21-
- name: Install Chartpress and Python modules
22-
run: |
23-
pip install -v chartpress six yq
24-
- name: Set env vars for publish charts
25-
run: |
26-
GIT_BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
27-
GIT_BRANCH_NAME=${GIT_BRANCH_NAME/\//_}
28-
OSM_SEED_VERSION=$(yq -r .appVersion ./osm-seed/Chart.yaml)
29-
SHORT_GITHUB_SHA=${GITHUB_SHA::7}
30-
echo "GIT_BRANCH_NAME=$GIT_BRANCH_NAME" >> $GITHUB_ENV
31-
echo "OSM_SEED_VERSION=$OSM_SEED_VERSION" >> $GITHUB_ENV
32-
echo "SHORT_GITHUB_SHA=$SHORT_GITHUB_SHA" >> $GITHUB_ENV
33-
- name: Run Chartpress
34-
env:
35-
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
36-
GITHUB_EVENT_NAME: ${{ github.event_name }}
37-
run: |
38-
if [[ $GIT_BRANCH_NAME = "main" ]]
39-
then
40-
chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}
41-
elif [[ $GIT_BRANCH_NAME = "develop" ]]
42-
then
43-
chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}-dev.h$SHORT_GITHUB_SHA
44-
else
45-
chartpress --push --publish-chart
46-
fi
47-
7+
- uses: actions/checkout@v1
8+
- name: Login to DockerHub
9+
uses: docker/login-action@v1
10+
with:
11+
username: ${{ secrets.DOCKER_USERNAME }}
12+
password: ${{ secrets.DOCKER_PASSWORD }}
13+
- name: Setup python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.8'
17+
- name: Setup git
18+
run: git config --global user.email "[email protected]" && git config --global user.name "Github Action"
19+
- name: Install Chartpress and some python modules
20+
run: |
21+
pip install -v chartpress && pip install six && pip install yq
22+
- name: Set env vars for publish charts
23+
run: |
24+
GIT_BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
25+
GIT_BRANCH_NAME=${GIT_BRANCH_NAME/\//_}
26+
OSM_SEED_VERSION=$(yq -r .appVersion ./osm-seed/Chart.yaml)
27+
SHORT_GITHUB_SHA=${GITHUB_SHA::7}
28+
echo "GIT_BRANCH_NAME=$GIT_BRANCH_NAME" >> $GITHUB_ENV
29+
echo "OSM_SEED_VERSION=$OSM_SEED_VERSION" >> $GITHUB_ENV
30+
echo "SHORT_GITHUB_SHA=$SHORT_GITHUB_SHA" >> $GITHUB_ENV
31+
- name: Run Chartpress
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
34+
GITHUB_EVENT_NAME: ${{ github.event_name }}
35+
run: |
36+
if [[ $GIT_BRANCH_NAME = "main" ]]
37+
then
38+
chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}
39+
elif [[ $GIT_BRANCH_NAME = "develop" ]]
40+
then
41+
chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}-dev.h$SHORT_GITHUB_SHA
42+
else
43+
chartpress --push --publish-chart
44+
fi
45+

images/cgimap/Dockerfile

+29-15
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
FROM ruby:3.3.0 AS builder
2+
23
ENV DEBIAN_FRONTEND=noninteractive
34
ENV workdir=/var/www
45
ENV CGIMAP_GITSHA=8ea707e10aeab5698e6859856111816d75354592
5-
RUN apt-get update && apt-get install -y \
6-
build-essential cmake git-core curl file \
6+
ENV cgimap=/tmp/openstreetmap-cgimap
7+
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
build-essential cmake git curl file \
710
libxml2-dev libpqxx-dev libfcgi-dev zlib1g-dev libbrotli-dev \
811
libboost-program-options-dev libfmt-dev libmemcached-dev libcrypto++-dev \
9-
libargon2-dev libyajl-dev libapache2-mod-fcgid \
10-
&& rm -rf /var/lib/apt/lists/*
11-
ENV cgimap=/tmp/openstreetmap-cgimap
12-
RUN git clone -b master https://github.com/zerebubuth/openstreetmap-cgimap.git $cgimap \
13-
&& cd $cgimap \
14-
&& git checkout $CGIMAP_GITSHA \
15-
&& mkdir build && cd build && cmake .. && cmake --build .
12+
libargon2-dev libyajl-dev \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
RUN git clone https://github.com/zerebubuth/openstreetmap-cgimap.git $cgimap \
16+
&& cd $cgimap \
17+
&& git checkout $CGIMAP_GITSHA \
18+
&& mkdir build && cd build && cmake .. && cmake --build .
19+
20+
21+
FROM ruby:3.3.0-slim
1622

17-
FROM ruby:3.3.0
1823
ENV DEBIAN_FRONTEND=noninteractive
19-
RUN apt-get update && apt-get install -y \
24+
25+
RUN apt-get update && \
26+
apt-get install -y --no-install-recommends curl gnupg && \
27+
echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
28+
curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
29+
apt-get update && \
30+
apt-get install -y --no-install-recommends \
2031
libxml2 libpqxx-6.4 libfcgi zlib1g libbrotli1 \
2132
libboost-program-options1.74.0 libfmt-dev libmemcached11 libcrypto++8 \
22-
libargon2-1 libyajl2 libapache2-mod-fcgid \
23-
&& rm -rf /var/lib/apt/lists/*
33+
libargon2-1 libyajl2 libapache2-mod-fcgid postgresql-client \
34+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
2435

2536
COPY --from=builder /tmp/openstreetmap-cgimap/build/openstreetmap-cgimap /usr/local/bin/openstreetmap-cgimap
26-
RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local_libs.conf && ldconfig
27-
CMD ["openstreetmap-cgimap"]
37+
38+
COPY *.sh /
39+
RUN chmod +x /*.sh && echo "/usr/local/lib" > /etc/ld.so.conf.d/local_libs.conf && ldconfig
40+
41+
CMD ["/start.sh"]

0 commit comments

Comments
 (0)