Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build process to leverage goreleaser #335

Merged
merged 6 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
version: 2
version: 2.1

jobs:
cfn-nag:
executors:
golang-executor:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/stelligent/mu
environment:
AWS_REGION: us-west-2
ruby-executor:
docker:
- image: circleci/ruby:2.4.2-jessie-node

jobs:
cfn-nag:
executor: ruby-executor
steps:
- checkout
- run:
name: cfn-nag
command: make nag

unit-test:
environment:
AWS_REGION: us-west-2
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/stelligent/mu
executor: golang-executor
steps:
- checkout
- restore_cache:
Expand All @@ -36,9 +42,7 @@ jobs:
- ~/.cache/go-build

release:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/stelligent/mu
executor: golang-executor
steps:
- checkout

Expand All @@ -48,7 +52,7 @@ jobs:
# The second key is for the repo homebrew-tap
- add_ssh_keys:
fingerprints:
- "53:1f:d0:6f:24:2a:bf:cb:92:0f:bc:1e:14:6e:1d:72"
#- "53:1f:d0:6f:24:2a:bf:cb:92:0f:bc:1e:14:6e:1d:72"
- "35:fc:cc:f6:12:88:e2:56:24:17:09:36:3e:53:e6:68"

## In order for deploy to work, you need an environment variable set in CircleCI named "GITHUB_TOKEN" that contains
Expand All @@ -65,33 +69,31 @@ jobs:
git config --global user.email "cplee+mu@nektos.com"
git config --global user.name "mu-ci"

#make release
#make formula
make release

- store_artifacts:
path: artifacts
path: dist


workflows:
version: 2
test-and-release:
jobs:
- unit-test:
filters:
tags:
ignore: /^v[0-9]/
only: /.*/
- cfn-nag:
filters:
tags:
ignore: /^v[0-9]/
only: /.*/
- release:
requires:
- unit-test
- cfn-nag
filters:
tags:
ignore: /^v[0-9]/
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
branches:
only:
- develop
- master
- master
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
*.iml
.idea
.vscode
.release/
.cfn_nag
dist/
vendor/
*~
homebrew-tap/
*-packr.go
CHANGELOG.md
16 changes: 16 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
builds:
- env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
archive:
format: binary
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Env.SNAPSHOT_VERSION }}"
Loading