Hi, I’m trying to set up a unity pipeline but for that I need to run 1 step that gets the exact unity version and saves it in a variable. And then another step that uses that variable to pull a specific unity image.
I’m wondering if this is possible in drone somehow?
Here is what I’m trying to achieve:
environment:
IMAGE: unityci/editor
IMAGE_VERSION: 1
steps:
- name: get-unity-version
image: alpine
commands:
- echo UNITY_VERSION=$(cat $DRONE_WORKSPACE/ProjectSettings/ProjectVersion.txt | grep "m_EditorVersion:.*" | awk '{ print $2}') // Save output to UNITY_VERSION env variable
- name: get-activation-file
image: $IMAGE:$UNITY_VERSION-base-$IMAGE_VERSION //Use the UNITY_VERSION env variable to download the correct image
commands:
- ...
Edit:
I just tried hardcoding the unity version (not ideal but it doesn’t change THAT often so it’s doable), but even then it doesn’t work? Looks like the ‘image’ doesn’t accept a combined string?
image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION}
This gives ‘Error response from daemon: invalid reference format’
Edit 2:
Adding quotes doesn’t work either
image: "${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION}"
Same error as above