Skip to content

Commit

Permalink
Merge branch 'main' into cytomine/1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bathienle committed Mar 10, 2025
2 parents f92c90f + 454a1d3 commit 7845cf7
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 11 deletions.
37 changes: 37 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
changelog:
categories:
- title: ✅ Added
labels:
- docs
- feature
- title: 🔁 Changed
labels:
- chore
- dependencies
- enhancement
- perf
- refactor
- style
- title: 🛑 Deprecated
labels:
- deprecated
- title: 🔧 Fixed
labels:
- bug
- title: 🗑️ Removed
labels:
- removed
- title: 🛡️ Security
labels:
- security
- title: 🧪 Test
labels:
- test
exclude:
labels:
- duplicate
- good first issue
- invalid
- question
- wontfix
42 changes: 42 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create release

on:
push:
tags:
- "*.*.*"

jobs:
create-release:
runs-on: ubuntu-latest

steps:
- name: Prerelease check
run: |
if [[ ${{ github.ref_name }} =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
echo "prerelease=false" >> $GITHUB_ENV
else
echo "prerelease=true" >> $GITHUB_ENV
fi
- name: Create release
id: release-creation
uses: actions/github-script@v6
env:
name: ${{ github.ref_name }}
prerelease: ${{ env.prerelease }}
with:
script: |
try {
const response = await github.rest.repos.createRelease({
generate_release_notes: true,
name: process.env.name,
owner: context.repo.owner,
prerelease: process.env.prerelease === "true",
repo: context.repo.repo,
tag_name: process.env.name,
});
return response.data.id;
} catch (error) {
core.setFailed(error.message);
}
55 changes: 55 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and push Docker image

on:
push:
tags:
- "*.*.*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set up the repository
uses: actions/checkout@v3

- name: Release check
id: release
run: |
if [[ ${{ github.ref_name }} =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
echo "release=true" >> $GITHUB_OUTPUT
else
echo "release=false" >> $GITHUB_OUTPUT
fi
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: cytomineuliege/postgis
tags: |
type=raw,value=latest,enable=${{ steps.release.outputs.release }}
type=semver,pattern={{raw}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
build-args: |
ENTRYPOINT_SCRIPTS_VERSION=${{ vars.ENTRYPOINT_SCRIPTS_VERSION }}
IMAGE_REVISION=${{ github.sha }}
IMAGE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
POSTGIS_VERSION=${{ vars.POSTGIS_VERSION }}
context: .
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG ENTRYPOINT_SCRIPTS_VERSION="1.3.0"
ARG IMAGE_VERSION
ARG IMAGE_REVISION
ARG ENTRYPOINT_SCRIPTS_VERSION="1.0.0"
ARG POSTGIS_VERSION="15-3.3-alpine"

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

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

LABEL org.opencontainers.image.authors='support@cytomine.com' \
org.opencontainers.image.url='https://www.cytomine.org/' \
org.opencontainers.image.documentation='https://doc.cytomine.org/' \
org.opencontainers.image.source='https://github.com/cytomine/Cytomine-postgis' \
org.opencontainers.image.vendor='Cytomine Corporation SA' \
org.opencontainers.image.version=${IMAGE_VERSION} \
org.opencontainers.image.revision=${IMAGE_REVISION} \
LABEL org.opencontainers.image.authors="uliege@cytomine.org" \
org.opencontainers.image.url="https://uliege.cytomine.org/" \
org.opencontainers.image.documentation="https://doc.uliege.cytomine.org/" \
org.opencontainers.image.source="https://github.com/Cytomine-ULiege/Cytomine-docker-entrypoint-scripts" \
org.opencontainers.image.vendor="Cytomine ULiège" \
org.opencontainers.image.version="${IMAGE_VERSION}" \
org.opencontainers.image.revision="${IMAGE_REVISION}" \
org.opencontainers.image.deps.postgis.version=${POSTGIS_VERSION} \
org.opencontainers.image.deps.entrypoint.scripts.version=${ENTRYPOINT_SCRIPTS_VERSION}

Expand Down

0 comments on commit 7845cf7

Please sign in to comment.