Skip to content

Commit d038f6a

Browse files
committed
total refactoring ;
- adapting official Docker PostgreSQL repository best practices ( multi debian, multi tags, templating, version.json, ... ) - auto refreshing README.md .github/workflows/main.yml .circleci/config.yml - adding geo bundle images - new Makefile - etc
1 parent c8f7932 commit d038f6a

File tree

142 files changed

+7255
-1399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+7255
-1399
lines changed

.circleci/config.yml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# .circleci/config.yml
2+
3+
# Circle CI arm64 builder
4+
version: 2.1
5+
6+
orbs:
7+
# https://circleci.com/developer/orbs/orb/circleci/docker
8+
docker: circleci/[email protected]
9+
10+
jobs:
11+
build-arm64:
12+
machine:
13+
image: ubuntu-2204:current
14+
resource_class: arm.medium
15+
environment:
16+
BUILDX_PLATFORMS: linux/arm64v8
17+
DOCKER_BUILDKIT: '1'
18+
PLATFORM: linux/arm64v8
19+
parameters:
20+
target-version-variant:
21+
type: string
22+
steps:
23+
- checkout
24+
- run: uname -a
25+
- run: docker --version
26+
- run: docker info
27+
- run: source tools/environment_init.sh
28+
- run: make check_version
29+
- docker/check:
30+
registry: docker.io
31+
docker-username: DOCKERHUB_USERNAME
32+
docker-password: DOCKERHUB_ACCESS_TOKEN
33+
34+
- run:
35+
name: Conditional Docker Check - Halt if not on master branch or if it's a PR
36+
command: |
37+
# Check if the current branch is 'master' and the weekly image is not extis
38+
# If weekly image exists, skip docker build and push
39+
if [ "$CIRCLE_BRANCH" == "master" ] && check_image_exists "${{ matrix.version }}-${{ matrix.variant }}$(IMAGE_VERSION_ID)"; then
40+
circleci-agent step halt
41+
fi
42+
43+
- run: make -n test-<< parameters.target-version-variant >>
44+
- run: make test-<< parameters.target-version-variant >>
45+
- run: docker images
46+
47+
- run:
48+
name: Conditional Docker Check - Halt if not on master branch or if it's a PR
49+
command: |
50+
# Check if the current branch is NOT 'master' or if the build is triggered by a pull request.
51+
# If either of these conditions is met, halt the workflow.
52+
if [ "$CIRCLE_BRANCH" != "master" ] || [ -n "$CIRCLE_PULL_REQUEST" ]; then
53+
circleci-agent step halt
54+
fi
55+
56+
- run:
57+
name: Install manifest-tool (linux-arm64 )
58+
command: |
59+
wget https://github.com/estesp/manifest-tool/releases/download/v2.0.8/binaries-manifest-tool-2.0.8.tar.gz
60+
mkdir manifest-tool
61+
tar -xvzf binaries-manifest-tool-2.0.8.tar.gz -C manifest-tool
62+
sudo mv manifest-tool/manifest-tool-linux-arm64 /usr/local/bin/manifest-tool
63+
manifest-tool -v
64+
65+
- run:
66+
name: "Push docker image : make push-<< parameters.target-version-variant >>"
67+
command: |
68+
if [ "$CIRCLE_BRANCH" == "master" ] && [ -z "$CIRCLE_PULL_REQUEST" ]; then
69+
make push-<< parameters.target-version-variant >>
70+
make manifest-<< parameters.target-version-variant >>
71+
echo "...push and manifest done..."
72+
fi
73+
74+
workflows:
75+
build-deploy:
76+
# AND triggered by weekly from the app.circleci.com UI
77+
jobs:
78+
- build-arm64:
79+
matrix:
80+
parameters:
81+
target-version-variant: [
82+
#
83+
# They are created using the ./apply-ci.sh script based on the version.json file,
84+
# where the architecture is defined as "arm64".
85+
# These "--skip--" images serve as inputs for the "*-bundle" images,
86+
# hence they must be generated within the bundle JOB.
87+
#
88+
#circleci-targets-start
89+
"11-3.3-alpine3.18",
90+
"11-3.3-bookworm",
91+
"11-3.3-bullseye",
92+
"12-3.4-alpine3.18",
93+
"12-3.4-bookworm",
94+
"12-3.4-bullseye",
95+
"13-3.4-alpine3.18",
96+
# --skip-- "13-3.4-bookworm", --> generated with the related bundle job!
97+
"13-3.4-bullseye",
98+
"13-3.4-bundle-bookworm",
99+
"14-3.4-alpine3.18",
100+
# --skip-- "14-3.4-bookworm", --> generated with the related bundle job!
101+
"14-3.4-bullseye",
102+
"14-3.4-bundle-bookworm",
103+
"15-3.4-alpine3.18",
104+
# --skip-- "15-3.4-bookworm", --> generated with the related bundle job!
105+
"15-3.4-bullseye",
106+
"15-3.4-bundle-bookworm",
107+
"15-master-bookworm",
108+
"15-recentstack-bookworm",
109+
"16-3.4-alpine3.18",
110+
# --skip-- "16-3.4-bookworm", --> generated with the related bundle job!
111+
"16-3.4-bullseye",
112+
"16-3.4-bundle-bookworm",
113+
"16-master-bookworm",
114+
"16-recentstack-bookworm",
115+
#circleci-targets-end
116+
]

.dockerignore

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1-
Dockerfile
21
.git
32
_*
3+
.jq-template.awk
4+
.vscode/
5+
6+
.git/
7+
.github/
8+
.gitignore
9+
.circleci/
10+
11+
docs/
12+
README.md
13+
version.json
14+
15+
Dockerfile.*.template
16+
localetest.sh
17+
apply-*.sh

.env

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PROD setup
2+
#
3+
# Setup info, used by:
4+
# ./update.sh and other scripts ( ./apply-*.sh )
5+
# ./Makefile
6+
# ./.github/workflows/main.yml
7+
# ./.circleci/config.yml
8+
#
9+
# IF your are changing the values, please run ./update.sh
10+
# to update some hard coded values in the Dockerfiles or README.md
11+
#
12+
13+
REGISTRY=docker.io
14+
REPO_NAME=imresamu
15+
IMAGE_NAME=postgis
16+
DOCKERHUB_README_REPOSITORY=imresamu/postgis
17+
18+
dockerhublink='https://registry.hub.docker.com/r/imresamu/postgis/tags?page=1&name='
19+
githubrepolink='https://github.com/imresamu/docker-postgis/blob/master'
20+
21+
ENABLE_IMAGE_ARCH=true
22+
ENABLE_IMAGE_VERSION_ID=true

.env.test

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Test Setup ; if TEST=true
2+
#
3+
# Setup info, used by:
4+
# ./update.sh and other scripts ( ./apply-*.sh )
5+
# ./Makefile
6+
# ./.github/workflows/main.yml
7+
# ./.circleci/config.yml
8+
#
9+
# IF your are changing the values, please run ./update.sh
10+
# to update some hard coded values in the Dockerfiles or README.md
11+
#
12+
13+
REGISTRY=localhost:5000
14+
REPO_NAME=testrepo
15+
IMAGE_NAME=testpostgisimage
16+
DOCKERHUB_README_REPOSITORY=testrepo/testpostgisimage
17+
18+
dockerhublink='https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&name='
19+
githubrepolink='https://github.com/postgis/docker-postgis/blob/master'
20+
21+
ENABLE_IMAGE_ARCH=true
22+
ENABLE_IMAGE_VERSION_ID=true
23+

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://github.com/actions/checkout/issues/135#issuecomment-613361104
2+
* text eol=lf
3+
4+
/*/**/Dockerfile linguist-generated
5+
/*/**/initdb-postgis.sh linguist-generated
6+
/*/**/update-postgis.sh linguist-generated
7+
/*/**/tags linguist-generated
8+
.github/workflows/main.yml linguist-generated
9+
versions.json linguist-generated
10+
README.md linguist-generated
11+
/Dockerfile*.template linguist-language=Dockerfile

.github/workflows/localtest.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Localtest"
2+
# testing the workflow
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '15 5 * * 1'
8+
9+
jobs:
10+
localtest:
11+
name: "testing ./localtest.sh ( update.sh and build test and push to local registry )"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- run: docker ps -a
16+
- run: ./localtest.sh
17+
- run: docker images

0 commit comments

Comments
 (0)