try to login to registry
This commit is contained in:
parent
d0a9ac0090
commit
0d40e1fe37
1 changed files with 16 additions and 4 deletions
|
@ -3,24 +3,36 @@ image:fedora:
|
|||
image: docker:stable
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
before_script:
|
||||
- docker info
|
||||
- docker login registry.gitlab.com
|
||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
|
||||
script:
|
||||
- docker pull $CONTAINER_IMAGE:latest || true
|
||||
- docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest .
|
||||
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
|
||||
- docker push $CONTAINER_IMAGE:latest
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
DOCKER_DRIVER: overlay2
|
||||
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH/fedora
|
||||
|
||||
image:ubuntu:
|
||||
stage: build
|
||||
image: docker:stable
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
before_script:
|
||||
- docker info
|
||||
- docker login registry.gitlab.com
|
||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
|
||||
script:
|
||||
- docker pull $CONTAINER_IMAGE:latest || true
|
||||
- docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest .
|
||||
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
|
||||
- docker push $CONTAINER_IMAGE:latest
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
DOCKER_DRIVER: overlay2
|
||||
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH/ubuntu
|
||||
|
||||
fedora:
|
||||
before_script:
|
||||
|
|
Loading…
Reference in a new issue