Skip to content

Commit 64ea9d8

Browse files
author
Jody McIntyre
committed
Add stage deployment playbooks & watch_deployment
1 parent 08c7bcb commit 64ea9d8

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

deployment/playbook_stage.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- hosts: localhost
2+
gather_facts: False
3+
vars:
4+
cluster: imageserver-stage
5+
zone: us-central1-a
6+
roles:
7+
- common
8+
- update
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: Get credentials for cluster
2+
local_action: command gcloud container clusters get-credentials {{ cluster }} --zone {{ zone }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- name: Determine current sha1 to deploy
2+
local_action: command git rev-parse HEAD
3+
register: sha1
4+
- set_fact: sha1_to_deploy="{{ sha1.stdout }}"
5+
- debug: msg="Deploying rev {{ sha1_to_deploy }}"
6+
7+
- name: Ensure image exists
8+
local_action: shell gcloud container images list-tags gcr.io/jody-imageserver-test/imageserver |grep -q {{ sha1_to_deploy }}
9+
10+
- name: Rollout new image
11+
local_action: command kubectl set image deployments/imageserver imageserver-app=gcr.io/jody-imageserver-test/imageserver:{{ sha1_to_deploy }}

deployment/tools/watch_deployment

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
kubectl rollout status deployments/imageserver

0 commit comments

Comments
 (0)