blob: 6e2dcd020c0932bc9b0348a2b938b340f11a7b5e [file] [log] [blame]
Jiri Broulik4ea221c2018-04-10 13:48:06 +02001#!/bin/bash -xe
2
3FORMULA_VERSION=${FORMULA_VERSION:-testing}
4APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"}
5MASTER=`salt-key | grep cfg01`
6
7salt-key
8
9salt-call -t 5 --retcode-passthrough reclass.validate_pillar
10
11echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list
12apt-get update
13apt-get install salt-formula* -y
14salt-call saltutil.refresh_pillar
15salt-call saltutil.sync_all
16salt-call -t 5 --retcode-passthrough --no-color state.sls salt
17salt-call -t 5 --retcode-passthrough --no-color state.sls linux.system.repo,linux.system.package,linux.system.directory,linux.system.config
18salt-call -t 5 --retcode-passthrough --no-color state.sls linux.network
19salt-call -t 5 --retcode-passthrough --no-color state.sls git.server
20salt-call -t 5 --retcode-passthrough --no-color state.sls postgresql
21salt-call -t 5 --no-color state.sls maas
22# will not be needed with new maas formula
23apt-get install simplestreams -y
24sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg http://images.maas.io/ephemeral-v3/daily/ /var/www/html/maas/images/ephemeral-v3/daily 'arch=amd64' 'release~(xenial)' --max=1
25
26salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.master
27sleep 60
28salt-call -t 5 --no-color state.sls jenkins.client.plugin
29systemctl restart jenkins
30sleep 60
31# Jenkins Mirantis theme
32git clone https://github.com/Mirantis/docker-jenkins.git
33cp -r docker-jenkins/theme /var/lib/jenkins/userContent
34chown -R jenkins:jenkins /var/lib/jenkins/userContent/*
35# finish Jenkins setup
36salt-call -t 5 --no-color state.sls jenkins.client.plugin
37systemctl restart jenkins
38sleep 60
39salt-call -t 5 --no-color state.sls jenkins.client
40systemctl restart jenkins
41sleep 60
42salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.client
43