Add arm builds (#6263)
* try arm builds * Update .circleci/config.yml Co-Authored-By: Matt Keeler <mkeeler@users.noreply.github.com> * Update .circleci/config.yml Co-Authored-By: Matt Keeler <mkeeler@users.noreply.github.com> * Update .circleci/config.yml Co-Authored-By: Matt Keeler <mkeeler@users.noreply.github.com>
This commit is contained in:
parent
1e80fc9c0f
commit
f5471c7f8d
7
.circleci/bash_env.sh
Normal file
7
.circleci/bash_env.sh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export GIT_COMMIT=$(git rev-parse --short HEAD)
|
||||||
|
export GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)
|
||||||
|
export GIT_DESCRIBE=$(git describe --tags --always --match "v*")
|
||||||
|
export GIT_IMPORT=github.com/hashicorp/consul/version
|
||||||
|
export GOLDFLAGS="-X ${GIT_IMPORT}.GitCommit=${GIT_COMMIT}${GIT_DIRTY} -X ${GIT_IMPORT}.GitDescribe=${GIT_DESCRIBE}"
|
|
@ -21,6 +21,7 @@ references:
|
||||||
GIT_AUTHOR_NAME: circleci-consul
|
GIT_AUTHOR_NAME: circleci-consul
|
||||||
GIT_COMMITTER_NAME: circleci-consul
|
GIT_COMMITTER_NAME: circleci-consul
|
||||||
S3_ARTIFACT_BUCKET: consul-dev-artifacts
|
S3_ARTIFACT_BUCKET: consul-dev-artifacts
|
||||||
|
BASH_ENV: .circleci/bash_env.sh
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# lint consul tests
|
# lint consul tests
|
||||||
|
@ -140,6 +141,7 @@ jobs:
|
||||||
docker:
|
docker:
|
||||||
- image: *GOLANG_IMAGE
|
- image: *GOLANG_IMAGE
|
||||||
environment: &build-env
|
environment: &build-env
|
||||||
|
<<: *ENVIRONMENT
|
||||||
GOXPARALLEL: 2 # CircleCI containers are 2 CPU x 4GB RAM
|
GOXPARALLEL: 2 # CircleCI containers are 2 CPU x 4GB RAM
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -167,17 +169,42 @@ jobs:
|
||||||
XC_ARCH: "amd64"
|
XC_ARCH: "amd64"
|
||||||
|
|
||||||
# build all arm/arm64 architecture supported OS binaries
|
# build all arm/arm64 architecture supported OS binaries
|
||||||
build-arm-arm64:
|
build-arm:
|
||||||
<<: *build-distros
|
docker:
|
||||||
|
- image: *GOLANG_IMAGE
|
||||||
environment:
|
environment:
|
||||||
<<: *build-env
|
<<: *ENVIRONMENT
|
||||||
XC_OS: linux
|
CGO_ENABLED: 1
|
||||||
XC_ARCH: "arm arm64"
|
GOOS: linux
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run: sudo apt-get update && sudo apt-get install -y gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
|
||||||
|
- run:
|
||||||
|
environment:
|
||||||
|
GOARM: 5
|
||||||
|
CC: arm-linux-gnueabi-gcc
|
||||||
|
GOARCH: arm
|
||||||
|
command: go build -o ./pkg/bin/linux_armel/consul -ldflags="${GOLDFLAGS}"
|
||||||
|
- run:
|
||||||
|
environment:
|
||||||
|
GOARM: 6
|
||||||
|
CC: arm-linux-gnueabihf-gcc
|
||||||
|
GOARCH: arm
|
||||||
|
command: go build -o ./pkg/bin/linux_armhf/consul -ldflags="${GOLDFLAGS}"
|
||||||
|
- run:
|
||||||
|
environment:
|
||||||
|
CC: aarch64-linux-gnu-gcc
|
||||||
|
GOARCH: arm64
|
||||||
|
command: go build -o ./pkg/bin/linux_aarch64/consul -ldflags="${GOLDFLAGS}"
|
||||||
|
- store_artifacts:
|
||||||
|
path: ./pkg/bin
|
||||||
|
|
||||||
# create a development build
|
# create a development build
|
||||||
dev-build:
|
dev-build:
|
||||||
docker:
|
docker:
|
||||||
- image: *GOLANG_IMAGE
|
- image: *GOLANG_IMAGE
|
||||||
|
environment:
|
||||||
|
<<: *ENVIRONMENT
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
@ -493,7 +520,7 @@ workflows:
|
||||||
jobs:
|
jobs:
|
||||||
- build-386
|
- build-386
|
||||||
- build-amd64
|
- build-amd64
|
||||||
- build-arm-arm64
|
- build-arm
|
||||||
test-integrations:
|
test-integrations:
|
||||||
jobs:
|
jobs:
|
||||||
- dev-build
|
- dev-build
|
||||||
|
|
Loading…
Reference in a new issue