Skip to content

Commit

Permalink
Merge pull request #566 from digitalocean/candidate
Browse files Browse the repository at this point in the history
autodeploy candidate, stable snaps
  • Loading branch information
hilary authored Sep 3, 2019
2 parents cd833e6 + c77494b commit cd4ee91
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
25 changes: 17 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
name: "Testing: Bionic, go 1.11"
stage: test
script: make test
os: linux
dist: bionic
go: 1.11.x
env:
Expand Down Expand Up @@ -55,18 +54,28 @@ jobs:
- CACHE_NAME=WINDOWS_1.12

- stage: deploy
name: "goreleaser"
script: echo "deploying"
dist: bionic
go: 1.12.x
script: echo "deploying"
before_deploy: echo "$DOCKER_PASSWORD" | docker login --username sammytheshark --password-stdin
services: docker
env:
- CACHE_NAME=GORELEASER
- CACHE_NAME=DEPLOY
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login --username sammytheshark --password-stdin
- make _build_snap
deploy:
- provider: script
script: curl -sL https://git.io/goreleaser | bash
skip_cleanup: true
on:
tags: true

provider: script
script: curl -sL https://git.io/goreleaser | bash
- provider: snap
channel: stable
snap: doctl_v*.snap
skip_cleanup: true
on:
tags: true
- provider: snap
channel: candidate
snap: doctl_v*.snap
skip_cleanup: true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ shellcheck:

CHANNEL ?= stable

.PHONY: _build_snap
_build_snap:
@CHANNEL=${CHANNEL} scripts/_build_snap.sh

.PHONY: snap
snap:
@echo "=> publish snap (normally done by travis)"
Expand Down
14 changes: 14 additions & 0 deletions scripts/_build_snap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"

set +e
rm doctl_*_amd64.snap 2>/dev/null
set -e

echo "building snap"
echo ""
cd "$DIR" && docker run --rm -v "$DIR":/build -w /build snapcore/snapcraft:stable \
bash -c "apt update && snapcraft"
9 changes: 1 addition & 8 deletions scripts/snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ function cleanup {
}
trap cleanup EXIT

set +e
rm doctl_*_amd64.snap 2>/dev/null
set -e

echo "building snap"
echo ""
cd "$DIR" && docker run --rm -v "$DIR":/build -w /build snapcore/snapcraft:stable \
bash -c "apt update && snapcraft"
make _build_snap

snap=$(ls doctl_*_amd64.snap)

Expand Down

0 comments on commit cd4ee91

Please sign in to comment.