Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Cleanup travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
errm committed Jun 26, 2018
1 parent 46b56c8 commit e0ed208
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 53 deletions.
20 changes: 3 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,16 @@ language: go
go:
- "1.10.x"

addons:
apt:
packages:
- rpm
- upx

services:
- docker

before_script:
- openssl aes-256-cbc -K $encrypted_189aefeda93d_key -iv $encrypted_189aefeda93d_iv -in .travis/ekstrap.asc.enc -out .travis/ekstrap.asc -d
- gpg --import .travis/ekstrap.asc
- make install-linter

script:
- make all lint
before_script: bash .travis/setup.sh

after_success:
- test -n "$TRAVIS_TAG" && docker login -u=errm -p="$DOCKER_PASSWORD"
script: make

deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
script: bash .travis/release.sh
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
22 changes: 22 additions & 0 deletions .travis/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -euo pipefail

GORELEASER_VERSION="0.79.0"
GORELEASER_CHECKSUM="8b3f62f582bddde2a29b1d33baaf92b66281312c2fd8a3d38ad2bac8e35c14dd"

export DEBIAN_FRONTEND=noninteractive

docker login -u=errm -p="$DOCKER_PASSWORD"

sudo -E apt-get -yq update
sudo -E apt-get -yq \
--no-install-suggests \
--no-install-recommends \
--force-yes install rpm upx

curl -LO "https://github.com/goreleaser/goreleaser/releases/download/v$GORELEASER_VERSION/goreleaser_amd64.deb"
echo "echo $GORELEASER_CHECKSUM goreleaser_amd64.deb" | sha256sum --check --status -
sudo apt install ./goreleaser_amd64.deb

make release
7 changes: 7 additions & 0 deletions .travis/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -euo pipefail

openssl aes-256-cbc -K $encrypted_189aefeda93d_key -iv $encrypted_189aefeda93d_iv -in .travis/ekstrap.asc.enc -out .travis/ekstrap.asc -d
gpg --import .travis/ekstrap.asc
make install-linter
23 changes: 0 additions & 23 deletions Dockerfile.release

This file was deleted.

19 changes: 6 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ BINARY_NAME=ekstrap
WORKDIR=/go/src/github.com/errm/ekstrap

GOMETALINTER = gometalinter ./...
DOCKER = /usr/bin/env docker
GORELEASER_VERSION = 0.77.2
GORELEASER_BUILD = $(DOCKER) build --rm -f Dockerfile.release --build-arg UID=$(shell id -u) --build-arg GORELEASER_VERSION=$(GORELEASER_VERSION) -t ekstrap-release:$(GORELEASER_VERSION) .
GORELEASER = $(DOCKER) run --rm --volume $$(pwd):$(WORKDIR) --env GITHUB_TOKEN=${GITHUB_TOKEN} ekstrap-release:$(GORELEASER_VERSION)
GORELEASER = goreleaser release --rm-dist --debug

all: test build
all: test lint build
build:
$(GOBUILD) -o $(BINARY_NAME) -v
compress: build
Expand All @@ -23,14 +20,10 @@ install-linter:
$(GOMETALINTER) --install
lint:
$(GOMETALINTER)

# The following targets enable local testing of goreleaser.
build-releaser: Dockerfile.release
$(GORELEASER_BUILD)
release: build-releaser .goreleaser.yml
$(GORELEASER) release --rm-dist --debug
snapshot: build-releaser .goreleaser.yml
$(GORELEASER) release --rm-dist --snapshot --debug
release: .goreleaser.yml
$(GORELEASER)
snapshot: .goreleaser.yml
$(GORELEASER) --snapshot

clean:
rm -rf \
Expand Down

0 comments on commit e0ed208

Please sign in to comment.