Skip to content

Commit

Permalink
devtools added
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondMouthaan committed Aug 25, 2019
1 parent 50d376a commit 01d8ff0
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 98 deletions.
182 changes: 97 additions & 85 deletions .docker/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -o errexit

main() {
# arg 1 holds switch string
case $1 in
"prepare")
docker_prepare
Expand All @@ -20,7 +21,9 @@ main() {
docker_push
;;
"manifest-list")
docker_manifest_list $2
# arg 2 holds node version
# arg 3 holds tag suffix
docker_manifest_list $2 $3
;;
*)
echo "none of above!"
Expand Down Expand Up @@ -106,57 +109,59 @@ docker_push() {
}

docker_manifest_list() {
# arg 1 holds node version
# arg 2 holds tag suffix

# Create and push manifest lists
echo "DOCKER MANIFEST: Create and Push docker manifest lists."
# docker_manifest_list_version_rpi_python2 ${1}
# docker_manifest_list_version_rpi_python3 ${1}
# docker_manifest_list_version_rpi ${1}
docker_manifest_list_version_python2 ${1}
docker_manifest_list_version_python3 ${1}
docker_manifest_list_version ${1}
# docker_manifest_list_version_python2 ${1}
# docker_manifest_list_version_python3 ${1}
docker_manifest_list_version ${1} ${2}

# Create manifest list testing or latest
case ${BUILD_VERSION} in
*"testing"*)
echo "DOCKER MANIFEST: Create and Push docker manifest list TESTING Node JS."
# docker_manifest_list_testing_or_latest_rpi_python2 ${1} "testing"
# docker_manifest_list_testing_or_latest_rpi_python3 ${1} "testing"
# docker_manifest_list_testing_or_latest_rpi ${1} "testing"
docker_manifest_list_testing_or_latest_python2 ${1} "testing"
docker_manifest_list_testing_or_latest_python3 ${1} "testing"
docker_manifest_list_testing_or_latest ${1} "testing"

if [[ ${1} == "-10" ]]; then
echo "DOCKER MANIFEST: Create and Push docker manifest list TESTING."
# docker_manifest_list_testing_or_latest_rpi_python2 "" "testing"
# docker_manifest_list_testing_or_latest_rpi_python3 "" "testing"
# docker_manifest_list_testing_or_latest_rpi "" "testing"
docker_manifest_list_testing_or_latest_python2 "" "testing"
docker_manifest_list_testing_or_latest_python3 "" "testing"
docker_manifest_list_testing_or_latest "" "testing"
fi
;;
*)
echo "DOCKER MANIFEST: Create and Push docker manifest list LATEST Node JS."
# docker_manifest_list_testing_or_latest_rpi_python2 ${1} "latest"
# docker_manifest_list_testing_or_latest_rpi_python3 ${1} "latest"
# docker_manifest_list_testing_or_latest_rpi ${1} "latest"
docker_manifest_list_testing_or_latest_python2 ${1} "latest"
docker_manifest_list_testing_or_latest_python3 ${1} "latest"
docker_manifest_list_testing_or_latest ${1} "latest"

if [[ ${1} == "-10" ]]; then
echo "DOCKER MANIFEST: Create and Push docker manifest list LATEST."
# docker_manifest_list_testing_or_latest_rpi_python2 "" "latest"
# docker_manifest_list_testing_or_latest_rpi_python3 "" "latest"
# docker_manifest_list_testing_or_latest_rpi "" "latest"
docker_manifest_list_testing_or_latest_python2 "" "latest"
docker_manifest_list_testing_or_latest_python3 "" "latest"
docker_manifest_list_testing_or_latest "" "latest"
fi
;;
esac
# case ${BUILD_VERSION} in
# *"testing"*)
# echo "DOCKER MANIFEST: Create and Push docker manifest list TESTING Node JS."
## docker_manifest_list_testing_or_latest_rpi_python2 ${1} "testing"
## docker_manifest_list_testing_or_latest_rpi_python3 ${1} "testing"
## docker_manifest_list_testing_or_latest_rpi ${1} "testing"
## docker_manifest_list_testing_or_latest_python2 ${1} "testing"
## docker_manifest_list_testing_or_latest_python3 ${1} "testing"
# docker_manifest_list_testing_or_latest ${1} "testing"
#
# if [[ ${1} == "-10" ]]; then
# echo "DOCKER MANIFEST: Create and Push docker manifest list TESTING."
## docker_manifest_list_testing_or_latest_rpi_python2 "" "testing"
## docker_manifest_list_testing_or_latest_rpi_python3 "" "testing"
## docker_manifest_list_testing_or_latest_rpi "" "testing"
## docker_manifest_list_testing_or_latest_python2 "" "testing"
## docker_manifest_list_testing_or_latest_python3 "" "testing"
# docker_manifest_list_testing_or_latest "" "testing"
# fi
# ;;
# *)
# echo "DOCKER MANIFEST: Create and Push docker manifest list LATEST Node JS."
## docker_manifest_list_testing_or_latest_rpi_python2 ${1} "latest"
## docker_manifest_list_testing_or_latest_rpi_python3 ${1} "latest"
## docker_manifest_list_testing_or_latest_rpi ${1} "latest"
## docker_manifest_list_testing_or_latest_python2 ${1} "latest"
## docker_manifest_list_testing_or_latest_python3 ${1} "latest"
# docker_manifest_list_testing_or_latest ${1} "latest"
#
# if [[ ${1} == "-10" ]]; then
# echo "DOCKER MANIFEST: Create and Push docker manifest list LATEST."
## docker_manifest_list_testing_or_latest_rpi_python2 "" "latest"
## docker_manifest_list_testing_or_latest_rpi_python3 "" "latest"
## docker_manifest_list_testing_or_latest_rpi "" "latest"
## docker_manifest_list_testing_or_latest_python2 "" "latest"
## docker_manifest_list_testing_or_latest_python3 "" "latest"
# docker_manifest_list_testing_or_latest "" "latest"
# fi
# ;;
# esac

# docker_manifest_list_version_os_arch
}
Expand Down Expand Up @@ -197,20 +202,20 @@ docker_manifest_list() {
# docker manifest push ${TARGET}:${BUILD_VERSION}${1}-rpi
#}

docker_manifest_list_version_python2() {
echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${BUILD_VERSION}${1}-python2."
docker manifest create ${TARGET}:${BUILD_VERSION}${1}-python2 \
${TARGET}:${BUILD_VERSION}${1}-alpine-amd64-python2 \
${TARGET}:${BUILD_VERSION}${1}-alpine-arm32v6-python2 \
${TARGET}:${BUILD_VERSION}${1}-alpine-arm32v7-python2 \
${TARGET}:${BUILD_VERSION}${1}-alpine-arm64v8-python2

docker manifest annotate ${TARGET}:${BUILD_VERSION}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v6-python2 --os=linux --arch=arm --variant=v6
docker manifest annotate ${TARGET}:${BUILD_VERSION}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v7-python2 --os=linux --arch=arm --variant=v7
docker manifest annotate ${TARGET}:${BUILD_VERSION}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm64v8-python2 --os=linux --arch=arm64 --variant=v8

docker manifest push ${TARGET}:${BUILD_VERSION}${1}-python2
}
#docker_manifest_list_version_python2() {
# echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${BUILD_VERSION}${1}-python2."
# docker manifest create ${TARGET}:${BUILD_VERSION}${1}-python2 \
# ${TARGET}:${BUILD_VERSION}${1}-alpine-amd64-python2 \
# ${TARGET}:${BUILD_VERSION}${1}-alpine-arm32v6-python2 \
# ${TARGET}:${BUILD_VERSION}${1}-alpine-arm32v7-python2 \
# ${TARGET}:${BUILD_VERSION}${1}-alpine-arm64v8-python2
#
# docker manifest annotate ${TARGET}:${BUILD_VERSION}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v6-python2 --os=linux --arch=arm --variant=v6
# docker manifest annotate ${TARGET}:${BUILD_VERSION}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v7-python2 --os=linux --arch=arm --variant=v7
# docker manifest annotate ${TARGET}:${BUILD_VERSION}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm64v8-python2 --os=linux --arch=arm64 --variant=v8
#
# docker manifest push ${TARGET}:${BUILD_VERSION}${1}-python2
#}

docker_manifest_list_version_python3() {
echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${BUILD_VERSION}${1}-python3."
Expand All @@ -228,18 +233,25 @@ docker_manifest_list_version_python3() {
}

docker_manifest_list_version() {
echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${BUILD_VERSION}${1}."
docker manifest create ${TARGET}:${BUILD_VERSION}${1} \
${TARGET}:${BUILD_VERSION}${1}-alpine-amd64 \
${TARGET}:${BUILD_VERSION}${1}-alpine-arm32v6 \
${TARGET}:${BUILD_VERSION}${1}-alpine-arm32v7 \
${TARGET}:${BUILD_VERSION}${1}-alpine-arm64v8

docker manifest annotate ${TARGET}:${BUILD_VERSION}${1} ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v6 --os=linux --arch=arm --variant=v6
docker manifest annotate ${TARGET}:${BUILD_VERSION}${1} ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v7 --os=linux --arch=arm --variant=v7
docker manifest annotate ${TARGET}:${BUILD_VERSION}${1} ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm64v8 --os=linux --arch=arm64 --variant=v8

docker manifest push ${TARGET}:${BUILD_VERSION}${1}
# arg 1 holds node version
# arg 2 holds tag suffix

if [[ ${1} == "" ]]; then export NODE_VERSION "${1}"; else export NODE_VERSION "-${1}"; fi
if [[ ${2} == "" ]]; then export TAG_SUFFIX "${2}"; else export TAG_SUFFIX "-${2}"; fi

echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}."

docker manifest create ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX} \
${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}-amd64 \
${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}-arm32v6 \
${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}-arm32v7 \
${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}-arm64v8

docker manifest annotate ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX} ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}-arm32v6 --os=linux --arch=arm --variant=v6
docker manifest annotate ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX} ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}-arm32v7 --os=linux --arch=arm --variant=v7
docker manifest annotate ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX} ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}-arm64v8 --os=linux --arch=arm64 --variant=v8

docker manifest push ${TARGET}:${BUILD_VERSION}${NODE_VERSION}${TAG_SUFFIX}
}

#docker_manifest_list_testing_or_latest_rpi_python2() {
Expand Down Expand Up @@ -278,20 +290,20 @@ docker_manifest_list_version() {
# docker manifest push ${TARGET}:${2}${1}-rpi
#}

docker_manifest_list_testing_or_latest_python2() {
echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${2}${1}-python2."
docker manifest create ${TARGET}:${2}${1}-python2 \
${TARGET}:${BUILD_VERSION}${1:--10}-alpine-amd64-python2 \
${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v6-python2 \
${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v7-python2 \
${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm64v8-python2

docker manifest annotate ${TARGET}:${2}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v6-python2 --os=linux --arch=arm --variant=v6
docker manifest annotate ${TARGET}:${2}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v7-python2 --os=linux --arch=arm --variant=v7
docker manifest annotate ${TARGET}:${2}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm64v8-python2 --os=linux --arch=arm64 --variant=v8

docker manifest push ${TARGET}:${2}${1}-python2
}
#docker_manifest_list_testing_or_latest_python2() {
# echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${2}${1}-python2."
# docker manifest create ${TARGET}:${2}${1}-python2 \
# ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-amd64-python2 \
# ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v6-python2 \
# ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v7-python2 \
# ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm64v8-python2
#
# docker manifest annotate ${TARGET}:${2}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v6-python2 --os=linux --arch=arm --variant=v6
# docker manifest annotate ${TARGET}:${2}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm32v7-python2 --os=linux --arch=arm --variant=v7
# docker manifest annotate ${TARGET}:${2}${1}-python2 ${TARGET}:${BUILD_VERSION}${1:--10}-alpine-arm64v8-python2 --os=linux --arch=arm64 --variant=v8
#
# docker manifest push ${TARGET}:${2}${1}-python2
#}

docker_manifest_list_testing_or_latest_python3() {
echo "DOCKER MANIFEST: Create and Push docker manifest list - ${TARGET}:${2}${1}-python3."
Expand Down Expand Up @@ -412,4 +424,4 @@ prepare_qemu() {
popd
}

main $1 $2
main $1 $2 $3
31 changes: 18 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,29 @@ script:
docker logout
fi
#jobs:
# include:
# - stage: manifest
# if: tag =~ ^v
# script:
# # Create and push Docker manifest lists
# # Docker Login
# - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
#
jobs:
include:
- stage: manifest
if: tag =~ ^v
script:
# Create and push Docker manifest lists
# Docker Login
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

# # Create and Push Docker Manifest Lists to Docker Hub
# - echo "Create manifest list for Node 12 docker images."
# - ./.docker/docker.sh manifest-list "-12"
#

# - echo "Create manifest list for Node 10 docker images."
# - ./.docker/docker.sh manifest-list "-10"
#
# # Docker Logout
# - docker logout

# Create manifest list for default
- echo "Create manifest list for Node 10 docker images."
- ./.docker/docker.sh manifest-list "" "default"
- ./.docker/docker.sh manifest-list "10" "default"

# Docker Logout
- docker logout

# notify me when things fail
notifications:
Expand Down

0 comments on commit 01d8ff0

Please sign in to comment.