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. diff --git a/assets/in b/assets/in index 1327a49..750153c 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" > "$destination/version" jq -n \ --arg version "$version" \ 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