-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #493 from broadinstitute/ct-task-docker-pinning-di…
…sable allow docker image pinning to be skipped with #skip-global-version-pin annotation
- Loading branch information
Showing
4 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# use sed to replace version strings of docker images based on versions defined in txt file | ||
|
||
# | ||
# skip this replacement for any version string line with the comment "#skip-global-version-pin" | ||
# | ||
# requires $MODULE_VERSIONS to be set to point to a text file with equal-sign-separated values | ||
# export MODULE_VERSIONS="./requirements-modules.txt" && ./github_actions_ci/check-wdl-runtimes.sh | ||
|
||
printf "Updating docker image tags in WDL files with those in ${MODULE_VERSIONS}\n\n" | ||
|
||
while IFS='=' read module version; do | ||
OLD_TAG=$module | ||
NEW_TAG="$module:$version" | ||
echo Replacing $OLD_TAG with $NEW_TAG in all task WDL files | ||
sed -i '' "s|$OLD_TAG[^\"\']*|$NEW_TAG|g" pipes/WDL/tasks/*.wdl | ||
done < $MODULE_VERSIONS | ||
NEW_TAG_BOLD="$module:$(tput bold)$version$(tput sgr0)" | ||
printf "Replacing: %-14s \n with tag: %-14s \n\n" "$OLD_TAG" "$NEW_TAG_BOLD" | ||
|
||
sed -i '' "/^\(.*\)[[:space:]]*#skip-global-version-pin[[:space:]]*$/!s|$OLD_TAG[^\"\']*|$NEW_TAG|g" pipes/WDL/tasks/*.wdl | ||
done < $MODULE_VERSIONS | ||
|
||
printf "Replacements skipped for lines marked with '#skip-global-version-pin' \n\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters