-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathaddversion.sh
executable file
·104 lines (92 loc) · 3.59 KB
/
addversion.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
VERSION=$1
if test -z "${VERSION}" ; then
echo "usage: $0 Revision"
exit 1
fi
if test -d "stretch/${VERSION}" -o -d "jessie/${VERSION}" -o -d "alpine/${VERSION}"; then
echo "there already is a ${VERSION} version! Exit now."
exit
fi
case ${VERSION} in
2.*)
DOCKER_IMAGE=jessie
mkdir -p ${DOCKER_IMAGE}/${VERSION}
cat Dockerfile.templ | sed \
-e "s;@VERSION@;${VERSION};" \
> ${DOCKER_IMAGE}/${VERSION}/Dockerfile
cp docker-entrypoint.sh ${DOCKER_IMAGE}/${VERSION}/docker-entrypoint.sh
;;
3.0.*)
DOCKER_IMAGE=jessie
mkdir -p ${DOCKER_IMAGE}/${VERSION}
cat Dockerfile3.templ | sed \
-e "s;@VERSION@;${VERSION};" \
> ${DOCKER_IMAGE}/${VERSION}/Dockerfile
cp docker-entrypoint3.sh ${DOCKER_IMAGE}/${VERSION}/docker-entrypoint.sh
;;
3.1.*)
if test -z "${REPO_TL_DIR}"; then
echo "REPO_TL_DIR environment variable missing"
exit 1
fi
DOCKER_IMAGE=stretch
mkdir -p ${DOCKER_IMAGE}/${VERSION}
cat Dockerfile31.templ | sed \
-e "s;@VERSION@;${VERSION};" \
-e "s;@REPO_TL_DIR@;${REPO_TL_DIR};" \
> ${DOCKER_IMAGE}/${VERSION}/Dockerfile
cp docker-entrypoint3.sh ${DOCKER_IMAGE}/${VERSION}/docker-entrypoint.sh
;;
3.2.*)
if test -z "${REPO_TL_DIR}"; then
echo "REPO_TL_DIR environment variable missing"
exit 1
fi
DOCKER_IMAGE=stretch
mkdir -p ${DOCKER_IMAGE}/${VERSION}
cat Dockerfile32.templ | sed \
-e "s;@VERSION@;${VERSION};" \
-e "s;@REPO_TL_DIR@;${REPO_TL_DIR};" \
> ${DOCKER_IMAGE}/${VERSION}/Dockerfile
cp docker-entrypoint32.sh ${DOCKER_IMAGE}/${VERSION}/docker-entrypoint.sh
;;
3.3.*)
if test -z "${REPO_TL_DIR}"; then
echo "REPO_TL_DIR environment variable missing"
exit 1
fi
DOCKER_IMAGE=stretch
mkdir -p ${DOCKER_IMAGE}/${VERSION}
cat Dockerfile33.templ | sed \
-e "s;@VERSION@;${VERSION};" \
-e "s;@REPO_TL_DIR@;${REPO_TL_DIR};" \
> ${DOCKER_IMAGE}/${VERSION}/Dockerfile
cp docker-entrypoint33.sh ${DOCKER_IMAGE}/${VERSION}/docker-entrypoint.sh
;;
3.4.*)
DOCKER_IMAGE=alpine
mkdir -p ${DOCKER_IMAGE}/${VERSION}
cat Dockerfile34.templ | sed \
-e "s;@VERSION@;${VERSION};" \
> ${DOCKER_IMAGE}/${VERSION}/Dockerfile
cp docker-entrypoint34.sh ${DOCKER_IMAGE}/${VERSION}/docker-entrypoint.sh
cp docker-foxx34.sh ${DOCKER_IMAGE}/${VERSION}/docker-foxx.sh
;;
devel|3.*)
DOCKER_IMAGE=alpine
mkdir -p ${DOCKER_IMAGE}/${VERSION}
cat Dockerfile33.templ | sed \
-e "s;@VERSION@;${VERSION};" \
> ${DOCKER_IMAGE}/${VERSION}/Dockerfile
cp docker-entrypoint34.sh ${DOCKER_IMAGE}/${VERSION}/docker-entrypoint.sh
cp docker-foxx34.sh ${DOCKER_IMAGE}/${VERSION}/docker-foxx.sh
;;
*)
echo "unknown version ${VERSION}"
exit 1
;;
esac
# git add ${DOCKER_IMAGE}/${VERSION}
# git commit ${DOCKER_IMAGE}/${VERSION} -m "Add new version ${VERSION}"
# git push