devops: implemented user authentication and improved error handling in login module.
This commit is contained in:
commit
515679f580
@ -0,0 +1,27 @@
|
||||
image: docker:dind
|
||||
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
|
||||
default:
|
||||
before_script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
|
||||
build-and-push docker image to local registry:
|
||||
stage: build
|
||||
script:
|
||||
- if ! test -z "$DOCKERFILE_DIRECTORY"; then cd ${DOCKERFILE_DIRECTORY}; fi
|
||||
- docker build -f "${DOCKERFILE_NAME}" -t "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" --progress=plain .
|
||||
- docker push "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}"
|
||||
|
||||
push docker to destination registry:
|
||||
stage: deploy
|
||||
script:
|
||||
- if test -z "$DOCKER_REGISTRY"; then exit 0; fi
|
||||
- docker pull "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}"
|
||||
- docker tag "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" "${DOCKER_REGISTRY}:${DOCKER_IMAGE_TAG}"
|
||||
- docker push "${DOCKER_REGISTRY}:${DOCKER_IMAGE_TAG}"
|
||||
needs:
|
||||
- "build-and-push docker image to local registry"
|
||||
Loading…
x
Reference in New Issue
Block a user