Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
148 lines (127 sloc) 3.49 KB
# Copyright 2017 Google Inc. All Rights Reserved.
#
# 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.
#
# Google Cloud Builder CI configuration
#
steps:
#
# Creates the initial make + docker build platform
#
- name: "ubuntu"
args: ["bash", "-c", "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build"]
- name: "gcr.io/cloud-builders/docker"
args: ['build', '-f', 'Dockerfile.build', '-t', 'make-docker', '.'] # we need docker and make to run everything.
- name: "make-docker"
id: make-docker
dir: "build"
args: ["pull-build-image"] # pull the build image if it exists
#
# build the e2e test runner
#
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-f', 'Dockerfile', '-t', 'e2e-runner', '.']
dir: 'build/e2e-image'
id: build-e2e
waitFor: ['-']
#
# Runs the linter -- but also builds the build image, if not able to download
#
- name: "make-docker"
id: lint
waitFor:
- make-docker
dir: "build"
args: ["lint"] # pull the build image if it exists
#
# Run the all the automated tests (except e2e) in parallel
#
- name: "make-docker"
id: tests
waitFor:
- lint
dir: "build"
args: [ "-j", "3", "test" ]
#
# Push the build image, can run while we do other things.
#
- name: "make-docker"
waitFor:
- lint
dir: "build"
args: ["push-build-image"] # push the build image (which won't do anything if it's already there)
#
# Build all the images and sdks, and push them up to the repository
#
- name: "make-docker"
id: build
waitFor:
- lint
dir: "build"
args: [ "-j", "4", "build"]
- name: "make-docker"
id: push-images
waitFor:
- build
dir: "build"
args: [ "-j", "3", "push"]
#
# Site preview
#
- name: "make-docker" # build a preview of the website
id: site-static
waitFor:
- tests
dir: "build"
args: ["site-static-preview", "site-gen-app-yaml", "SERVICE=preview"]
- name: "ubuntu" # fake a new gopath
id: site-gopath
waitFor:
- site-static
args: ["bash", "-c", "mkdir -p ./go/src && mv ./site ./go/src && cp -r ./vendor/gopkg.in ./go/src && ls -a ./go/src/site"]
- name: "gcr.io/cloud-builders/gcloud" # deploy the preview of the website
id: "deploy-site-static"
waitFor:
- site-gopath
dir: "go/src/site"
args: ["app", "deploy", ".app.yaml", "--no-promote", "--version=$SHORT_SHA"]
env:
- GOPATH=/workspace/go
#
# Run the e2e tests
#
- name: 'e2e-runner'
waitFor:
- push-images
- build-e2e
#
# Zip up artifacts and push to storage
#
- name: 'gcr.io/cloud-builders/gsutil'
waitFor:
- build
- tests
dir: "sdks/cpp/.build"
args: ['cp', '*.tar.gz', 'gs://agones-artifacts/cpp-sdk']
- name: 'gcr.io/cloud-builders/gsutil'
waitFor:
- build
- tests
dir: "cmd/sdk-server/bin"
args: ['cp', '*.zip', 'gs://agones-artifacts/sdk-server']
tags: ['ci']
timeout: "1h"
images: ['gcr.io/$PROJECT_ID/agones-controller', 'gcr.io/$PROJECT_ID/agones-sdk', 'gcr.io/$PROJECT_ID/agones-ping']
logsBucket: "gs://agones-build-logs"
options:
machineType: 'N1_HIGHCPU_8'
You can’t perform that action at this time.