Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(.ciecleci, scripts): tag docker images
Signed-off-by: Taiga Nakayama <dora@dora-gt.jp>
- Loading branch information
Showing
8 changed files
with
81 additions
and
19 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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Returns `latest` or crate version. If git_tag ($2) argument is given, it is considered as that the new version | ||
# is published. If the tag is the form of semantic version like "ilp-node-0.4.1-beta.3", this script returns | ||
# the version of crate like "0.4.1-beta.3" because tag names generated by `cargo release` look a bit redundant. | ||
# If the tag is not one of semantic version, just returns the tag itself and the docker image will be tagged | ||
# with the git tag. | ||
# If no tag is given, it is considered as a `latest` (or possibly could be said `nightly`) build. | ||
# This script requires `jq` | ||
|
||
crate_name=$1 | ||
git_tag=$2 | ||
|
||
if [ -n "$git_tag" ]; then | ||
# If it is a tag of semantic version expression | ||
if [[ "$git_tag" =~ ^.*v([0-9]+)\.([0-9]+)\.([0-9]+)(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(\+[0-9A-Za-z-]+)?$ ]] ; then | ||
cargo read-manifest --manifest-path crates/${crate_name}/Cargo.toml | jq -r .version | ||
else | ||
printf "$git_tag" | ||
fi | ||
else | ||
printf "latest" | ||
fi |
File renamed without changes.
File renamed without changes
File renamed without changes.
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