Skip to content

Commit

Permalink
Update docker build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ridoo committed Jan 23, 2024
1 parent 97c75de commit e572ea0
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 806 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/52n-build-4.2.x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "[52n-4.2.x -> 4.2.x] Builds GeoNode Docker Images"

concurrency:
group: "geonode_build_master"
cancel-in-progress: true

env:
TITLE: "52°North GeoNode Docker Image"
VENDOR: "52°North GmbH"
AUTHORS: "https://52North.org/"
DESCRIPTION: "Builds and publishes the Docker images GeoNode, GeoServer, Nginx"
LICENSE: "GPL-3.0"
TAG: 4.2.x

on:
push:
branches:
- "52n-4.2.x"

jobs:
build_and_push_geonode:
runs-on: ubuntu-22.04
env:
IMAGE: 52north/geonode
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE }}
labels: |
"org.opencontainers.image.authors=${{ env.AUTHORS }}"
"org.opencontainers.image.vendor=${{ env.VENDOR }}"
"org.opencontainers.image.description=${{ env.DESCRIPTION }}"
"org.opencontainers.image.title=${{ env.TITLE }}"
"org.opencontainers.image.licenses=${{ env.LICENSE }}"
tags: |
latest
${{ env.TAG }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN_52N_MASTER }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
133 changes: 0 additions & 133 deletions .github/workflows/52n-build-master.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/52n-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release GeoNode Docker Images

concurrency:
group: "geonode_build_release"
cancel-in-progress: true

env:
TITLE: "52°North GeoNode Docker Image"
VENDOR: "52°North GmbH"
AUTHORS: "https://52North.org/"
DESCRIPTION: "Builds and publishes the Docker images GeoNode, GeoServer, Nginx"
LICENSE: "GPL-3.0"

on:
push:
tags:
- "*-52n"

jobs:
build_and_push_geonode:
runs-on: ubuntu-22.04
env:
IMAGE: 52north/geonode
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Parse semver string
id: semver_parser
uses: booxmedialtd/ws-action-parse-semver@v1
with:
input_string: "${{github.ref_name}}"
version_extractor_regex: '(.*)-52n'
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE }}
labels: |
"org.opencontainers.image.authors=${{ env.AUTHORS }}"
"org.opencontainers.image.vendor=${{ env.VENDOR }}"
"org.opencontainers.image.description=${{ env.DESCRIPTION }}"
"org.opencontainers.image.title=${{ env.TITLE }}"
"org.opencontainers.image.licenses=${{ env.LICENSE }}"
tags: |
latest
${{ steps.semver_parser.outputs.fullversion }}
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN_52N_MASTER }}
-
name: Fail in case fully tagged version already exists
run: |
if docker manifest inspect ${{ env.IMAGE }}:${{ steps.semver_parser.outputs.fullversion }}; then
echo "tag version already exists! Will not override."
exit 1
fi
-
name: Build and push
if: ${{ !github.event.act }} # skip during local actions testing
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max

23 changes: 18 additions & 5 deletions README_52n.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@ This image is built from a fork of [Geonode](https://github.com/geonode/geonode)

However, we are interested to stay as close to upstream as possible, to benefit from ongoing development, but also to contribute features and fixes we develop in our projects.

Starting from version `4` this image is built from the `52n-master` branch of the [`52north/geonode` repository](https://github.com/52North/geonode/tree/52n-master).
The repository builds and publishes three images:

Starting from version `4` this image is built from branch `52n-<geonode-branchname>` of the [`52north/geonode` repository](https://github.com/52North/geonode/tree/52n-master).
Please note, that GeoNode depends on other components which are also available as Docker images.
These images, however, are maintained, built and published from a [`52north/geonode-docker` repository](https://github.com/52North/geonode-docker).

> 💡 **Note:**
>
> Please note that the versioning schema is different from the upstream project.
> All images are released and tagged using the GeoNode version.

You can obtain all images from here:

* [`52north/geonode`](https://hub.docker.com/r/52north/geonode) (this image)
* [`52north/geonode-geoserver`](https://hub.docker.com/r/52north/geonode-geoserver)
* [`52north/geonode-geoserver_data`](https://hub.docker.com/r/52north/geonode-geoserver_data)
* [`52north/geonode-nginx`](https://hub.docker.com/r/52north/geonode-nginx)
* [`52north/geonode-geoserver`](https://hub.docker.com/r/52north/geonode-geoserver)
* [`52north/geonode-postgis`](https://hub.docker.com/r/52north/geonode-postgis)

The Dockerfiles can be found under the [`./scripts/docker` folder](https://github.com/52North/geonode/tree/52n-master/scripts/docker).

The official Docker configuration of [GeoServer for GeoNode](https://github.com/GeoNode/geoserver-docker) seems to be outdated.
Therefore, our fork adds a `./scripts/docker/geoserver` Docker config which is based on [the geonode-project](https://github.com/geonode/geonode-project) template.
The GeoNode Dockerfile can be found under the [`./scripts/docker` folder](https://github.com/52North/geonode/tree/52n-master/scripts/docker).
The Dockerfiles for the dependent components are available at [the geonode-docker repository](https://github.com/52North/geonode-docker).


Depending on our current project contexts we merge regularly from upstream, and create new pull requests based on this fork.

Expand Down
Loading

0 comments on commit e572ea0

Please sign in to comment.