Skip to content

Commit

Permalink
Merge pull request #91 from simelo/stdevHan_t75_not_deploy_circle
Browse files Browse the repository at this point in the history
Fixes #75 Correcting deploy in Circle CI
  • Loading branch information
olemis authored Jul 3, 2019
2 parents 06dd0f4 + d4adfbb commit 0219090
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
26 changes: 14 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
orangepi-plus2:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: orangepi-plus2
Expand All @@ -12,11 +12,12 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

raspberrypi3:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: raspberrypi3
Expand All @@ -26,11 +27,12 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

raspberrypi2:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: raspberry-pi2
Expand All @@ -40,11 +42,12 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

bananapi_m1_plus:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
QEMU_PLATFORM: bananapi-m1-plus
Expand All @@ -54,28 +57,27 @@ jobs:
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test

publish-github-release_32:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/libskycoin
environment:
TAG_DEPLOY: $(git tag -l --points-at HEAD)
steps:
- run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin
- run: if [[ $TAG_DEPLOY ]]; then echo $TAG_DEPLOY ; fi
- checkout
- setup_remote_docker:
version: 18.06.0-ce
- run: if [[ $TAG_DEPLOY ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/deploy-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi
docker_layer_caching: true
- run: bash $GOPATH/src/github.com/skycoin/libskycoin/ci-scripts/deploy-arm.sh

workflows:
version: 2
arm_test:
jobs:
- bananapi_m1_plus
- raspberrypi2
- raspberrypi3
- orangepi-plus2
- orangepi-plus2
- raspberrypi2
- bananapi_m1_plus
- publish-github-release_32
11 changes: 11 additions & 0 deletions ci-scripts/deploy-arm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -x

git --version

export VERSION="$(git describe --tags --exact-match HEAD)"

if [[ "$VERSION" ]]; then
docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/deploy-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy
fi
6 changes: 3 additions & 3 deletions docker/images/deploy-arm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG GITHUB_OAUTH_TOKEN
ARG PROJECT_USERNAME
ARG PROJECT_REPONAME
ARG SHA1
ARG VERSION
ADD . $GOPATH/src/github.com/skycoin/libskycoin/

RUN [ "cross-build-start" ]
Expand All @@ -15,9 +16,8 @@ RUN make -C $GOPATH/src/github.com/skycoin/libskycoin dep
RUN go get github.com/gz-c/gox
RUN go get -t ./...
ENV CGO_ENABLED=1
RUN export VERSION="$(git tag -l --points-at HEAD)"
RUN export ARCH="$(uname -m)"
RUN export OS="$(uname -s)"
ENV ARCH="armv7"
ENV OS="Linux"
RUN make -C $GOPATH/src/github.com/skycoin/libskycoin build
RUN tar -czf libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C $GOPATH/src/github.com/skycoin/libskycoin/build $GOPATH/src/github.com/skycoin/libskycoin/build/*
RUN go get github.com/tcnksm/ghr
Expand Down

0 comments on commit 0219090

Please sign in to comment.