Skip to content

Commit

Permalink
Merge pull request #63 from camptocamp/minor-fix
Browse files Browse the repository at this point in the history
Never push on latest branch, fix delete backport images
  • Loading branch information
sbrunner authored Jul 10, 2020
2 parents 143a5a4 + 06a7ad0 commit c36253c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: docker
schedule:
interval: weekly
time: '02:00'
4 changes: 1 addition & 3 deletions .github/workflows/clean-dockerhub-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---

name: Clean docker hub tags

on:
delete
on: delete

jobs:
clean:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/rebuild.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---

name: Rebuild

on:
schedule:
- cron: "30 2 * * *"
- cron: '30 2 * * *'

jobs:
main:
Expand All @@ -19,7 +18,7 @@ jobs:
- master
- '3.4'
- '3.10'
- '3.12'
- '3.14'

env:
MAIN_BRANCH: master
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ FROM osgeo/gdal:ubuntu-small-3.1.1 as builder
LABEL maintainer="[email protected]"

RUN apt update && \
apt upgrade --assume-yes && \
apt install --assume-yes --no-install-recommends apt-utils software-properties-common && \
apt autoremove --assume-yes software-properties-common && \
LC_ALL=C DEBIAN_FRONTEND=noninteractive apt install --assume-yes --no-install-recommends cmake gcc \
Expand Down Expand Up @@ -68,22 +67,23 @@ ENV APACHE_CONFDIR=/etc/apache2 \
APACHE_LOG_DIR=/var/log/apache2 \
LANG=C.UTF-8

RUN apt-get update && \
apt-get install --assume-yes --no-install-recommends apt-utils software-properties-common && \
RUN apt update && \
apt upgrade --assume-yes && \
apt install --assume-yes --no-install-recommends apt-utils software-properties-common && \
apt autoremove --assume-yes software-properties-common && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends \
apt update && \
DEBIAN_FRONTEND=noninteractive apt install --assume-yes --no-install-recommends \
libfcgi libgslcblas0 libqca-qt5-2 libqca-qt5-2-plugins libzip5 \
libqt5opengl5 libqt5sql5-sqlite libqt5concurrent5 libqt5positioning5 libqt5script5 \
libqt5webkit5 libqwt-qt5-6 libspatialindex6 libspatialite7 libsqlite3-0 libqt5keychain1 \
python3 python3-pip python3-setuptools python3-pyqt5 python3-owslib python3-jinja2 python3-pygments \
python3-pyqt5.qtsql PyQt5.QtSvg \
python3-pyqt5.qtsql \
spawn-fcgi xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb \
apache2 libapache2-mod-fcgid \
python3-pyqt5.qsci python3-pil python3-psycopg2 python3-shapely libpython3-dev \
libqt5serialport5 libqt5quickwidgets5 libexiv2-27 libprotobuf17 libprotobuf-lite17 \
libgsl23 && \
apt-get clean && \
apt clean && \
rm -rf /var/lib/apt/lists/*

# Be able to install font as nonroot
Expand Down
14 changes: 11 additions & 3 deletions ci/clean-dockerhub-tag
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ def clean():
token = requests.post(
"https://hub.docker.com/v2/users/login/",
headers={"Content-Type": "application/json"},
data=json.dumps({"username": os.environ["USERNAME"], "password": os.environ["PASSWORD"]}),
data=json.dumps(
{"username": os.environ["USERNAME"], "password": os.environ["PASSWORD"]}
),
).json()["token"]

with open(os.environ["GITHUB_EVENT_PATH"]) as event_file:
ref = json.loads(event_file.read())["ref"]

ref = ref.replace("/", "_")

print("Delete image 'camptocamp/qgis-server:{}'.".format(ref))

response = requests.head(
"https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format(tag=ref),
"https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format(
tag=ref
),
headers={"Authorization": "JWT " + token},
)
if response.status_code == 404:
Expand All @@ -34,7 +40,9 @@ def clean():
sys.exit(2)

response = requests.delete(
"https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format(tag=ref),
"https://hub.docker.com/v2/repositories/camptocamp/qgis-server/tags/{tag}/".format(
tag=ref
),
headers={"Authorization": "JWT " + token},
)
if not response.ok:
Expand Down
5 changes: 1 addition & 4 deletions ci/publish
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

if [ $# -gt 0 ]
then
TAG="$1"
elif [[ "${GITHUB_REF}" == "refs/heads/master" ]]
then
TAG=latest
TAG="$1" if
elif [[ "${GITHUB_REF}" =~ ^refs/tags/.* ]]
then
TAG=$(echo "${GITHUB_REF}"|sed 's|^refs/tags/||g')
Expand Down

0 comments on commit c36253c

Please sign in to comment.