Skip to content

Commit

Permalink
update release with manifest, monit, ctl, etc..
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Dec 6, 2018
1 parent 007490c commit e035114
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config/private.yml
blobs
dev_releases
releases/*.tgz
releases/**/*.tgz
.dev_builds
.final_builds/jobs/**/*.tgz
.final_builds/packages/**/*.tgz
.DS_Store
.idea
*.swp
*~
*#
#*
src/credhub-webui/credhub-webui-*.tgz
6 changes: 6 additions & 0 deletions get_blobs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
echo "Download blobs"
if [ ! -d src/credhub-webui ]; then
mkdir -p src/credhub-webui
fi
curl -L https://github.com/shreddedbacon/credhub-webui/releases/download/v0.0.1/credhub-webui-linux-0.0.1.tgz > src/credhub-webui/credhub-webui-linux-0.0.1.tgz
5 changes: 5 additions & 0 deletions jobs/credhub-webui/monit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
check process credhub-webui
with pidfile /var/vcap/sys/run/credhub-webui/pid
start program "/var/vcap/jobs/credhub-webui/bin/ctl start"
stop program "/var/vcap/jobs/credhub-webui/bin/ctl stop"
group vcap
21 changes: 19 additions & 2 deletions jobs/credhub-webui/spec
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
---
name: credhub-webui

templates: {}
templates:
ctl.erb: bin/ctl
ssl.cert.erb: ssl/ssl.cert
ssl.key.erb: ssl/ssl.key

packages:
- credhub-webui

properties: {}
properties:
credhub_server:
description: "ip or hostname and port of credhub server to target"
example: "https://192.168.50.6:8844"
cookie_key:
description: "Must be 16, 24 or 32 bytes long (AES-128, AES-192 or AES-256)"
default: "super-secret-key"
cookie_name:
description: "Name of the cookie to use"
default: "auth-cookie"
ssl:
certificate:
description: "Certificate to use for the front end"
private_key:
description: "Private key for the certificate"
40 changes: 40 additions & 0 deletions jobs/credhub-webui/templates/ctl.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

RUN_DIR=/var/vcap/sys/run/credhub-webui
LOG_DIR=/var/vcap/sys/log/credhub-webui
CERT_DIR=/var/vcap/jobs/credhub-webui/ssl
PIDFILE=${RUN_DIR}/pid

case $1 in

start)
set -ex
mkdir -p $RUN_DIR $LOG_DIR

chown -R vcap:vcap $RUN_DIR $LOG_DIR

echo $$ > $PIDFILE

cd /var/vcap/packages/credhub-webui

exec /var/vcap/packages/credhub-webui/credhub-webui \
-credhub-server "<%= p("credhub_server") %>" \
-cookie-key "<%= p("cookie_key") %>" \
-cookie-name "<%= p("cookie_name") %>" \
-ui-ssl-cert $CERT_DIR/ssl.cert \
-ui-ssl-key $CERT_DIR/ssl.key \
>> $LOG_DIR/server.stdout.log \
2>> $LOG_DIR/server.stderr.log

;;

stop)
kill -9 `cat $PIDFILE`
rm -f $PIDFILE

;;

*)
echo "Usage: ctl {start|stop}" ;;

esac
1 change: 1 addition & 0 deletions jobs/credhub-webui/templates/ssl.cert.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= p("ssl.certificate") %>
1 change: 1 addition & 0 deletions jobs/credhub-webui/templates/ssl.key.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= p("ssl.key") %>
49 changes: 49 additions & 0 deletions manifests/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: credhub-webui

releases:
- name: credhub-webui
version: latest

stemcells:
- os: ubuntu-trusty
alias: default
version: latest

instance_groups:
- name: web
instances: 1
stemcell: default
azs: [z1]
vm_type: default
persistent_disk_type: default
networks:
- name: default
jobs:
- name: credhub-webui
release: credhub-webui
properties:
credhub_server: "https://192.168.50.6:8844"
ssl:
certificate: ((credhub_webui_tls.certificate))
key: ((credhub_webui_tls.private_key))

variables:
#- name: credhub_webui_ca
# type: certificate
# options:
# is_ca: true
# common_name: credhub-webui.local
- name: credhub_webui_tls
type: certificate
options:
# ca: credhub_webui_ca
self_sign: true
common_name: credhub-webui.local
alternative_names: [localhost]

update:
canaries: 1
max_in_flight: 3
canary_watch_time: 30000-600000
update_watch_time: 5000-600000
3 changes: 1 addition & 2 deletions packages/credhub-webui/packaging
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
set -e

tar -zxf credhub-webui/credhub-webui-*.tgz \
-C ${BOSH_INSTALL_TARGET} \
--strip-components=1
-C ${BOSH_INSTALL_TARGET}

0 comments on commit e035114

Please sign in to comment.