Skip to content

Commit d688a16

Browse files
committed
Build and push scripts now create separate Master and Agent images based on Mesos version and project semver.
1 parent b063151 commit d688a16

File tree

2 files changed

+48
-21
lines changed

2 files changed

+48
-21
lines changed

build.sh

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
#!/bin/bash
22

3-
buildVersion() {
3+
if [ "${MINIMESOS_DOCKER_VERSION}" == "" ]
4+
then
5+
echo "Please set MINIMESOS_DOCKER_VERSION before building"
6+
exit 1
7+
fi
8+
9+
buildImage() {
10+
MESOS_VERSION=$1
11+
MESOSPHERE_TAG=$2
12+
413
for role in agent master; do
514
echo
6-
echo Building containersol/mesos-${role}:${1}
15+
echo Building containersol/mesos-${role}-${MESOS_VERSION}:${MINIMESOS_DOCKER_VERSION}
16+
docker build \
17+
-t containersol/mesos-${role}-${MESOS_VERSION}:${MINIMESOS_DOCKER_VERSION} \
18+
-f mesos-image/${role}/Dockerfile \
19+
--build-arg MESOS_VERSION=${MESOS_VERSION}-${MESOSPHERE_TAG} \
20+
. || exit $?
721
docker build \
8-
-t containersol/mesos-${role}:${1} \
22+
-t containersol/mesos-${role}-${MESOS_VERSION}:latest \
923
-f mesos-image/${role}/Dockerfile \
10-
--build-arg MESOS_VERSION=${1} \
24+
--build-arg MESOS_VERSION=${MESOS_VERSION}-${MESOSPHERE_TAG} \
1125
. || exit $?
1226
done
1327
}
@@ -17,13 +31,14 @@ docker build \
1731
alpine3.3-java8-jre || exit $?
1832

1933
docker build \
20-
-t containersol/mesos-base:0.1.0 \
34+
-t containersol/mesos-base:${MINIMESOS_DOCKER_VERSION} \
2135
-f base/Dockerfile \
2236
. || exit $?
2337

24-
buildVersion "0.25.0-0.2.70.ubuntu1404"
25-
buildVersion "0.26.0-0.2.145.ubuntu1404"
26-
buildVersion "0.27.0-0.2.190.ubuntu1404"
27-
buildVersion "0.27.1-2.0.226.ubuntu1404"
28-
buildVersion "0.28.0-2.0.16.ubuntu1404"
29-
buildVersion "0.28.1-2.0.20.ubuntu1404"
38+
# Mesos version Mesosphere tag
39+
buildImage "0.25.0" "0.2.70.ubuntu1404"
40+
buildImage "0.26.0" "0.2.145.ubuntu1404"
41+
buildImage "0.27.0" "0.2.190.ubuntu1404"
42+
buildImage "0.27.1" "2.0.226.ubuntu1404"
43+
buildImage "0.28.0" "2.0.16.ubuntu1404"
44+
buildImage "0.28.1" "2.0.20.ubuntu1404"

push.sh

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/bin/bash
22

3-
echo Pushing containersol/mesos-base:0.1.0
4-
docker push containersol/mesos-base:0.1.0 || exit $?
3+
if [ "${MINIMESOS_DOCKER_VERSION}" == "" ]
4+
then
5+
echo "Please set MINIMESOS_DOCKER_VERSION before building"
6+
exit 1
7+
fi
8+
9+
echo Pushing containersol/mesos-base:${MINIMESOS_DOCKER_VERSION}
10+
docker push containersol/mesos-base:${MINIMESOS_DOCKER_VERSION} || exit $?
511

612
pushImage() {
13+
MESOS_VERSION=$1
14+
MESOSPHERE_TAG=$2
15+
716
for role in agent master; do
817
echo
9-
echo Pushing containersol/mesos-${role}:${1}
10-
docker push containersol/mesos-${role}:${1} || exit $?
18+
echo Pushing containersol/mesos-${role}-${MESOS_VERSION}:${MINIMESOS_DOCKER_VERSION}
19+
docker push containersol/mesos-${role}-${MESOS_VERSION}:${MINIMESOS_DOCKER_VERSION} || exit $?
20+
docker push containersol/mesos-${role}-${MESOS_VERSION}:latest || exit $?
1121
done
22+
1223
}
1324

14-
pushImage "0.25.0-0.2.70.ubuntu1404"
15-
pushImage "0.26.0-0.2.145.ubuntu1404"
16-
pushImage "0.27.0-0.2.190.ubuntu1404"
17-
pushImage "0.27.1-2.0.226.ubuntu1404"
18-
pushImage "0.28.0-2.0.16.ubuntu1404"
19-
pushImage "0.28.1-2.0.20.ubuntu1404"
25+
# Mesos version Mesosphere tag
26+
pushImage "0.25.0" "0.2.70.ubuntu1404"
27+
pushImage "0.26.0" "0.2.145.ubuntu1404"
28+
pushImage "0.27.0" "0.2.190.ubuntu1404"
29+
pushImage "0.27.1" "2.0.226.ubuntu1404"
30+
pushImage "0.28.0" "2.0.16.ubuntu1404"
31+
pushImage "0.28.1" "2.0.20.ubuntu1404"
2032

0 commit comments

Comments
 (0)