-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to use GitLab CI for ARM builds
- Loading branch information
Showing
4 changed files
with
161 additions
and
9 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
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,125 @@ | ||
image: golang:1.10-stretch | ||
|
||
variables: | ||
REPO_NAME: github.com/ernoaapa/eliot | ||
|
||
stages: | ||
- test | ||
- build | ||
- publish | ||
|
||
before_script: | ||
- go version | ||
# Move project under $GOPATH | ||
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME) | ||
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME | ||
- cd $GOPATH/src/$REPO_NAME | ||
# Configure Docker | ||
- ./build/install-docker.sh | ||
- echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin | ||
|
||
# BUILD | ||
build: | ||
stage: build | ||
tags: | ||
- arm64 | ||
script: | ||
- ./build/install-build-tools.sh | ||
- goreleaser --snapshot | ||
artifacts: | ||
paths: | ||
- dist/ | ||
|
||
|
||
# TEST | ||
.test: &test | ||
stage: test | ||
script: | ||
- "! go fmt -l pkg cmd 2>&1 | read" | ||
- go vet ./... | ||
- go test -v ./... | ||
|
||
test:arm64: | ||
<<: *test | ||
tags: | ||
- arm64 | ||
|
||
test:armv7: | ||
<<: *test | ||
tags: | ||
- armv7 | ||
|
||
# PUBLISH | ||
.publish: &publish | ||
stage: publish | ||
only: | ||
- tags | ||
script: | ||
- ./build/install-build-tools.sh | ||
- goreleaser --rm-dist | ||
- .circleci/scripts/push-docker-manifest.sh $(git describe --tags --always --dirty) | ||
- | | ||
for package in dist/eliot_*.deb; do | ||
pkgcloud-push ernoaapa/eliot/raspbian/stretch $package | ||
done | ||
artifacts: | ||
paths: | ||
- dist/ | ||
|
||
publish:arm64: | ||
<<: *publish | ||
tags: | ||
- arm64 | ||
variables: | ||
GOARCH: arm64 | ||
|
||
publish:armv6: | ||
<<: *publish | ||
tags: | ||
- armv6 | ||
variables: | ||
GOARCH: arm | ||
GOARM: "6" | ||
|
||
publish:armv7: | ||
<<: *publish | ||
tags: | ||
- armv7 | ||
variables: | ||
GOARCH: arm | ||
GOARM: "7" | ||
|
||
|
||
# PUBLISH DEBS | ||
.publish-debs: &publish-debs | ||
stage: publish | ||
script: | ||
- ./build/install-build-tools.sh | ||
- apt-get update && apt-get install -y btrfs-tools libseccomp-dev | ||
- ./deps/publish-all.sh | ||
artifacts: | ||
paths: | ||
- dist/ | ||
|
||
publish-debs:arm64: | ||
<<: *publish-debs | ||
tags: | ||
- arm64 | ||
variables: | ||
GOARCH: arm64 | ||
|
||
publish-debs:armv6: | ||
<<: *publish-debs | ||
tags: | ||
- armv6 | ||
variables: | ||
GOARCH: arm | ||
GOARM: "6" | ||
|
||
publish-debs:armv7: | ||
<<: *publish-debs | ||
tags: | ||
- armv7 | ||
variables: | ||
GOARCH: arm | ||
GOARM: "7" |
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,21 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
apt-get update && apt-get install -y \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
software-properties-common | ||
|
||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | ||
apt-key fingerprint 0EBFCD88 | ||
add-apt-repository \ | ||
"deb https://download.docker.com/linux/debian \ | ||
$(lsb_release -cs) \ | ||
stable" | ||
|
||
apt-get update && apt-get install -y docker-ce | ||
|
||
echo "Installed docker:" | ||
docker version |