-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bad tag detection and setup CI (#2)
- Loading branch information
1 parent
0c55035
commit 426abe1
Showing
12 changed files
with
194 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
.git | ||
.gitignore | ||
conform.yaml | ||
coverage.txt | ||
Dockerfile | ||
docs | ||
examples | ||
LICENSE | ||
Makefile | ||
README.md | ||
* | ||
!cmd | ||
!conform | ||
!Gopkg* | ||
!main.go | ||
!scripts | ||
!vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
coverage.txt | ||
Dockerfile | ||
docs/build | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
sudo: required | ||
dist: trusty | ||
|
||
language: go | ||
|
||
go: | ||
- 1.8.3 | ||
|
||
before_install: | ||
- sudo apt-get -y remove docker docker-engine | ||
- sudo apt-get -y update | ||
- sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common | ||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge" | ||
- sudo apt-get update | ||
- sudo apt-get -y install docker-ce | ||
- go get -u github.com/autonomy/conform | ||
|
||
script: | ||
- conform enforce test | ||
- conform enforce image | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
|
||
deploy: | ||
provider: script | ||
script: scripts/deploy.sh | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,23 +12,28 @@ scripts: | |
BUILDDEPS=( github.com/golang/dep/cmd/dep ) | ||
for b in ${BUILDDEPS[@]}; do | ||
echo "Installing $b" | ||
go get -u $b | ||
go get $b | ||
done | ||
test_artifacts: | | ||
cp_coverage_report: | | ||
#!/bin/bash | ||
set -e | ||
docker run --rm -i --volume $(pwd):/out ${CONFORM_IMAGE} cp coverage.txt /out | ||
if [ ! -f coverage.txt ]; then | ||
echo "No coverage report found." | ||
exit 1 | ||
fi | ||
deploy: | | ||
#!/bin/bash | ||
set -e | ||
if [ ${CONFORM_IS_DIRTY} == "true" ]; then | ||
echo "The working tree is dirty, aborting ..." | ||
echo "The working tree is dirty." | ||
exit 1 | ||
fi | ||
|
@@ -45,6 +50,7 @@ scripts: | |
fi | ||
clean: | | ||
cat .gitignore | while read line; do rm -rf "$line"; done | ||
dep ensure | ||
dep prune | ||
|
@@ -56,7 +62,6 @@ templates: | |
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /conform -a -ldflags "-X \"github.com/autonomy/conform/version.Tag={{ trimAll "v" .GitInfo.Tag }}\" -X \"github.com/autonomy/conform/version.SHA={{ .GitInfo.SHA }}\" -X \"github.com/autonomy/conform/version.Built={{ .Built }}\"" | ||
test: | | ||
FROM golang:1.8.3 as test | ||
MAINTAINER Andrew Rynhard <[email protected]> | ||
WORKDIR /go/src/github.com/autonomy/conform | ||
RUN go get -u github.com/golang/lint/golint | ||
COPY --from=build /go/src/github.com/autonomy/conform . | ||
|
@@ -76,26 +81,20 @@ rules: | |
- build | ||
|
||
test: | ||
before: | ||
- init | ||
- clean | ||
templates: | ||
- build | ||
- test | ||
after: | ||
- test_artifacts | ||
- cp_coverage_report | ||
|
||
image: | ||
templates: | ||
- build | ||
- image | ||
|
||
all: | ||
before: | ||
- init | ||
- clean | ||
templates: | ||
- build | ||
- test | ||
- image | ||
|
||
deploy: | ||
templates: | ||
- build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.