forked from jenkinsci/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-official-library.sh
executable file
·36 lines (27 loc) · 1.1 KB
/
update-official-library.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
#!/bin/bash -eu
# Generate the Docker official-images file
sha() {
local branch=$1
git rev-parse "$branch"
}
version_from_dockerfile() {
local branch=$1
git show "$branch:Dockerfile" | grep JENKINS_VERSION: | sed -e 's/.*:-\(.*\)}/\1/'
}
master_sha=$(sha master)
alpine_sha=$(sha alpine)
master_version=$(version_from_dockerfile master)
alpine_version=$(version_from_dockerfile alpine)
if ! [ "$master_version" == "$alpine_version" ]; then
echo "Master version '$master_version' does not match alpine version '$alpine_version'"
exit 1
fi
cat << EOF > ../official-images/library/jenkins
# maintainer: Nicolas De Loof <[email protected]> (@ndeloof)
# maintainer: Michael Neale <[email protected]> (@michaelneale)
# maintainer: Carlos Sanchez <[email protected]> (@carlossg)
latest: git://github.com/jenkinsci/jenkins-ci.org-docker@$master_sha
$master_version: git://github.com/jenkinsci/jenkins-ci.org-docker@$master_sha
alpine: git://github.com/jenkinsci/jenkins-ci.org-docker@$alpine_sha
$alpine_version-alpine: git://github.com/jenkinsci/jenkins-ci.org-docker@$alpine_sha
EOF