Skip to content
Snippets Groups Projects
Commit a32eddbe authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'revert-8decd4f3' into 'main'

Revert "build both dockerfile"

See merge request hub/rshiny-k8s!2
parents 8decd4f3 2f5edc7f
No related branches found
No related tags found
1 merge request!2Revert "build both dockerfile"
Pipeline #101821 failed
...@@ -10,24 +10,20 @@ build: ...@@ -10,24 +10,20 @@ build:
script: script:
- docker --version - docker --version
# pull the latest build on master # pull the latest build on master
- docker pull "$CI_REGISTRY_IMAGE/master/$DOCKERFILE_NAME:latest" || true - docker pull "$CI_REGISTRY_IMAGE/master:latest" || true
# pull the latest build on this branch # pull the latest build on this branch
- docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/$DOCKERFILE_NAME:latest" || true - docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" || true
# build the image while passing commit SHA and tagging the image with it # build the image while passing commit SHA and tagging the image with it
- docker build - docker build
--build-arg CI_COMMIT_REF_SLUG --build-arg CI_COMMIT_REF_SLUG
--build-arg CI_COMMIT_SHA --build-arg CI_COMMIT_SHA
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/$DOCKERFILE_NAME:latest" --cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
--cache-from "$CI_REGISTRY_IMAGE/master/$DOCKERFILE_NAME:latest" --cache-from "$CI_REGISTRY_IMAGE/master:latest"
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/$DOCKERFILE_NAME:$CI_COMMIT_SHA" --tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/$DOCKERFILE_NAME:latest" --tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
-f $DOCKERFILE_NAME -f Dockerfile2
./ ./
# push image as latest for the current branch # push image as latest for the current branch
- docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" - docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
# push image tagged with its sha # push image tagged with its sha
- docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA" - docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
parallel:
matrix:
- DOCKERFILE_NAME: [Dockerfile, Dockerfile2]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment