You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/packages-oss.yml

111 lines
3.8 KiB

---
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.1.1
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@sha256:fb04edf20446eed8af9eb6137d02fdf607f47028a0a806131f8b175a09620aab = golang:1.15.3-buster
base-image: "hashicorp.jfrog.io/docker/golang@sha256:fb04edf20446eed8af9eb6137d02fdf607f47028a0a806131f8b175a09620aab"
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 - \
&& 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 \
&& rm -rf /var/lib/apt/lists/* \
&& go get github.com/go-bindata/go-bindata/v3/go-bindata \
&& go-bindata --version
- name: ui
source-include: internal/ui/VERSION
dockerfile: |
RUN \
SHA="$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" \
&& DIR=internal/ui/source/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:core; ) \
&& TARGET=internal/ui/assets.go \
&& UIDIR="$DIR/ui/core/dist" \
&& go-bindata -fs -o "$TARGET" -pkg ui \
-prefix "$UIDIR" "$UIDIR" "$UIDIR/assets" \
&& rm -rf "$DIR"
- 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}}