-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathwercker.yml
56 lines (49 loc) · 2 KB
/
wercker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
build:
box: python:2.7
steps:
# Check that our application's tests are passing. Since this is a python
# application, our entry script will also install the application's dependencies
# with Virtualenv
- script:
name: Nose tests
code: bin/tests
# Take our tested application revision and its dependencies, bake it in to a
# Docker image, and push to GCR.
- internal/docker-push:
entrypoint: bin/get_ip
cmd: 0.0.0.0 8080
working-dir: $WERCKER_ROOT
tag: $WERCKER_GIT_COMMIT
ports: "8080"
username: _json_key
password: $GCP_KEY_JSON
repository: $GCR_TAG
registry: $GCR_HOST
deploy-to-kubernetes:
box: python:2.7
steps:
# https://github.com/wercker/step-bash-template
# This Wercker step will look for files in our repo with a .template extension.
# It will expand any environment variables in those files, then remove the
# template extension.
- bash-template
# The step above should leave us with a Kubernetes service and deployment yml files.
# We'll create a directory to move them to.
- script:
name: Prepare Kubernetes files
code: |
mkdir $WERCKER_OUTPUT_DIR/kubernetes
mv kubernetes_*.yml $WERCKER_OUTPUT_DIR/kubernetes
# Since we're using GKE, we'll use a fork of the kubectl step that supports
# GKE service account authentication. We need to pass some GKE specific configuration
# to ensure we can authenticate, then point kubectl at the directory containing our
# Kubernetes configuration.
# `apply` is a good command to use here, as it'll create Kubernetes entities if they are missing.
- riceo/kubectl:
name: deploy to kubernetes
server: $KUBERNETES_MASTER
gcloud-key-json: $GCP_KEY_JSON
gke-cluster-name: $GKE_CLUSTER_NAME
gke-cluster-zone: $GKE_CLUSTER_ZONE
gke-cluster-project: $GKE_CLUSTER_PROJECT
command: apply -f $WERCKER_OUTPUT_DIR/kubernetes/