appVersion: latest type: install id: rocket-chat version: 1.7 name: Rocket.Chat baseUrl: https://raw.githubusercontent.com/jelastic-jps/rocket-chat/master logo: /images/rocket.png?_r=${fn.random} homepage: https://rocket.chat/ globals: db_password: ${fn.password} rocket_chat_version: "4.3.0" targetRegions: type: vz7 categories: - apps/dev-and-admin-tools - apps/collaboration description: text: /texts/description.md short: Rocket.Chat is the leading open source team chat software solution nodes: - cloudlets: 16 nodeGroup: cp image: rocket.chat:${globals.rocket_chat_version} links: nosqldb:db startServiceOnCreation: false - cloudlets: 16 nodeGroup: nosqldb nodeType: mongodb tag: "4.0.2" count: 3 password: ${globals.db_password} cluster: password: ${globals.db_password} onInstall: - adjust-env-vars - api: env.control.ExecDockerRunCmd nodeId: ${nodes.cp.first.id} - cmd[cp]: while [[ $(curl -o /dev/null -s -w "%{http_code}\n" http://127.0.0.1:3000) != 200 ]] ; do sleep 3; done onAfterClone: - adjust-env-vars onAfterStart: - cmd [${nodes.nosqldb.first.id}]: |- counter=0 while true do counter=$((counter+1)) resp=$(mongo -u admin -p ${globals.db_password} admin --eval 'rs.status()') [[ $resp == *"health\" : 0"* ]] && { sleep 3; } || { echo "cluster is configured"; exit 0; } [[ "$counter" -gt 10 ]] && { echo "cluster is not configured"; exit 0; } done - if (response.out == "cluster is not configured"): script: |- return { result: 2, type: "warning", message: "Mongo cluster is not configured. Please check cluster configuration. [More details](https://jelastic.com/blog/mongodb-auto-clustering/)" }; - cmd [cp]: |- service jelinit restart while [[ $(curl -o /dev/null -s -w "%{http_code}\n" http://127.0.0.1:3000) != 200 ]] ; do sleep 3; done actions: adjust-env-vars: api[cp]: env.control.AddContainerEnvVars vars: ROOT_URL: http://${env.domain} JELASTIC_EXPOSE: 3000 MONGO_OPLOG_URL: "mongodb://admin:${globals.db_password}@${nodes.nosqldb[0].address}:27017,${nodes.nosqldb[1].address}:27017,${nodes.nosqldb[2].address}:27017/local?authSource=admin&replicaSet=rs0" MONGO_URL: "mongodb://admin:${globals.db_password}@${nodes.nosqldb[0].address}:27017,${nodes.nosqldb[1].address}:27017,${nodes.nosqldb[2].address}:27017/rocketchat?authSource=admin&replicaSet=rs0&w=majority" success: /texts/success.md