Skip to content

Commit d00de07

Browse files
committed
deploy v0.0.1
1 parent f8c56cb commit d00de07

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

.circleci/config.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,33 @@ jobs:
3030
docker:
3131
- image: circleci/golang:1.8
3232
environment:
33-
- GO_BUILD_OUTPUT: /go/src/github.com/bcaldwell/devctl/deploy
34-
- GO_BUILD_LDFLAGS: -X main.Version=${BUILD_VERSION} -X main.BuildDate=${BUILD_DATE}
35-
- SHA_FOLDER: /go/src/github.com/bcaldwell/devctl/deploy
33+
- GO_BUILD_OUTPUT: /go/src/github.com/bcaldwell/devctl/dist/release/devctl_{{.OS}}_{{.Arch}}_bin
34+
- GO_BUILD_OSARCH: linux/amd64 darwin/amd64
35+
- SHA_FOLDER: /go/src/github.com/bcaldwell/devctl/dist/release/
3636
- SHA_VERSION: ""
3737
working_directory: /go/src/github.com/bcaldwell/devctl
3838
steps:
3939
- checkout
40+
- run: sudo apt install ruby
41+
- run: sudo gem install ci-scripts
42+
- run: go get -u github.com/jteeuwen/go-bindata/...
43+
- run: go get github.com/tcnksm/ghr
44+
4045
- deploy:
41-
- run: export BUILD_DATE=`date +%Y-%m-%d:%H:%M:%S`
42-
- run: export BUILD_VERSION=`git log -1 --pretty=%B | tr " " "\n" | grep -Ei 'v[0-9]+(\.[0-9]+)*'`
43-
- run: export SHA_VERSION=$BUILD_VERSION
44-
45-
- run: go generate ./...
46-
- run: ci-scripts go/build
47-
- run: ci-scripts files/sha_firebase
48-
49-
# name: Release Master branch
50-
# command: |
51-
# if [ "${CIRCLE_BRANCH}" == "master" ]; then
52-
# bash scripts/release.sh
53-
# fi
46+
name: Release Master branch
47+
command: |
48+
if [ "${CIRCLE_BRANCH}" == "master" ]; then
49+
export BUILD_DATE=`date +%Y-%m-%d:%H:%M:%S`
50+
export BUILD_VERSION=`git log -1 --pretty=%B | tr " " "\n" | grep -Ei 'v[0-9]+(\.[0-9]+)*'`
51+
export GO_BUILD_LDFLAGS="-X main.Version=${BUILD_VERSION} -X main.BuildDate=${BUILD_DATE}"
52+
export SHA_VERSION="${BUILD_VERSION}"
53+
54+
go generate $(go list ./... | grep -v /vendor/)
55+
ci-scripts go/build
56+
ci-scripts files/sha_firebase
57+
58+
ghr -u bcaldwell -r devctl $BUILD_VERSION dist/release/
59+
fi
5460
5561
workflows:
5662
version: 2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ _testmain.go
3636
# Undo global rule
3737
!*.com
3838
coverage.txt
39+
/dist

0 commit comments

Comments
 (0)