Skip to content

Commit

Permalink
Add gitlab-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaz committed Jul 2, 2024
1 parent 82f4637 commit 0f52a74
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
image: docker:stable

stages:
- build_backend

variables:
BACKEND_NAME: $CI_REGISTRY/scpomedialab/resin-annuaire-backend

before_script:
- VERSION=$(echo $CI_COMMIT_TAG | sed -nre 's/^v([0-9.]+)$/\1/p')
- if [ -n "${VERSION}" ]; then IMAGE_TAG=${VERSION}; else IMAGE_TAG=${CI_COMMIT_REF_SLUG}; fi

build_backend:
stage: build_backend
script:
- docker build -t $BACKEND_NAME:$IMAGE_TAG -f Dockerfile .
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push $BACKEND_NAME:$IMAGE_TAG
environment:
name: $CI_COMMIT_REF_SLUG
only:
- tags

0 comments on commit 0f52a74

Please sign in to comment.