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