106 lines
3.6 KiB
YAML
106 lines
3.6 KiB
YAML
---
|
|
config:
|
|
product-repo: https://github.com/hashicorp/boundary.git
|
|
release-repo: https://github.com/hashicorp/boundary-release.git
|
|
product-id: github.com/hashicorp/boundary
|
|
circleci-project-slug: gh/hashicorp/boundary
|
|
circleci-host: circleci.com
|
|
on-publish: create-github-release
|
|
|
|
inputs:
|
|
defaults:
|
|
PRODUCT_NAME: boundary
|
|
PRODUCT_VERSION: 0.4.0
|
|
BUILD_TAGS: ui
|
|
CGO_ENABLED: 0
|
|
|
|
templates:
|
|
BINARY_NAME: '{{.PRODUCT_NAME}}{{if eq .GOOS "windows"}}.exe{{end}}'
|
|
PRODUCT_VERSION_MMP: '{{with .PRODUCT_VERSION | strings.SplitN "-" 2}}{{index . 0}}{{end}}'
|
|
PRODUCT_VERSION_PRE: '{{with .PRODUCT_VERSION | strings.SplitN "-" 2}}{{if gt (len .) 1}}{{index . 1}}{{else}}{{end}}{{end}}'
|
|
|
|
packages:
|
|
- inputs: { GOOS: darwin, GOARCH: amd64 }
|
|
- inputs: { GOOS: freebsd, GOARCH: 386 }
|
|
- inputs: { GOOS: freebsd, GOARCH: amd64 }
|
|
- inputs: { GOOS: freebsd, GOARCH: arm }
|
|
- inputs: { GOOS: linux, GOARCH: 386 }
|
|
- inputs: { GOOS: linux, GOARCH: amd64 }
|
|
- inputs: { GOOS: linux, GOARCH: arm }
|
|
- inputs: { GOOS: linux, GOARCH: arm64 }
|
|
- inputs: { GOOS: netbsd, GOARCH: 386 }
|
|
- inputs: { GOOS: netbsd, GOARCH: amd64 }
|
|
- inputs: { GOOS: openbsd, GOARCH: 386 }
|
|
- inputs: { GOOS: openbsd, GOARCH: amd64 }
|
|
- inputs: { GOOS: solaris, GOARCH: amd64 }
|
|
- inputs: { GOOS: windows, GOARCH: 386 }
|
|
- inputs: { GOOS: windows, GOARCH: amd64 }
|
|
|
|
meta:
|
|
templates:
|
|
BUILD_JOB_NAME: >-
|
|
{{.GOOS}}_{{.GOARCH}}_package
|
|
BUNDLE_NAME: "boundary_{{.PRODUCT_VERSION}}"
|
|
|
|
package-aliases:
|
|
- type: local
|
|
template: >-
|
|
{{.BUNDLE_NAME}}_{{.GOOS}}_{{.GOARCH}}.zip
|
|
- type: public-hc-releases
|
|
template: >-
|
|
boundary/{{.BUNDLE_NAME}}/{{.BUNDLE_NAME}}_{{.GOOS}}_{{.GOARCH}}.zip
|
|
|
|
# golang:1.16.5-buster
|
|
base-image: "docker.mirror.hashicorp.services/golang@sha256:be0e3a0f3ffa448b0bcbb9019edca692b8278407a44dc138c60e6f12f0218f87"
|
|
|
|
layers:
|
|
- name: base
|
|
dockerfile: |
|
|
ENV \
|
|
GOPATH= \
|
|
GOBIN=/usr/local/bin \
|
|
GO111MODULE=on \
|
|
CGO_ENABLED=0
|
|
RUN \
|
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg \
|
|
| apt-key add - \
|
|
&& curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key \
|
|
| apt-key add - \
|
|
&& echo "deb https://deb.nodesource.com/node_14.x buster main" | tee /etc/apt/sources.list.d/nodesource.list \
|
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
|
|
&& apt-get update \
|
|
&& apt-get install -yq yarn zip nodejs \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
- name: ui
|
|
source-include: internal/ui/VERSION
|
|
dockerfile: |
|
|
RUN \
|
|
SHA="$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" \
|
|
&& DIR=internal/ui/.tmp/boundary-ui \
|
|
&& mkdir -p "$(dirname "$DIR")" \
|
|
&& git clone https://github.com/hashicorp/boundary-ui "$DIR" \
|
|
&& ( cd "$DIR" \
|
|
&& git fetch origin "$SHA" \
|
|
&& git checkout "$SHA" \
|
|
&& yarn install \
|
|
&& yarn build:ui:admin; )
|
|
|
|
- name: go-modules
|
|
source-include: "go.mod go.sum */go.mod */go.sum"
|
|
dockerfile: |
|
|
RUN go mod download
|
|
|
|
- name: copy-source
|
|
source-include: "*.go"
|
|
|
|
build-command: VERSION_PKG_PATH=github.com/hashicorp/boundary/version;
|
|
unset GOPATH;
|
|
go build -v -tags '{{.BUILD_TAGS}}'
|
|
-ldflags "-X $VERSION_PKG_PATH.GitCommit=$PACKAGE_SOURCE_ID
|
|
-X $VERSION_PKG_PATH.Version={{.PRODUCT_VERSION_MMP}}
|
|
-X $VERSION_PKG_PATH.VersionPrerelease={{.PRODUCT_VERSION_PRE}}"
|
|
-o $OUTPUT_DIR/{{.BINARY_NAME}}
|
|
./cmd/boundary
|
|
&& cd $OUTPUT_DIR && zip $PACKAGE_ZIP_NAME {{.BINARY_NAME}}
|