Hide image tag in .woodpecker.yml

This commit is contained in:
Keannu Bernasol 2024-08-30 19:54:18 +08:00
parent 44ba296353
commit 079a63f69f

View file

@ -6,12 +6,12 @@ steps:
- branch: master - branch: master
- event: push - event: push
commands: commands:
- docker build . -t git.keannu1.duckdns.org/keannu125/drf_template - docker build . -t "$IMAGE_TAG"
- echo "$REGISTRY_PASSWORD" | docker login git.keannu1.duckdns.org --password-stdin -u "$REGISTRY_USERNAME" - echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" --password-stdin -u "$REGISTRY_USERNAME"
- docker push git.keannu1.duckdns.org/keannu125/drf_template - docker push "$IMAGE_TAG"
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
secrets: [REGISTRY_USERNAME, REGISTRY_PASSWORD] secrets: [IMAGE_TAG, REGISTRY, REGISTRY_USERNAME, REGISTRY_PASSWORD]
- name: update deployment and reset database - name: update deployment and reset database
image: docker image: docker
when: when:
@ -25,10 +25,8 @@ steps:
- ssh root@10.0.10.4 ' - ssh root@10.0.10.4 '
cd $PROJECT_DIR; cd $PROJECT_DIR;
docker-compose down; docker-compose down;
docker image rm git.keannu1.duckdns.org/keannu125/drf_template || true; docker image rm "$IMAGE_TAG" || true;
docker pull git.keannu1.duckdns.org/keannu125/drf_template:latest; docker pull "$IMAGE_TAG":latest;
docker volume rm git.keannu1.duckdns.org/keannu125/drf_template_db_data || true; docker volume rm "$IMAGE_TAG"_db_data || true;
docker compose up -d' docker compose up -d'
volumes: secrets: [IMAGE_TAG, SSH_KEY, PROJECT_DIR]
- /var/run/docker.sock:/var/run/docker.sock
secrets: [SSH_KEY, PROJECT_DIR]