Refactor ci pipeline.

This commit is contained in:
Spencer Ofwiti 2020-12-28 19:00:16 +03:00
parent 06e141d519
commit f17cc1dff3

View File

@ -87,16 +87,16 @@ test:nglint:
- npm ng lint
docker-build:
image: docker:latest
stage: package
image: docker:latest
services:
- docker:dind
variables:
IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA"
before_script:
- docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY
script:
- docker build -t $IMAGE_TAG -f Dockerfile .
- docker push $IMAGE_TAG
only:
- master
before_script:
- echo $CI_BUILD_TOKEN | docker login -u "$CI_REGISTRY_USER"
--password-stdin $CI_REGISTRY
script:
- IMAGE_NAME="$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
- docker build --pull -t "$IMAGE_NAME" -f Dockerfile .
- docker push "$IMAGE_NAME"