Hi all,
I have a drone set like below:
Repo A and Repo B are both enabled in drone and located in github.
Repo A’s .drone.yml:
pipeline:
build:
image: hungo/test
commands:
- echo $DRONE_TAG
===========================================
It will print the tag correctly if I push a tag to github
===========================================
===========================================
I use @vaijab downstream plugin to pass drone tag to RepoB
===========================================
trigger:
image: quay.io/ukhomeofficedigital/drone-trigger:latest
drone_server:
drone_token:
repo: HungoHung/RepoB Calling Repo B
branch: master
params: “DRONE_TAG =${DRONE_TAG}”
###################################################
Here is the Repo B’s .drone.yml
workspace:
base: /opt
path: src
pipeline:
build:
image: hungo/aws-test
commands:
- echo “$DRONE_TAG” Here will print out the correct tag
- ./getBuild.sh Inside this script, echo ${DRONE_TAG} will print out the correct tag
s3:
image: plugins/s3
bucket: drone-build-artifact
access_key:
secret_key:
region: us-west-2
acl: private
source: /opt/src/*
target: /hungotest/_artifact/${DRONE_TAG}
===========================================
I have tried to use $DRONE_TAG or ${DRONE_TAG}, $$DRONE_TAG
${DRONE_TAG} will be replaced by empty string
ex: drone s3 log => target="/hungotest/_artifact/opt/src/.DS_Store"
$DRONE_TAG will still be $DRONE_TAG
ex: drone s3 log => target="/hungotest/_artifact/$DRONE_TAG/opt/src/.DS_Store"
===========================================
I have been trying to google and do try&error for few days but still can’t get it through. Could anyone shed some light on this for me? Thank you!
My drone server version is 0.8.0. Thank you
===========================================================
Edit 1:
Not sure if this issue is related to what @bradrydzewski said in this thread
But I still don’t have idea how to solve my uploading issue in downstream job based on the passed info(tag).
===========================================================
Edit 2:
I tried to use following command to pass variable directly but it still see ${DRONE_TAG} as empty string
/home/ubuntu # drone build start -p DRONE_TAG=newdx HungoHung/RepoB 36
Starting build HungoHung/RepoB#39
Of course if I put the S3 part in RepoA (Main Job) and test with tag, the following will work like a charm
source: /opt/src/*
target: /hungotest/_artifact/${DRONE_TAG}