ci: Distribute env var to avoid bugs
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Glenn Y. Rolland 2023-01-16 02:35:29 +01:00
parent ddcac30b89
commit f95b7ff10e

View file

@ -3,16 +3,13 @@ kind: pipeline
type: docker
name: default
environment:
DOCKER_REPO: &docker_repo glenux/service-dolibarr
steps:
- name: debug
image: alpine
environment:
commands:
- 'echo "Repository: $${DOCKER_REPO}"'
- 'echo "Repository: glenux/service-dolibarr"'
- 'echo "Git commit: ${DRONE_COMMIT_SHA:0:8}"'
- name: publish:commit_sha
@ -28,8 +25,8 @@ steps:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
cache_from: "$${DOCKER_REPO}:latest_${DRONE_BRANCH/\\//-}"
repo: *docker_repo
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
repo: glenux/service-dolibarr
tags: "${DRONE_COMMIT_SHA:0:8}"
purge: false
@ -43,8 +40,8 @@ steps:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
cache_from: "$${DOCKER_REPO}:latest_${DRONE_BRANCH/\\//-}"
repo: *docker_repo
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
repo: glenux/service-dolibarr
tags: "latest_${DRONE_BRANCH/\\//-}"
purge: false
when:
@ -53,13 +50,15 @@ steps:
- "develop"
- "feature/*"
- name: docker
- name: publish:latest
image: plugins/docker
settings:
username: "${DOCKERHUB_USERNAME}"
password: "${DOCKERHUB_PASSWORD}"
cache_from: "$${DOCKER_REPO}:latest_${DRONE_BRANCH/\\//-}"
repo: *docker_repo
username:
from_secret: DOCKERHUB_USERNAME
password:
from_secret: DOCKERHUB_PASSWORD
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
repo: glenux/service-dolibarr
tags: latest
purge: false
when: