Skip to content

Instantly share code, notes, and snippets.

@kooba
Created February 1, 2019 12:13
Show Gist options
  • Save kooba/ad27682f4c0c3315512738ce6aa81af7 to your computer and use it in GitHub Desktop.
Save kooba/ad27682f4c0c3315512738ce6aa81af7 to your computer and use it in GitHub Desktop.
Development in the Cloud
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