forked from lindt/docker-ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·30 lines (27 loc) · 779 Bytes
/
build
File metadata and controls
executable file
·30 lines (27 loc) · 779 Bytes
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
#!/bin/bash
set -e
function delete_ignored_tags {
for tag in $( sh gather_tags | grep -f .tagignore ); do
if git show-ref --tags | grep "tags/${tag}$"
then
echo "Delete Tag ${tag}"
git tag -d ${tag} && git push origin :refs/tags/${tag}
fi
done
}
function build_missing_tags {
for tag in $( sh gather_tags | grep -v -f .tagignore ); do
echo -n "Tag: ${tag} ... "
if git show-ref --tags | grep "tags/${tag}$" &> /dev/null
then
echo 'is existing'
else
echo 'needs building'
sed -i "s/COMPILER_VERSION=.*/COMPILER_VERSION=${tag}/" Dockerfile
git add Dockerfile && git commit -m "using version ${tag}" && git push
git tag "${tag}" && git push --tags
fi
done
}
delete_ignored_tags
build_missing_tags