-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding tavis workflow and multi arch, bumping to stretch
- Loading branch information
Showing
6 changed files
with
143 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
sudo: true | ||
|
||
language: bash | ||
|
||
services: | ||
- docker | ||
|
||
env: | ||
global: | ||
- DEBIAN_FRONTEND="noninteractive" | ||
- DOCKERHUB_LIVE="taisun/gateway" | ||
- GITHUB_REPO="Taisun-Docker/gateway" | ||
|
||
jobs: | ||
include: | ||
- stage: BuildMaster | ||
if: (branch = master) AND (NOT (type IN (pull_request))) | ||
before_install: | ||
- /bin/bash pre_install | ||
script: | ||
# Grab the qemu binaries | ||
- wget https://s3-us-west-2.amazonaws.com/taisun-builds/qemu/qemu-aarch64-static | ||
- wget https://s3-us-west-2.amazonaws.com/taisun-builds/qemu/qemu-arm-static | ||
- chmod +x qemu-* | ||
# Build the applicaiton against the 3 architectures | ||
- docker build --no-cache -f Dockerfile.amd64 -t ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} . | ||
- docker build --no-cache -f Dockerfile.armhf -t ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} . | ||
- docker build --no-cache -f Dockerfile.aarch64 -t ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} . | ||
# Tag these builds to latest | ||
- docker tag ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:amd64-latest | ||
- docker tag ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-latest | ||
- docker tag ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-latest | ||
# Login to DockerHub | ||
- echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin | ||
# Push all of the tags | ||
- docker push ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} | ||
- docker push ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} | ||
- docker push ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} | ||
- docker push ${DOCKERHUB_LIVE}:amd64-latest | ||
- docker push ${DOCKERHUB_LIVE}:arm32v6-latest | ||
- docker push ${DOCKERHUB_LIVE}:arm64v8-latest | ||
# Generate local manifests for latest and at commit | ||
- docker manifest create ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:amd64-latest ${DOCKERHUB_LIVE}:arm32v6-latest ${DOCKERHUB_LIVE}:arm64v8-latest | ||
- docker manifest annotate ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:arm32v6-latest --os linux --arch arm | ||
- docker manifest annotate ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:arm64v8-latest --os linux --arch arm64 --variant armv8 | ||
- docker manifest create ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} | ||
- docker manifest annotate ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} --os linux --arch arm | ||
- docker manifest annotate ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} --os linux --arch arm64 --variant armv8 | ||
# Push the manifests to these meta tags | ||
- docker manifest push ${DOCKERHUB_LIVE}:latest | ||
- docker manifest push ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} | ||
# Sync readme to DockerHub | ||
- docker pull lsiodev/readme-sync | ||
- docker run --rm=true -e DOCKERHUB_USERNAME=$DOCKERUSER -e DOCKERHUB_PASSWORD=$DOCKERPASS -e GIT_REPOSITORY=${GITHUB_REPO} -e DOCKER_REPOSITORY=${DOCKERHUB_LIVE} -e GIT_BRANCH=master lsiodev/readme-sync bash -c 'node sync' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Dockerfile for the taisun web proxy gateway | ||
# 2017 | ||
# From node base image | ||
FROM node@sha256:2db8f0d2db1748792a828e06b6fcd33df108bfec2023b095ebfeaaa4af07c2f1 | ||
LABEL maintainer="Ryan Kuba <[email protected]>" | ||
# Add qemu to build on x86_64 systems | ||
COPY qemu-aarch64-static /usr/bin | ||
|
||
# Get Packages and easyrsa | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl supervisor apache2-utils && \ | ||
curl --insecure https://dl.eff.org/certbot-auto -o /usr/local/bin/certbot-auto && \ | ||
chmod +x /usr/local/bin/certbot-auto && \ | ||
/usr/local/bin/certbot-auto --noninteractive --os-packages-only && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Add repo bins | ||
ADD ./bin /usr/local/bin | ||
RUN chmod a+x /usr/local/bin/* | ||
|
||
# Copy over application and install dependencies | ||
RUN mkdir -p /usr/src/Taisun-gateway | ||
COPY . /usr/src/Taisun-gateway | ||
WORKDIR /usr/src/Taisun-gateway | ||
RUN npm config set unsafe-perm true && \ | ||
npm i npm@latest -g && \ | ||
npm install | ||
|
||
|
||
# App runs on 3000 | ||
EXPOSE 3000 | ||
|
||
#Copy over supervisor config file | ||
COPY ./supervisor.conf /etc/supervisor/conf.d/supervisor.conf | ||
|
||
CMD ["/usr/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Dockerfile for the taisun web proxy gateway | ||
# 2017 | ||
# From node base image | ||
FROM node:8.9 | ||
FROM node:9-stretch | ||
|
||
LABEL maintainer="Ryan Kuba <[email protected]>" | ||
|
||
|
@@ -21,7 +21,9 @@ RUN chmod a+x /usr/local/bin/* | |
RUN mkdir -p /usr/src/Taisun-gateway | ||
COPY . /usr/src/Taisun-gateway | ||
WORKDIR /usr/src/Taisun-gateway | ||
RUN npm install | ||
RUN npm i npm@latest -g && \ | ||
npm install | ||
|
||
|
||
# App runs on 3000 | ||
EXPOSE 3000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Dockerfile for the taisun web proxy gateway | ||
# 2017 | ||
# From node base image | ||
FROM node@sha256:7d8d1965006c26ba7661f1c1f32d7f16705b2c01b900c3000dc7ed0f8ffa0e17 | ||
LABEL maintainer="Ryan Kuba <[email protected]>" | ||
# Add qemu to build on x86_64 systems | ||
COPY qemu-arm-static /usr/bin | ||
|
||
# Get Packages and easyrsa | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl supervisor apache2-utils && \ | ||
curl --insecure https://dl.eff.org/certbot-auto -o /usr/local/bin/certbot-auto && \ | ||
chmod +x /usr/local/bin/certbot-auto && \ | ||
/usr/local/bin/certbot-auto --noninteractive --os-packages-only && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Add repo bins | ||
ADD ./bin /usr/local/bin | ||
RUN chmod a+x /usr/local/bin/* | ||
|
||
# Copy over application and install dependencies | ||
RUN mkdir -p /usr/src/Taisun-gateway | ||
COPY . /usr/src/Taisun-gateway | ||
WORKDIR /usr/src/Taisun-gateway | ||
RUN npm config set unsafe-perm true && \ | ||
npm i npm@latest -g && \ | ||
npm install | ||
|
||
|
||
# App runs on 3000 | ||
EXPOSE 3000 | ||
|
||
#Copy over supervisor config file | ||
COPY ./supervisor.conf /etc/supervisor/conf.d/supervisor.conf | ||
|
||
CMD ["/usr/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/with-contenv bash | ||
|
||
# Update Docker | ||
sudo apt-get update | ||
sudo apt-get install -y --only-upgrade docker-ce | ||
|
||
# Set experiemental features on | ||
mkdir -p ~/.docker/ | ||
echo '{"experimental": "enabled"}' > ~/.docker/config.json | ||
|
||
# Register the Qemu binaries | ||
docker run --rm --privileged multiarch/qemu-user-static:register |