2016-10-04 22:33:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-05-20 08:02:18 +00:00
|
|
|
ARCHIVE_BUILD_FOLDER="/tmp/portainer-builds"
|
2016-10-04 22:33:32 +00:00
|
|
|
VERSION=$1
|
|
|
|
|
|
|
|
if [[ $# -ne 1 ]] ; then
|
|
|
|
echo "Usage: $(basename $0) <VERSION>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-05-20 08:02:18 +00:00
|
|
|
# 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 -
|
|
|
|
}
|
|
|
|
|
2017-03-12 21:30:50 +00:00
|
|
|
mkdir -pv /tmp/portainer-builds
|
2016-10-25 20:04:26 +00:00
|
|
|
|
2017-05-20 08:02:18 +00:00
|
|
|
PLATFORM="linux"
|
|
|
|
ARCH="amd64"
|
2017-05-20 08:27:55 +00:00
|
|
|
grunt release-${PLATFORM}-${ARCH}
|
|
|
|
build_and_push_images ${PLATFORM} ${ARCH}
|
|
|
|
build_archive ${PLATFORM} ${ARCH}
|
|
|
|
|
|
|
|
PLATFORM="linux"
|
|
|
|
ARCH="386"
|
|
|
|
grunt release-${PLATFORM}-${ARCH}
|
2017-05-20 08:02:18 +00:00
|
|
|
build_and_push_images ${PLATFORM} ${ARCH}
|
|
|
|
build_archive ${PLATFORM} ${ARCH}
|
2016-10-04 22:33:32 +00:00
|
|
|
|
2017-05-20 08:02:18 +00:00
|
|
|
PLATFORM="linux"
|
|
|
|
ARCH="arm"
|
2017-05-20 08:27:55 +00:00
|
|
|
grunt release-${PLATFORM}-${ARCH}
|
2017-05-20 08:02:18 +00:00
|
|
|
build_and_push_images ${PLATFORM} ${ARCH}
|
|
|
|
build_archive ${PLATFORM} ${ARCH}
|
2016-10-31 20:07:32 +00:00
|
|
|
|
2017-05-20 08:02:18 +00:00
|
|
|
PLATFORM="linux"
|
|
|
|
ARCH="arm64"
|
2017-05-20 08:27:55 +00:00
|
|
|
grunt release-${PLATFORM}-${ARCH}
|
2017-05-20 08:02:18 +00:00
|
|
|
build_and_push_images ${PLATFORM} ${ARCH}
|
|
|
|
build_archive ${PLATFORM} ${ARCH}
|
|
|
|
|
|
|
|
PLATFORM="linux"
|
|
|
|
ARCH="ppc64le"
|
2017-05-20 08:27:55 +00:00
|
|
|
grunt release-${PLATFORM}-${ARCH}
|
2017-05-20 08:02:18 +00:00
|
|
|
build_and_push_images ${PLATFORM} ${ARCH}
|
|
|
|
build_archive ${PLATFORM} ${ARCH}
|
2017-01-02 18:42:21 +00:00
|
|
|
|
2017-05-20 08:02:18 +00:00
|
|
|
PLATFORM="darwin"
|
|
|
|
ARCH="amd64"
|
2017-05-20 08:27:55 +00:00
|
|
|
grunt release-${PLATFORM}-${ARCH}
|
2017-05-20 08:02:18 +00:00
|
|
|
build_archive ${PLATFORM} ${ARCH}
|
2017-03-12 21:30:50 +00:00
|
|
|
|
2017-05-20 08:02:18 +00:00
|
|
|
PLATFORM="windows"
|
|
|
|
ARCH="amd64"
|
2017-05-20 08:27:55 +00:00
|
|
|
grunt release-${PLATFORM}-${ARCH}
|
2017-05-20 08:02:18 +00:00
|
|
|
build_archive ${PLATFORM} ${ARCH}
|
2016-11-11 02:17:38 +00:00
|
|
|
|
2016-10-04 22:33:32 +00:00
|
|
|
exit 0
|