Skip to content

Commit

Permalink
chore(*): go module cleanup (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrynhard authored Oct 4, 2018
1 parent fbc195c commit 4aaf049
Show file tree
Hide file tree
Showing 1,693 changed files with 102 additions and 396,916 deletions.
30 changes: 17 additions & 13 deletions .conform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ script:
pipeline:
stages:
- src
- test
- build

stages:
src:
tasks:
- src
test:
artifacts:
- source: /src/github.com/autonomy/conform/coverage.txt
Expand All @@ -90,10 +94,7 @@ stages:
tasks:
binary:
template: |
FROM golang:1.11.1 AS {{ .Docker.CurrentStage }}
WORKDIR /src/{{ index .Variables "gitRepository" }}
COPY ./ ./
ENV CGO_ENABLED 0
FROM autonomy/conform:src AS {{ .Docker.CurrentStage }}
{{ if and .Git.IsClean .Git.IsTag }}
RUN go build -o {{ index .Variables "binaryPath" }} -ldflags "-X \"{{ index .Variables "gitRepository" }}/cmd.Tag={{ trimAll "v" .Git.Tag }}\" -X \"{{ index .Variables "gitRepository" }}/cmd.SHA={{ .Git.SHA }}\" -X \"{{ index .Variables "gitRepository" }}/cmd.Built={{ .Built }}\""
{{ else if .Git.IsClean }}
Expand All @@ -103,23 +104,26 @@ tasks:
{{ end }}
test:
template: |
FROM golang:1.11.1 AS {{ .Docker.CurrentStage }}
ENV GO111MODULE auto
FROM autonomy/conform:src AS {{ .Docker.CurrentStage }}
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.1
WORKDIR /src/{{ index .Variables "gitRepository" }}
COPY ./ ./
RUN go mod download
RUN go mod verify
RUN chmod +x ./hack/test.sh
RUN ./hack/test.sh --lint ./hack/golangci-lint.yaml
RUN ./hack/test.sh --unit
RUN ./hack/test.sh --coverage
src:
template: |
FROM golang:1.11.1 AS {{ .Docker.CurrentStage }}
ENV GO111MODULE on
ENV CGO_ENABLED 0
WORKDIR /src/{{ index .Variables "gitRepository" }}
COPY ./ ./
RUN go mod download
RUN go mod verify
image:
template: |
FROM alpine:3.6 AS {{ .Docker.CurrentStage }}
FROM alpine:3.8 AS {{ .Docker.CurrentStage }}
LABEL maintainer="{{ index .Variables "maintainer" }}"
RUN apk --update add bash \
&& rm -rf /var/cache/apk/*
RUN apk --no-cache add bash
COPY --from=binary {{ index .Variables "binaryPath" }} /bin
ENTRYPOINT ["conform"]
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
!main.go
!pkg
!scripts
!vendor
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
coverage.txt
vendor
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: generic

install:
- mkdir -p $HOME/goroot
- curl -L https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz | tar -xz --strip-components=1 -C $HOME/goroot
- curl -L https://storage.googleapis.com/golang/go1.11.linux-amd64.tar.gz | tar -xz --strip-components=1 -C $HOME/goroot
- export GOROOT=$HOME/goroot
- export GOPATH=$HOME/gopath
- export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
Expand All @@ -19,8 +19,8 @@ install:
- 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) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
- go get github.com/autonomy/conform
- sudo apt-get -y install docker-ce=18.06.1~ce~3-0~ubuntu
- GO111MODULE=on go get github.com/autonomy/conform

script:
- conform enforce
Expand Down
256 changes: 0 additions & 256 deletions Gopkg.lock

This file was deleted.

Loading

0 comments on commit 4aaf049

Please sign in to comment.