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