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