-
Notifications
You must be signed in to change notification settings - Fork 14
/
generate-tags.sh
executable file
·44 lines (33 loc) · 823 Bytes
/
generate-tags.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
declare -A aliases
contains() {
for word in $1; do
[[ $word = $2 ]] && return 0
done
return 1
}
aliases=(
[0.7]='latest'
[0.7-composable]='latest-composable'
)
# ignores=(
# 'hub-docs'
# 'files'
# )
ignores=('hub-docs files')
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( */ )
versions=( "${versions[@]%/}" )
url='git@github.com:Wirecloud/docker-wirecloud'
echo '# Maintainer: WireCloud Team <wirecloud@conwet.com>'
for version in "${versions[@]}"; do
commit="$(git log -1 --format='format:%H' -- "$version")"
versionAliases=( $version ${aliases[$version]} )
if ! contains "$ignores" $version; then
echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
done
fi
done