Skip to content

Commit

Permalink
Fix Docker Hub push
Browse files Browse the repository at this point in the history
  • Loading branch information
Programie committed Oct 2, 2021
1 parent 85c1348 commit 18521e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ Push Docker latest:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
# Then we tag it "latest"
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA programie/phpdyndns:latest
# Annnd we push it.
- docker push $CI_REGISTRY_IMAGE:latest
- echo -n $DOCKER_HUB_TOKEN | docker login -u programie --password-stdin
- docker push programie/phpdyndns:latest

# Finally, the goal here is to Docker tag any Git tag
# GitLab will start a new pipeline everytime a Git tag is created, which is pretty awesome
Expand All @@ -110,7 +113,7 @@ Push Docker tag:
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA programie/phpdyndns:$CI_COMMIT_REF_NAME
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- docker login -u ${DOCKER_HUB_ID}
- echo -n $DOCKER_HUB_TOKEN | docker login -u programie --password-stdin $DOCKER_HUB_TOKEN
- echo -n $DOCKER_HUB_TOKEN | docker login -u programie --password-stdin
- docker push programie/phpdyndns:$CI_COMMIT_REF_NAME

0 comments on commit 18521e4

Please sign in to comment.