Skip to content

Commit

Permalink
Creating a Makefile for global build (envoyproxy#617)
Browse files Browse the repository at this point in the history
* Creating a Makefile for global build

* Remove unecessary env and calls

* Update date on license

* Fix Jenkinsfile
  • Loading branch information
sebastienvas authored Nov 2, 2017
1 parent a05c813 commit 2b6b708
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 20 deletions.
33 changes: 13 additions & 20 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ mainFlow(utils) {
// Proxy does build work correctly with Hazelcast.
// Must use .bazelrc.jenkins
bazel.setVars('', '')
env.HUB = 'gcr.io/istio-testing'
env.ARTIFACTS_DIR = "gs://istio-artifacts/proxy/${GIT_SHA}/artifacts/debs"
}
if (utils.runStage('PRESUBMIT')) {
presubmit(gitUtils, bazel)
Expand All @@ -29,39 +31,30 @@ mainFlow(utils) {
def presubmit(gitUtils, bazel) {
buildNode(gitUtils) {
stage('Code Check') {
sh('script/check-license-headers')
sh('script/check-style')
sh('make check')
}
bazel.updateBazelRc()
stage('Bazel Fetch') {
bazel.fetch('-k //...')
}
stage('Bazel Build') {
bazel.build('//...')
sh('make build')
}
stage('Bazel Tests') {
bazel.test('//...')
}
stage('Push Test Binary') {
sh 'script/release-binary'
sh('make test')
}
stage('Push Debian Package') {
sh "script/push-debian.sh -c dbg -p gs://istio-artifacts/proxy/${GIT_SHA}/artifacts/debs"
stage('Create and push artifacts') {
sh('script/release-binary')
sh('script/release-docker')
sh('make artifacts')
}
}
}

def postsubmit(gitUtils, bazel, utils) {
buildNode(gitUtils) {
bazel.updateBazelRc()
stage('Binary push') {
sh 'script/release-binary'
}
stage('Docker Push') {
sh 'script/release-docker'
}
stage('Push Debian Package') {
sh "script/push-debian.sh -c dbg -p gs://istio-artifacts/proxy/${GIT_SHA}/artifacts/debs"
stage('Create and push artifacts') {
sh('script/release-binary')
sh('script/release-docker')
sh('make artifacts')
}
}
}
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Copyright 2017 Istio Authors
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

SHELL := /bin/bash
LOCAL_ARTIFACTS_DIR ?= $(abspath artifacts)
ARTIFACTS_DIR ?= $(LOCAL_ARTIFACTS_DIR)
BAZEL_STARTUP_ARGS ?=
BAZEL_BUILD_ARGS ?=
BAZEL_TEST_ARGS ?=
HUB ?=
TAG ?=

build:
@bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //...

clean:
@bazel clean

test:
@bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) //...

check:
@script/check-license-headers
@script/check-style

artifacts: build
@script/push-debian.sh -c opt -p $(ARTIFACTS_DIR)

.PHONY: build clean test check artifacts

0 comments on commit 2b6b708

Please sign in to comment.