From e9a8b0ee3a1f564396fbfc6491b7869849c38afc Mon Sep 17 00:00:00 2001 From: Joseph Montanaro Date: Thu, 27 May 2021 23:53:35 -0700 Subject: [PATCH] filter yq to just first document --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 60f549c..a466ca6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -91,7 +91,7 @@ steps: - LATEST_VERSION=$(git tag --sort v:refname | grep '^v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}$' | tail -n 1) - git checkout $LATEST_VERSION - printf $(git log -n 1 --pretty=%H) > ../commit_hash # we'll need this for the docker build - - GOLANG_IMG=$(yq eval '.steps[0].image' .drone.yml) + - GOLANG_IMG=$(yq eval 'select(documentIndex == 0) | .steps[0].image' .drone.yml) - docker pull $GOLANG_IMG - docker tag $GOLANG_IMG drone-builder:latest - docker image rm $GOLANG_IMG