Skip to content

Commit d577f39

Browse files
isserranopleshakov
authored andcommitted
Don't push container when pr from fork (nginx#202)
* Adding build status to Readme * Adding build status to Readme * Building only in nginxinc, testing when fork pr * All gcloud ops relay on not coming from fork * Printing repo slug * Building also when it is a push * Using TRAVIS_PULL_REQUEST_SLUG * Moving to right directory for make test * Fixing Readme * Go version to 1.9 * Fixing Readme
1 parent eaa30a3 commit d577f39

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.travis.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ sudo: required
33
services:
44
- docker
55
go:
6-
- 1.8.3
6+
- 1.9
77
script:
8-
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ] ; then export VERSION=pr-${TRAVIS_PULL_REQUEST}-${TRAVIS_BUILD_NUMBER};
8+
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
9+
export VERSION=pr-${TRAVIS_PULL_REQUEST}-${TRAVIS_BUILD_NUMBER};
910
else export VERSION=${TRAVIS_COMMIT} ; fi
1011
- echo "Building ingress controller VERSION:${VERSION}"
11-
- cd nginx-controller && make clean && make PREFIX=gcr.io/nginx-ic-dev/nginx-ingress
12-
VERSION=${VERSION} BUILD_IN_CONTAINER=0 PUSH_TO_GCR=1
12+
- if [ "${TRAVIS_PULL_REQUEST_SLUG}" == "nginxinc/kubernetes-ingress" ] || [ "${TRAVIS_PULL_REQUEST_SLUG}" == "" ]; then
13+
cd nginx-controller && make clean &&
14+
make PREFIX=gcr.io/nginx-ic-dev/nginx-ingress VERSION=${VERSION} BUILD_IN_CONTAINER=0 PUSH_TO_GCR=1 ;
15+
else echo "Not building PR from forks. Only testing" && cd nginx-controller && make test BUILD_IN_CONTAINER=0 ; fi
1316
before_install:
14-
- openssl aes-256-cbc -K $encrypted_6e02d569a8a7_key -iv $encrypted_6e02d569a8a7_iv
15-
-in client-secret.json.enc -out client-secret.json -d
16-
- gcloud auth activate-service-account --key-file client-secret.json
17-
- gcloud config set project nginx-ic-dev
17+
- echo "Repo Slug:${TRAVIS_PULL_REQUEST_SLUG}"
18+
- if [ "${TRAVIS_PULL_REQUEST_SLUG}" == "nginxinc/kubernetes-ingress" ] || [ "${TRAVIS_PULL_REQUEST_SLUG}" == "" ]; then
19+
openssl aes-256-cbc -K $encrypted_6e02d569a8a7_key -iv $encrypted_6e02d569a8a7_iv
20+
-in client-secret.json.enc -out client-secret.json -d &&
21+
gcloud auth activate-service-account --key-file client-secret.json &&
22+
gcloud config set project nginx-ic-dev ; fi

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
[![Build Status](https://travis-ci.org/nginxinc/kubernetes-ingress.svg?branch=master)](https://travis-ci.org/isserrano/kubernetes-ingress)
3+
14
# NGINX Ingress Controller
25

36
This repo provides an implementation of an Ingress controller for NGINX and NGINX Plus. This implementation is different from the NGINX Ingress controller in [kubernetes/ingress repo](https://github.com/kubernetes/ingress).

0 commit comments

Comments
 (0)