deis/example-guestbook-wercker

Name: example-guestbook-wercker

Owner: Deis

Description: A simple PHP app for Deis Workflow, with back-end and wercker integration

Created: 2016-04-19 12:09:58.0

Updated: 2017-05-10 21:22:07.0

Pushed: 2017-05-10 21:59:32.0

Homepage: https://deis.com

Size: 17

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Guestbook Example with Wercker integration

This example shows how to build a simple, multi-tier web application using Helm Classic, Deis Workflow and Wercker for Continuous Deployment

The example consists of:

The web frontend interacts with the Redis master API via JavaScript calls.

-

Prerequisites

This example requires a running Kubernetes cluster and you have installed Helm Classic, Deis Workflow and you have an account with Wercker.

-

Backend install with Helm Classic

1) We add the remote repo to Helm Classic:

lmc up
lmc repo add demo-charts https://github.com/deis/demo-charts
lmc up

2) We install our back-end chart

lmc fetch demo-charts/redis-guestbook
lmc install redis-guestbook
Front-end install with deis cli

1) Create guestbook App:

is create guestbook --no-remote

Note: We are creating the App with --no-remote, as later one we are going to use docker image built by Wercker

2) Set env vars so the App knows where to connect to redis cluster:

is config:set GET_HOSTS_FROM=env REDIS_MASTER_SERVICE_HOST=redis-master.default REDIS_SLAVE_SERVICE_HOST=redis-slave.default -a guestbook
Set Continuous Deployment with Wercker

1) Fork the repo https://github.com/deis/example-guestbook-wercker.git to your Gihub account

2) Clone the repo:

t clone https://github.com/your_github_account/example-guestbook-wercker.git

3) Create a new Wercker App and connect to your App's Github repo

4) Under App's Settings->Environment variables create the values below:

ER_USERNAME: dockerhub or other hosted docker registry account name
ER_PASSWORD: your docker registry account password
ER_REPO: your docker repository e.g. your_docker_hub_user_name/wercker-demo-app
_CONTROLLER: Deis Workflow controller URL e.g. http://deis.example.com
_TOKEN: your Deis Workflow user token, which you can get from ~/.deis/client.json file

The Environment variables above will be used by Wercker App you have created reading pipeline steps from the wercker.yml in your App's repository

5) Make changes to your code, push to Github and Wercker will do the following:

ild the docker image
g it
sh to your docker registry repository
ll the new docker image on your remote Deis Workflow

-

With this example App you have learned how to set the multi-tier web application up using Helm Classic and Deis Workflow and then with Wercker's help to deploy your App to Deis Workflow


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.