Skip to content

Commit

Permalink
devtools only
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondMouthaan committed Aug 24, 2019
1 parent 3225de1 commit 8aa6813
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 165 deletions.
6 changes: 5 additions & 1 deletion .docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ARG BUILD_REF
ARG NODE_RED_VERSION
ARG ARCH
ARG PYTHON_VERSION
ARG DEVTOOLS
ARG QEMU_ARCH
ARG OS

Expand Down Expand Up @@ -53,7 +54,7 @@ RUN set -ex && \
RUN chmod u+x /tmp/install_python_gpio.sh && /tmp/install_python_gpio.sh

# Install Devtools
#RUN chmod u+x /tmp/install_devtools.sh && /tmp/install_devtools.sh
RUN chmod u+x /tmp/install_devtools.sh && /tmp/install_devtools.sh

# Set work directory
WORKDIR /usr/src/node-red
Expand All @@ -65,6 +66,9 @@ USER node-red
COPY package.json /usr/src/node-red/
RUN npm install

# Rebuild bcrypt
RUN chmod u+x /tmp/rebuild_bcrypt.sh && /tmp/rebuild_bcrypt.sh.sh

# Replace Python 2.7 with 3.6 in 36-rpi-gpio.js or remove Node-RED build-in rpi-gpio for non arm
USER root
RUN chmod u+x /tmp/fix_python_gpio.sh && /tmp/fix_python_gpio.sh
Expand Down
58 changes: 0 additions & 58 deletions .docker/Images_variants.md

This file was deleted.

File renamed without changes.
58 changes: 17 additions & 41 deletions .docker/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ docker_build() {
echo "DOCKER BUILD: build version -> ${BUILD_VERSION}."
echo "DOCKER BUILD: node-red version -> ${NODE_RED_VERSION}."
echo "DOCKER BUILD: qemu arch - ${QEMU_ARCH}."
echo "DOCKER BUILD: python version - ${PYTHON_VERSION}."
echo "DOCKER BUILD: devtools - ${DEVTOOLS}."
echo "DOCKER BUILD: docker file - ${DOCKER_FILE}."

docker build --no-cache \
Expand All @@ -60,6 +62,7 @@ docker_build() {
--build-arg NODE_RED_VERSION=v${NODE_RED_VERSION} \
--build-arg QEMU_ARCH=${QEMU_ARCH} \
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \
--build-arg DEVTOOLS=${DEVTOOLS} \
--file ./.docker/${DOCKER_FILE} \
--tag ${TARGET}:build .
}
Expand All @@ -84,8 +87,13 @@ docker_tag() {
echo "DOCKER TAG: tagging image - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}."
docker tag ${TARGET}:build ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}
else
echo "DOCKER TAG: tagging image - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}."
docker tag ${TARGET}:build ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}
if [ ${DEVTOOLS} == "1" ]; then
echo "DOCKER TAG: tagging image - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}-devtools."
docker tag ${TARGET}:build ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}-devtools
else
echo "DOCKER TAG: tagging image - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}."
docker tag ${TARGET}:build ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}
fi
fi
}

Expand All @@ -96,8 +104,13 @@ docker_push() {
echo "DOCKER PUSH: pushing - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}."
docker push ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}
else
echo "DOCKER PUSH: pushing - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}."
docker push ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}
if [ ${DEVTOOLS} == "1" ]; then
echo "DOCKER PUSH: pushing - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}-devtools."
docker push ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}-devtools
else
echo "DOCKER PUSH: pushing - ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}."
docker push ${TARGET}:${BUILD_VERSION}-${NODE_VERSION}-${OS}-${ARCH}-python${PYTHON_VERSION}
fi
fi
}

Expand Down Expand Up @@ -319,43 +332,6 @@ docker_manifest_list_testing_or_latest() {
docker manifest push ${TARGET}:${2}${1}
}






































#
#docker_manifest_list_version_os_arch() {
# # Manifest Create alpine-amd64
Expand Down
9 changes: 9 additions & 0 deletions .docker/scripts/rebuild_bcrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ex

# Install Devtools
if [[ ${DEVTOOLS} == "1" ]]; then
# src: https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions#alpine-linux-based-images
echo "Rebuild bcrypt from source"
npm rebuild bcrypt --build-from-source
fi
99 changes: 53 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,55 @@ env:
matrix:
### Node JS 12 ####################################################################################################
# No Python Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=0 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=0 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=0 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=0 DEVTOOLS=0

# Python 2 Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=2
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=2
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=2
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=2
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=2 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=2 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=2 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=2 DEVTOOLS=0

# Python 3 Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=3
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=3
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=3
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=3
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=3 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=3 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=3 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=3 DEVTOOLS=0

# Devtools Images
# Python 3 Images
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=3 DEVTOOLS=1
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=3 DEVTOOLS=1
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=3 DEVTOOLS=1
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=3 DEVTOOLS=1
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=3 DEVTOOLS=1
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=3 DEVTOOLS=1
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=3 DEVTOOLS=1
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=3 DEVTOOLS=1

### Node JS 10 ####################################################################################################
# No Python Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=0 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=0 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=0 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=0 DEVTOOLS=0

# Python 2 Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=2
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=2
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=2
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=2
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=2 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=2 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=2 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=2 DEVTOOLS=0

# Python 3 Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=3
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=3
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=3
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=3
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=3 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=3 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=3 DEVTOOLS=0
# - DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=3 DEVTOOLS=0

# Devtools Images
# Python 3 Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=3 DEVTOOLS=1
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=3 DEVTOOLS=1
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=3 DEVTOOLS=1
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=10 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=3 DEVTOOLS=1

before_install:
- ./.docker/docker.sh prepare
Expand Down Expand Up @@ -93,24 +100,24 @@ 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

# 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
#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

# notify me when things fail
notifications:
Expand Down
Loading

0 comments on commit 8aa6813

Please sign in to comment.