Created
February 1, 2019 12:13
-
-
Save kooba/ad27682f4c0c3315512738ce6aa81af7 to your computer and use it in GitHub Desktop.
Development in the Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Job, Group } = require('brigadier'); | |
const deployDependencies = async (namespace) => { | |
const postgresql = new Job('postgresql', 'jakubborys/ditc-brigade-worker:latest'); | |
postgresql.storage.enabled = false; | |
postgresql.imageForcePull = true; | |
postgresql.tasks = [ | |
'cd /src', | |
`helm upgrade ${namespace}-postgresql charts/postgresql \ | |
--install --namespace=${namespace} \ | |
--set fullnameOverride=postgresql \ | |
--set postgresqlPassword=password \ | |
--set resources.requests.cpu=50m \ | |
--set resources.requests.memory=156Mi \ | |
--set readinessProbe.initialDelaySeconds=60 \ | |
--set livenessProbe.initialDelaySeconds=60;`, | |
]; | |
const rabbitMQ = new Job('rabbitmq', 'jakubborys/ditc-brigade-worker:latest'); | |
rabbitMQ.storage.enabled = false; | |
rabbitMQ.imageForcePull = true; | |
rabbitMQ.tasks = [ | |
`helm upgrade ${namespace}-rabbitmq stable/rabbitmq-ha \ | |
--install --namespace=${namespace} \ | |
--set fullnameOverride=rabbitmq \ | |
--set image.tag=3.7-management-alpine \ | |
--set replicaCount=1 \ | |
--set persistentVolume.enabled=true \ | |
--set updateStrategy=RollingUpdate \ | |
--set rabbitmqPassword=password \ | |
--set rabbitmqMemoryHighWatermarkType=relative \ | |
--set rabbitmqMemoryHighWatermark=0.5`, | |
]; | |
const redis = new Job('redis', 'jakubborys/ditc-brigade-worker:latest'); | |
redis.storage.enabled = false; | |
redis.imageForcePull = true; | |
redis.tasks = [ | |
`helm upgrade ${namespace}-redis stable/redis \ | |
--install --namespace ${namespace} \ | |
--set fullnameOverride=redis \ | |
--set password=password \ | |
--set cluster.enabled=false`, | |
]; | |
const telepresence = new Job( | |
'telepresence', 'jakubborys/ditc-brigade-worker:latest', | |
); | |
telepresence.storage.enabled = false; | |
telepresence.imageForcePull = true; | |
telepresence.tasks = [ | |
'cd /src', | |
`helm upgrade ${namespace}-telepresence charts/telepresence \ | |
--install --namespace ${namespace}`, | |
]; | |
await Group.runAll([postgresql, rabbitMQ, redis, telepresence]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment