Skip to content

Commit f9ce51d

Browse files
committed
Push container on release
1 parent 045246c commit f9ce51d

File tree

2 files changed

+7
-25
lines changed

2 files changed

+7
-25
lines changed

.travis.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sudo: required
22
language: go
33

44
go:
5-
- 1.11.x
5+
- 1.12.x
66

77
services:
88
- docker
@@ -12,36 +12,16 @@ addons:
1212
packages:
1313
- docker-ce
1414

15-
before_install:
16-
- make dep
17-
# - go get sigs.k8s.io/kind
18-
# - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
19-
# - chmod +x ./kubectl
20-
# - kind create cluster
21-
# - export KUBECONFIG="$(kind get kubeconfig-path --name="1")"
22-
# - ./kubectl cluster-info
23-
# - docker build -t podinfo:test -f Dockerfile.ci .
24-
# - ./kubectl run podinfo --image=podinfo:test --port=9898 --image-pull-policy=Never -- ./podinfo --port=9898
25-
# - sleep 5
26-
# - ./kubectl describe deployment podinfo
27-
# - ./kubectl describe po
28-
2915
script:
30-
- make test
31-
- make build docker-build
16+
- make build-container
3217

3318
after_success:
34-
- if [ -z "$DOCKER_USER" ]; then
35-
echo "PR build, skipping Docker Hub push";
19+
- if [ -z "$TRAVIS_TAG" ]; then
20+
echo "Not a release, skipping container push";
3621
else
3722
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin;
38-
make docker-push;
39-
fi
40-
- if [ -z "$QUAY_USER" ]; then
41-
echo "PR build, skipping Quay push";
42-
else
4323
echo $QUAY_PASS | docker login -u $QUAY_USER --password-stdin quay.io;
44-
make quay-push;
24+
make push-container;
4525
fi
4626

4727
deploy:

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COPY . .
88

99
RUN GOPROXY=https://proxy.golang.org go mod download
1010

11+
RUN go test -v -race ./...
12+
1113
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
1214
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
1315
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${GIT_COMMIT}" \

0 commit comments

Comments
 (0)