Skip to content

Commit

Permalink
fix travis release
Browse files Browse the repository at this point in the history
  • Loading branch information
ydkn committed May 12, 2019
1 parent fdc7603 commit e62d217
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
19 changes: 13 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,31 @@ builds:
- freebsd
- linux
- netbsd
- solaris
- windows
goarch:
- amd64
- 386
- arm
- arm64
goarm:
- 5
- 6
- 7

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_sha256-checksums.txt"

archives:
- format: tar.gz
files:
- LICENSE
- README.md
- CHANGELOG.md

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

checksum:
algorithm: sha512

release:
prerelease: auto
25 changes: 10 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@ services:

install:
- docker build -t sensu-sic-handler .
- export CONTAINER_ID="$(docker run -d -v $(pwd):/go/src/sensu-sic-handler sensu-sic-handler sleep 3600)"
- export CONTAINER_ID="$(docker run -d -e GITHUB_TOKEN -v $(pwd):/go/src/sensu-sic-handler sensu-sic-handler sleep 3600)"
- docker exec ${CONTAINER_ID} sh -c 'dep ensure'

script:
- docker exec ${CONTAINER_ID} sh -c 'golangci-lint run -E gofmt -E gosec -E dupl -E goconst -E gocritic -E lll -E maligned -E misspell -E nakedret -E prealloc -E scopelint -E unconvert -E unparam'

before_script:
- echo "REPO ${TRAVIS_REPO_SLUG} TAG ${TRAVIS_TAG}"

deploy:
- provider: script
script: docker exec ${CONTAINER_ID} sh -c 'goreleaser'
skip_cleanup: true
on:
tags: true
script:
- docker exec ${CONTAINER_ID} sh -c 'golangci-lint run -E gofmt -E gosec -E dupl -E goconst -E gocritic -E lll -E maligned -E misspell -E nakedret -E prealloc -E scopelint -E unconvert -E unparam'

after_deploy:
- git clone https://github.com/sensu/sensu-go-bonsai-asset.git bonsai
- bonsai/generate-sha512sum.sh
- bonsai/github-release-upload.sh github_api_token="${GITHUB_TOKEN}" repo_slug="${TRAVIS_REPO_SLUG}" tag="${TRAVIS_TAG}" filename="dist/$(cat dist/sha512_file)"
deploy:
provider: script
script: docker exec ${CONTAINER_ID} sh -c 'goreleaser'
skip_cleanup: true
on:
tags: true

env:
global:
secure: "ZQpzhoXl5OLIPlCFSD2f1J4//FexrkUpsa+kmUn4jK47NP3RGCiT27U9awoqN+8JrMydRD6KkEkA965z6ZLbT2zowq3vSXyDPUwePOEDDLhrnkCLYq3uGhZSrq9eDldbyoMGE0fr/9L24uWPBSi5kAWo7odR8xOWlmfmBjZ1+QW0s72cciteGO837wVHcILEvkYbPF0p0aQgPXUfudwooE5RQwHimsflE+Ob8QYPGwDT7+f1rgLDNwdFV6KtxED5M3Zib38PVgxcxdXR6PSI6elaRUjWxOJDuvkGRDD0NePJk65XFEDfZD/qZ2GTrfZhAb6r8dB3EC7nY/tyjvqzK94T2ZiYjuqCdwv++Tw3fgVHCfvfdFQm6wixnBAprKHZe9gswE3THI7Y1R9+yisetOyzhZbsqv7L39eOorbWc1eFtrgebPcN+dq8Pz3bSWNPXgrFXfx3NaIfx8j5SBKYJy88AXtC4Pj+D275DZnTEWXjzIQJMgwvWU/fukE1lNVFe23g9OKUAcFcTiBgLshQnpyGYAZqtpzUFRMg0fpHBp/YzVIb/gIVZQaeWTM7jRylcg3L3N3gjkEXSd/3ZVGz+6tGfiKt2Tzxkar6Xz9WK6pdC2yX0OpYQrt072ywUjNguHEsRMyb/IVV7tFqY3PoiBGS5x5S5S0EhKYf4cTHdng="
secure: "iiHyfMMq9ovS9xstBR6z/h0hkAKreCtuGRKCcLFFEktB2FwC7C7bBkb1w1gLJfye7yqLX25KGt7is8BEhyUDLe9kUJiStceGgMDom1yWYd+qM1Ae8ijgkhTiDJMFsBpuOZBa6UpUWuWLENamSX84oP+ykO5nmNelg4+ed4LpixI7i2I6LYmyPCtuSpn077uIuZMzEvQ07EPP7EUCK5iSkgweVsBeFIZVZ0D/Pviiwbcvo4kYpBHBJVMnVT0C8GYo6jmuHFYxxoF4RIULmxLzwsJGKOAUVejKfhuselWhgPim8r8EMVgoPq9e249Ev1rlsopKj/MA7Mu6lsStMqCEkIi1VprHGLWWpSuIpBllq26yx5+3XND7x8oG6AS7Ieq8RBjf8q4VuYYJCBgV7yeMhirbBZXuoJryZJEVx6PH6vEH2zWSIVWn4Iu7NEuI3rvTi+kTf/US/IzC/6HQ7Vft1c4PrKNrJlOf+ai7JL6EId1pfq/BM30ecjk/Kb2JWZDe9L4mRy+bRRsMecVWhVcUDD1VLWPyx7aQ4rZTc3hNIV4Lr1tshmvrupTVihpHFiVXEa7SGEThI8t2Yn+EWMulYX9Db4NQr/NYqsfPjQicwsHS4IjX7L5VF8n39APduiksuq35o8hd4eR6E/bBrVjiMxnSbu9eadzamyEtf7SbOJk="
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.s

# Install goreleaser
RUN wget -q -O /tmp/goreleaser.tar.gz \
https://github.com/goreleaser/goreleaser/releases/download/v0.106.0/goreleaser_Linux_arm64.tar.gz && \
https://github.com/goreleaser/goreleaser/releases/download/v0.106.0/goreleaser_Linux_x86_64.tar.gz && \
tar -xf /tmp/goreleaser.tar.gz -C /usr/local/bin && rm -rf /tmp/*

# Set the working directory
Expand Down

0 comments on commit e62d217

Please sign in to comment.