From 1c6d5a2d682862cf6ba6eb5a7384325490ff8b21 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 8 Nov 2020 20:55:31 +0100 Subject: [PATCH] CI/CD: add armel and armhl builds --- .drone.yml | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 1 + 2 files changed, 145 insertions(+) diff --git a/.drone.yml b/.drone.yml index 62ab453..87896ac 100644 --- a/.drone.yml +++ b/.drone.yml @@ -182,6 +182,150 @@ steps: password: from_secret: docker_password +--- +kind: pipeline +type: docker +name: build-arm + +platform: + os: linux + arch: arm + +steps: +- name: frontend + image: node:alpine + commands: + - apk --no-cache add python2 build-base + - yarn config set network-timeout 100000 + - yarn --cwd htdocs install + - yarn --cwd htdocs --offline build + +- name: backend armel + image: golang:alpine + commands: + - apk --no-cache add go-bindata + - sed -i '/yarn --cwd htdocs --offline build/d' static.go + - go generate -v + - go build -v -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el + environment: + GOARM: 5 + +- name: deploy armel + image: appleboy/drone-scp + settings: + tar_tmp_path: /tmp/ + host: get.happydns.org + target: /var/www/happydns.org/get/${DRONE_BRANCH//\//-} + source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el + username: + from_secret: ssh_username + key: + from_secret: deploy_key + port: + from_secret: ssh_port + when: + event: + - push + +- name: deploy armel release + image: appleboy/drone-scp + settings: + tar_tmp_path: /tmp/ + host: get.happydns.org + target: /var/www/happydns.org/get/${DRONE_TAG} + source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el + username: + from_secret: ssh_username + key: + from_secret: deploy_key + port: + from_secret: ssh_port + when: + event: + - tag + +- name: backend armhf + image: golang:alpine + commands: + - go build -v -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf + environment: + GOARM: 6 + +- name: deploy armhf + image: appleboy/drone-scp + settings: + tar_tmp_path: /tmp/ + host: get.happydns.org + target: /var/www/happydns.org/get/${DRONE_BRANCH//\//-} + source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf + username: + from_secret: ssh_username + key: + from_secret: deploy_key + port: + from_secret: ssh_port + when: + event: + - push + +- name: deploy armhf release + image: appleboy/drone-scp + settings: + tar_tmp_path: /tmp/ + host: get.happydns.org + target: /var/www/happydns.org/get/${DRONE_TAG} + source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf + username: + from_secret: ssh_username + key: + from_secret: deploy_key + port: + from_secret: ssh_port + when: + event: + - tag + +- name: backend armv7 + image: golang:alpine + commands: + - go build -v -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 + environment: + GOARM: 7 + +- name: deploy armv7 + image: appleboy/drone-scp + settings: + tar_tmp_path: /tmp/ + host: get.happydns.org + target: /var/www/happydns.org/get/${DRONE_BRANCH//\//-} + source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 + username: + from_secret: ssh_username + key: + from_secret: deploy_key + port: + from_secret: ssh_port + when: + event: + - push + +- name: deploy armv7 release + image: appleboy/drone-scp + settings: + tar_tmp_path: /tmp/ + host: get.happydns.org + target: /var/www/happydns.org/get/${DRONE_TAG} + source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 + username: + from_secret: ssh_username + key: + from_secret: deploy_key + port: + from_secret: ssh_port + when: + event: + - tag + --- kind: pipeline name: docker-manifest diff --git a/Dockerfile b/Dockerfile index 7761bee..cf119bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ RUN apk --no-cache add python2 build-base COPY htdocs/ htdocs/ +RUN yarn config set network-timeout 100000 RUN yarn --cwd htdocs install RUN yarn --cwd htdocs --offline build