Closed gusbemacbe closed 2 years ago
hi @gusbemacbe I copied your .gitlab-ci.yml
, reduced it to the relevant parts, made some smaller changes, ran it in gitlab it seems to be working. I assume there are some flaws leading to empty variables or so.
This works for me:
(you can ignore the build
step- that's just for building and pushing a dummy image and printing some stuff for debugging. The complete-alpine
part is the relevant one, which I copied from your file and modified it.)
gitlab-ci.yml
:
stages:
- build
- release
docker-build:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$DOCKER_HUB_LOGIN" -p "$DOCKER_HUB_PASSWORD"
script:
- docker build -t "docker.io/$DOCKER_HUB_LOGIN/test228:latest" .
- docker push "docker.io/$DOCKER_HUB_LOGIN/test228:latest"
- echo ------1-------
- echo $DOCKER_HUB_PASSWORD
- echo ------2-------
- echo $DOCKER_HUB_LOGIN
- echo ------3-------
- echo $DOCKER_HUB_PASSWORD | wc -m
complete-alpine:
stage: release
image:
name: chko/docker-pushrm
entrypoint: ["/bin/sh", "-c", "/docker-pushrm"]
variables:
DOCKER_USER: $DOCKER_HUB_LOGIN
DOCKER_PASS: $DOCKER_HUB_PASSWORD
PUSHRM_TARGET: docker.io/$DOCKER_USER/test228
PUSHRM_SHORT: hello short description
PUSHRM_FILE: $CI_PROJECT_DIR/README.md
PUSHRM_DEBUG: 1
script: "/bin/true"
and on the gitlab project these CI variables are defined:
and that's the result (success):
Hope this helps.
Your new GitLab CI config worked now. Thank you!
Describe the problem or bug
README.md
.latest
docker-pushrm version check version with:
latest
latest
Docker CLI version and platform
Log: