Skip to content

Commit 7845cf7

Browse files
committed
Merge branch 'main' into cytomine/1.5.1
2 parents f92c90f + 454a1d3 commit 7845cf7

File tree

4 files changed

+143
-11
lines changed

4 files changed

+143
-11
lines changed

.github/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
changelog:
3+
categories:
4+
- title: ✅ Added
5+
labels:
6+
- docs
7+
- feature
8+
- title: 🔁 Changed
9+
labels:
10+
- chore
11+
- dependencies
12+
- enhancement
13+
- perf
14+
- refactor
15+
- style
16+
- title: 🛑 Deprecated
17+
labels:
18+
- deprecated
19+
- title: 🔧 Fixed
20+
labels:
21+
- bug
22+
- title: 🗑️ Removed
23+
labels:
24+
- removed
25+
- title: 🛡️ Security
26+
labels:
27+
- security
28+
- title: 🧪 Test
29+
labels:
30+
- test
31+
exclude:
32+
labels:
33+
- duplicate
34+
- good first issue
35+
- invalid
36+
- question
37+
- wontfix

.github/workflows/create-release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Prerelease check
14+
run: |
15+
if [[ ${{ github.ref_name }} =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
16+
echo "prerelease=false" >> $GITHUB_ENV
17+
else
18+
echo "prerelease=true" >> $GITHUB_ENV
19+
fi
20+
21+
- name: Create release
22+
id: release-creation
23+
uses: actions/github-script@v6
24+
env:
25+
name: ${{ github.ref_name }}
26+
prerelease: ${{ env.prerelease }}
27+
with:
28+
script: |
29+
try {
30+
const response = await github.rest.repos.createRelease({
31+
generate_release_notes: true,
32+
name: process.env.name,
33+
owner: context.repo.owner,
34+
prerelease: process.env.prerelease === "true",
35+
repo: context.repo.repo,
36+
tag_name: process.env.name,
37+
});
38+
39+
return response.data.id;
40+
} catch (error) {
41+
core.setFailed(error.message);
42+
}

.github/workflows/docker.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and push Docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Set up the repository
14+
uses: actions/checkout@v3
15+
16+
- name: Release check
17+
id: release
18+
run: |
19+
if [[ ${{ github.ref_name }} =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
20+
echo "release=true" >> $GITHUB_OUTPUT
21+
else
22+
echo "release=false" >> $GITHUB_OUTPUT
23+
fi
24+
25+
- name: Extract metadata for Docker
26+
id: meta
27+
uses: docker/metadata-action@v5
28+
with:
29+
images: cytomineuliege/postgis
30+
tags: |
31+
type=raw,value=latest,enable=${{ steps.release.outputs.release }}
32+
type=semver,pattern={{raw}}
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v2
36+
37+
- name: Login to Docker Hub
38+
uses: docker/login-action@v2
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
43+
- name: Build and push
44+
uses: docker/build-push-action@v4
45+
with:
46+
build-args: |
47+
ENTRYPOINT_SCRIPTS_VERSION=${{ vars.ENTRYPOINT_SCRIPTS_VERSION }}
48+
IMAGE_REVISION=${{ github.sha }}
49+
IMAGE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
50+
POSTGIS_VERSION=${{ vars.POSTGIS_VERSION }}
51+
context: .
52+
file: ./Dockerfile
53+
labels: ${{ steps.meta.outputs.labels }}
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}

Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
ARG ENTRYPOINT_SCRIPTS_VERSION="1.3.0"
18-
ARG IMAGE_VERSION
19-
ARG IMAGE_REVISION
17+
ARG ENTRYPOINT_SCRIPTS_VERSION="1.0.0"
2018
ARG POSTGIS_VERSION="15-3.3-alpine"
2119

2220
#######################################################################################
2321
## Stage: entrypoint script. Use a multi-stage because COPY --from cannot interpolate variables
24-
FROM cytomine/entrypoint-scripts:${ENTRYPOINT_SCRIPTS_VERSION} as entrypoint-scripts
22+
FROM cytomineuliege/entrypoint-scripts:${ENTRYPOINT_SCRIPTS_VERSION} AS entrypoint-scripts
2523

2624
FROM postgis/postgis:${POSTGIS_VERSION}
2725
ARG ENTRYPOINT_SCRIPTS_VERSION
@@ -61,13 +59,13 @@ RUN chmod +x /usr/local/bin/backup /usr/local/bin/restore /docker-entrypoint-cyt
6159
COPY --from=entrypoint-scripts --chmod=774 /cytomine-entrypoint.sh /usr/local/bin/
6260
COPY --from=entrypoint-scripts --chmod=774 /envsubst-on-templates-and-move.sh /docker-entrypoint-cytomine.d/500-envsubst-on-templates-and-move.sh
6361

64-
LABEL org.opencontainers.image.authors='support@cytomine.com' \
65-
org.opencontainers.image.url='https://www.cytomine.org/' \
66-
org.opencontainers.image.documentation='https://doc.cytomine.org/' \
67-
org.opencontainers.image.source='https://github.com/cytomine/Cytomine-postgis' \
68-
org.opencontainers.image.vendor='Cytomine Corporation SA' \
69-
org.opencontainers.image.version=${IMAGE_VERSION} \
70-
org.opencontainers.image.revision=${IMAGE_REVISION} \
62+
LABEL org.opencontainers.image.authors="uliege@cytomine.org" \
63+
org.opencontainers.image.url="https://uliege.cytomine.org/" \
64+
org.opencontainers.image.documentation="https://doc.uliege.cytomine.org/" \
65+
org.opencontainers.image.source="https://github.com/Cytomine-ULiege/Cytomine-docker-entrypoint-scripts" \
66+
org.opencontainers.image.vendor="Cytomine ULiège" \
67+
org.opencontainers.image.version="${IMAGE_VERSION}" \
68+
org.opencontainers.image.revision="${IMAGE_REVISION}" \
7169
org.opencontainers.image.deps.postgis.version=${POSTGIS_VERSION} \
7270
org.opencontainers.image.deps.entrypoint.scripts.version=${ENTRYPOINT_SCRIPTS_VERSION}
7371

0 commit comments

Comments
 (0)