Skip to content

Commit

Permalink
👷 Build nopackr for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
nlepage committed Oct 3, 2019
1 parent 015403f commit ccbfc60
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,28 @@ jobs:
at: .
- run: go test .
- run: packr
- run: CGO_ENABLED=0 go build -ldflags '-extldflags "-static" -X github.com/Zenika/marcel/version.Version=${CIRCLE_TAG:-$CIRCLE_BRANCH} -X github.com/Zenika/marcel/version.Revision=$CIRCLE_SHA1' -tags 'osusergo netgo' -o marcel
- run: "CGO_ENABLED=0 go build -ldflags \"-extldflags \\\"-static\\\" -X github.com/Zenika/marcel/version.Version=$CIRCLE_BRANCH -X github.com/Zenika/marcel/version.Revision=$CIRCLE_SHA1\" -tags \"osusergo netgo\" -o marcel"
- persist_to_workspace:
root: .
paths:
- Dockerfile
- marcel

build_marcel_nopackr:
executor: go_executor
steps:
- checkout
- restore_cache:
key: marcel-go-deps-{{ checksum "go.mod" }}
- run: go mod download
- save_cache:
key: marcel-go-deps-{{ checksum "go.mod" }}
paths:
- /go/pkg/mod
- attach_workspace:
at: .
- run: go test .
- run: "CGO_ENABLED=0 go build -ldflags \"-extldflags \\\"-static\\\" -X github.com/Zenika/marcel/version.Version=$CIRCLE_TAG -X github.com/Zenika/marcel/version.Revision=$CIRCLE_SHA1\" -tags \"osusergo netgo nopackr\" -o marcel"
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -118,6 +139,19 @@ jobs:
paths:
- backoffice/marcel-backoffice.tgz

archive_frontend:
executor: std_executor
steps:
- attach_workspace:
at: .
- run:
command: tar czf ../marcel-frontend.tgz *
working_directory: frontend/build
- persist_to_workspace:
root: .
paths:
- frontend/marcel-frontend.tgz

deploy_integration:
executor: gcloud_executor
steps:
Expand All @@ -139,7 +173,8 @@ jobs:
- attach_workspace:
at: .
- run: go get github.com/tcnksm/ghr
- run: ghr -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} backoffice/marcel-backoffice.tgz
- run: mkdir assets && mv backoffice/marcel-backoffice.tgz frontend/marcel-frontend.tgz marcel assets
- run: ghr -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} assets

filters-all: &filters-all
tags:
Expand Down Expand Up @@ -173,7 +208,11 @@ workflows:
- build_frontend:
filters: *filters-all
- build_marcel:
filters: *filters-all
requires:
- build_backoffice
- build_frontend
- build_marcel_nopackr:
filters: *filters-tag
requires:
- build_backoffice
- build_frontend
Expand All @@ -185,11 +224,17 @@ workflows:
filters: *filters-tag
requires:
- build_backoffice
- archive_frontend:
filters: *filters-tag
requires:
- build_frontend
- deploy_integration:
filters: *filters-master
requires:
- docker_build_marcel
- publish_github_release:
filters: *filters-tag
requires:
- build_marcel_nopackr
- archive_backoffice
- archive_frontend

0 comments on commit ccbfc60

Please sign in to comment.