Repository navigation
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·79 lines (63 loc) · 1.89 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·79 lines (63 loc) · 1.89 KB
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
#!/usr/bin/env bash
ARCHIVE_BUILD_FOLDER="/tmp/portainer-builds"
VERSION=$1
if [[ $# -ne 1 ]] ; then
echo "Usage: $(basename $0) <VERSION>"
exit 1
fi
# parameters platform, architecture
function build_and_push_images() {
PLATFORM=$1
ARCH=$2
docker build -t portainer/portainer:${PLATFORM}-${ARCH}-${VERSION} -f build/linux/Dockerfile .
docker push portainer/portainer:${PLATFORM}-${ARCH}-${VERSION}
docker build -t portainer/portainer:${PLATFORM}-${ARCH} -f build/linux/Dockerfile .
docker push portainer/portainer:${PLATFORM}-${ARCH}
}
# parameters: platform, architecture
function build_archive() {
PLATFORM=$1
ARCH=$2
BUILD_FOLDER=${ARCHIVE_BUILD_FOLDER}/${PLATFORM}-${ARCH}
rm -rf ${BUILD_FOLDER} && mkdir -pv ${BUILD_FOLDER}/portainer
mv dist/* ${BUILD_FOLDER}/portainer/
cd ${BUILD_FOLDER}
tar cvpfz portainer-${VERSION}-${PLATFORM}-${ARCH}.tar.gz portainer
mv portainer-${VERSION}-${PLATFORM}-${ARCH}.tar.gz ${ARCHIVE_BUILD_FOLDER}/
cd -
}
mkdir -pv /tmp/portainer-builds
PLATFORM="linux"
ARCH="amd64"
grunt release-${PLATFORM}-${ARCH}
build_and_push_images ${PLATFORM} ${ARCH}
build_archive ${PLATFORM} ${ARCH}
PLATFORM="linux"
ARCH="386"
grunt release-${PLATFORM}-${ARCH}
build_and_push_images ${PLATFORM} ${ARCH}
build_archive ${PLATFORM} ${ARCH}
PLATFORM="linux"
ARCH="arm"
grunt release-${PLATFORM}-${ARCH}
build_and_push_images ${PLATFORM} ${ARCH}
build_archive ${PLATFORM} ${ARCH}
PLATFORM="linux"
ARCH="arm64"
grunt release-${PLATFORM}-${ARCH}
build_and_push_images ${PLATFORM} ${ARCH}
build_archive ${PLATFORM} ${ARCH}
PLATFORM="linux"
ARCH="ppc64le"
grunt release-${PLATFORM}-${ARCH}
build_and_push_images ${PLATFORM} ${ARCH}
build_archive ${PLATFORM} ${ARCH}
PLATFORM="darwin"
ARCH="amd64"
grunt release-${PLATFORM}-${ARCH}
build_archive ${PLATFORM} ${ARCH}
PLATFORM="windows"
ARCH="amd64"
grunt release-${PLATFORM}-${ARCH}
build_archive ${PLATFORM} ${ARCH}
exit 0