test5
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing

This commit is contained in:
2025-11-04 20:46:53 +01:00
parent 47f8161406
commit b521728619

View File

@@ -1,18 +1,30 @@
kind: pipeline
type: docker
name: secret-test
name: docker-build-and-push
steps:
- name: show-env
image: alpine:3.19
- name: build-and-push
image: docker:26
privileged: true
environment:
TEST_VAR: "HelloWorld"
SECRET_VAR:
from_secret: test_secret
DOCKER_HOST:
from_secret: DOCKER_HOST
DOCKER_USER:
from_secret: DOCKER_USER
DOCKER_PASS:
from_secret: DOCKER_PASS
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- echo "==== ENVIRONMENT TEST ===="
- echo "All envs (filtered):"
- env | grep -E "TEST_|SECRET_|DRONE_"
- echo "Check via file:"
- echo "$SECRET_VAR" > /tmp/secret_check.txt
- cat /tmp/secret_check.txt
- echo "Logging in to Docker registry..."
- docker login $DOCKER_HOST -u "$DOCKER_USER" -p "$DOCKER_PASS"
- echo "Building image..."
- docker build -t $DOCKER_HOST/public/drone-test:latest .
- echo "Pushing image..."
- docker push $DOCKER_HOST/public/drone-test:latest
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock