-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.sh
executable file
·23 lines (19 loc) · 713 Bytes
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
for version in "${versions[@]}"; do
repoPackage="https://jfrog.bintray.com/artifactory-pro-debs/dists/trusty/main/binary-amd64/Packages.gz"
fullVersion="$(curl -fsSL "${repoPackage}" | gunzip | awk -v pkgname="jfrog-artifactory-pro" -F ': ' '$1 == "Package" { pkg = $2 } pkg == pkgname && $1 == "Version" { print $2 }' | grep "^$version" | sort -rV | head -n1 )"
(
set -x
sed '
s/%%ARTIFACTORY_MAJOR%%/'"$version"'/g;
s/%%ARTIFACTORY_VERSION%%/'"$fullVersion"'/g;
' Dockerfile.template > "$version/Dockerfile"
)
done