From d7e4de7afcd89bdcfdbd3e54a2c4e579c0cfa998 Mon Sep 17 00:00:00 2001 From: Mike Wellen Date: Wed, 23 Jan 2019 16:39:39 -0600 Subject: [PATCH 1/4] provide version file for gets --- assets/in | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/in b/assets/in index 1327a49..89379e9 100755 --- a/assets/in +++ b/assets/in @@ -100,6 +100,7 @@ args="$args -Drepository.url=$url" [ -n "$password" ] && args="$args -Drepository.password=$password"; $resource_dir/mvnw dependency:copy $args +echo $version > version jq -n \ --arg version "$version" \ From 581057094c43c3668c24c3daf445259948b577c5 Mon Sep 17 00:00:00 2001 From: Mike Wellen Date: Wed, 23 Jan 2019 22:21:35 -0600 Subject: [PATCH 2/4] test version file for gets --- test/get.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/get.sh b/test/get.sh index 1327e14..581481e 100755 --- a/test/get.sh +++ b/test/get.sh @@ -24,4 +24,22 @@ it_can_get_artifact() { ' } +it_provides_a_version_file_when_getting_artifact() { + + local src=$(mktemp -d $TMPDIR/check-src.XXXXXX) + + local repository=$src/remote-repository + mkdir -p $repository + + local url=file://$repository + local artifact=ci.concourse.maven:maven-resource:jar:standalone + + local version=$(deploy_artifact $url $artifact '1.0.0' $src) + + get_artifact $url $artifact $version $src + + if [ $(cat version) != $version ]; then exit 1; fi +} + run it_can_get_artifact +run it_provides_a_version_file_when_getting_artifact From 40cabad21adb2764c1f84b12915950a9491dc03c Mon Sep 17 00:00:00 2001 From: Mike Wellen Date: Wed, 13 Mar 2019 20:04:08 -0500 Subject: [PATCH 3/4] update readme to include version file for 'in' behavior --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f81aae7..26b2362 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,11 @@ the repository. ### `in`: Fetch an artifact from a repository. -Download the artifact from the repository. +Places the following files in the destination: + +- (artifact): The artifact fetched from the repository. + +- version: The artifact's version. ### `out`: Deploy artifact to a repository. From 43d5a4978687756b39e125efa15e02177258b949 Mon Sep 17 00:00:00 2001 From: Mike Wellen Date: Tue, 9 Apr 2019 17:34:00 -0500 Subject: [PATCH 4/4] use destination to create version file with appropriate path --- assets/in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/in b/assets/in index 89379e9..750153c 100755 --- a/assets/in +++ b/assets/in @@ -100,7 +100,7 @@ args="$args -Drepository.url=$url" [ -n "$password" ] && args="$args -Drepository.password=$password"; $resource_dir/mvnw dependency:copy $args -echo $version > version +echo "$version" > "$destination/version" jq -n \ --arg version "$version" \