Skip to content

Commit

Permalink
Merge pull request #6 from jianghang8421/multiarch-support
Browse files Browse the repository at this point in the history
Add multiarch CICD support
  • Loading branch information
ibuildthecloud authored Feb 25, 2019
2 parents 2114dd1 + e3f1ed2 commit 6fd6a3c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 10 deletions.
51 changes: 42 additions & 9 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
kind: pipeline
name: default
name: amd64

platform:
os: linux
Expand All @@ -11,18 +10,16 @@ steps:
pull: default
image: rancher/dapper:v0.4.1
commands:
- dapper ci
- dapper ci
volumes:
- name: docker
path: /var/run/docker.sock

- name: github_binary_release
image: drone/github-release
image: plugins/github-release
settings:
api_key:
from_secret: github_token
checksum:
- sha256
files:
- "dist/artifacts/*"
when:
Expand All @@ -33,8 +30,44 @@ steps:
- refs/tags/*
event:
- tag

volumes:
- name: docker
host:
- name: docker
host:
path: /var/run/docker.sock
---
kind: pipeline
name: arm64

platform:
os: linux
arch: arm64

steps:
- name: build
pull: default
image: rancher/dapper:v0.4.1
commands:
- dapper ci
volumes:
- name: docker
path: /var/run/docker.sock

- name: github_binary_release
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- "dist/artifacts/*"
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
volumes:
- name: docker
host:
path: /var/run/docker.sock
3 changes: 2 additions & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ RUN apt-get update && \
apt-get install -y gcc ca-certificates git wget curl vim less file && \
rm -f /bin/sh && ln -s /bin/bash /bin/sh

ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH_arm64=arm64 GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash

RUN wget -O - https://storage.googleapis.com/golang/go1.9.7.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
go get github.com/rancher/trash && go get github.com/golang/lint/golint

ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \
DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64 \
DOCKER_URL=DOCKER_URL_${ARCH}

RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker
Expand Down
2 changes: 2 additions & 0 deletions scripts/version
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi

git fetch

COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)

Expand Down

0 comments on commit 6fd6a3c

Please sign in to comment.