Skip to content

Commit

Permalink
Merge pull request #15 from mikaint/run_with_docker
Browse files Browse the repository at this point in the history
Run with docker
  • Loading branch information
psampaz committed Aug 12, 2019
2 parents 055a7b3 + edd8686 commit 88f29d4
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 20 deletions.
44 changes: 25 additions & 19 deletions .travis.yml
@@ -1,22 +1,28 @@
language: go

go:
- "1.11.x"
- "1.12.x"

services:
- docker
os:
- linux
- osx

before_script:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0

script:
- golangci-lint run
- go test ./... -race -coverprofile=coverage.txt -covermode=atomic
- go install
- mkdir hugo && cd hugo && wget https://raw.githubusercontent.com/gohugoio/hugo/v0.53/go.mod
- env GO111MODULE=on go list -u -m -json all | go-mod-outdated

after_success:
- bash <(curl -s https://codecov.io/bash)
language: go
go:
- 1.11.x
- 1.12.x
jobs:
include:
-
after_success:
- "bash <(curl -s https://codecov.io/bash)"
before_script:
- "curl sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0"
script:
- "golangci-lint run"
- "go test ./... -race -coverprofile=coverage.txt -covermode=atomic"
- "go install"
- "mkdir hugo && cd hugo && wget https://raw.githubusercontent.com/gohugoio/hugo/v0.53/go.mod"
- "env GO111MODULE=on go list -u -m -json all | go-mod-outdated"
stage: "testing"
-
script:
- "docker build -t psampaz/go-mod-outdated ."
- "go list -u -m -json all | docker run --rm -i psampaz/go-mod-outdated"
stage: "docker"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [0.4.0] 2019-08-12
### Added
- Run go-mod-outdated using Docker

## [0.3.0] 2019-05-01
### Added
- Flag '-ci' to exit with non-zero exit code when an outdated dependency is found
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile
@@ -0,0 +1,10 @@
FROM golang:1.12.7-alpine3.10
RUN apk add --no-cache git
WORKDIR /home
COPY ./ .
RUN CGO_ENABLED=0 GOOS=linux go build -o go-mod-outdated .

FROM scratch
WORKDIR /home/
COPY --from=0 /home/go-mod-outdated .
ENTRYPOINT ["./go-mod-outdated"]
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -73,7 +73,15 @@ If you want to see only the direct depedencies that have updates run
```
go list -u -m -json all | go-mod-outdated -update -direct
```

### Docker
In the folder where your go.mod lives run
```
go list -u -m -json all | docker run -i psampaz/go-mod-outdated
```
To use parameters just append
```
go list -u -m -json all | docker run -i psampaz/go-mod-outdated -update
```
### CI pipelines

Using the -ci flag will the make the command exit with none zero code, breaking this way your ci pipelines.
Expand Down

0 comments on commit 88f29d4

Please sign in to comment.