deploy a all-in-one Zuul with Windmill
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
# https://virt-lightning.org/ | |
vl fetch ubuntu-18.04 | |
vl start --memory 2048 ubuntu-18.04 | |
target=$(vl status| awk '/ubuntu-1804/ {print$4}') | |
ssh $target sudo chsh -s /bin/bash goneri | |
ssh $target sudo apt update | |
# My stuff | |
ssh $target sudo apt install -y silversearcher-ag | |
ssh $target sudo apt install -y virtualenv python3-virtualenv git | |
ssh $target python3 -m virtualenv -p python3 venv | |
ssh $target ' | |
mkdir -p ~/.config ~/src/opendev.org/windmill | |
source venv/bin/activate | |
pip install ansible | |
for repo in windmill-ops windmill windmill-backup windmill-config; do | |
[ -d ~/src/opendev.org/windmill/${repo} ] || git clone https://opendev.org/windmill/${repo} ~/src/opendev.org/windmill/${repo} | |
( | |
cd ~/src/opendev.org/windmill/${repo} | |
pip install -r requirements.txt | |
[ -f ./tools/install_roles.sh ] && ./tools/install_roles.sh --force | |
) | |
done | |
( | |
cd ~/src/opendev.org/windmill/windmill-config | |
git fetch https://review.opendev.org/windmill/windmill-config refs/changes/52/724152/10 && git cherry-pick FETCH_HEAD | |
cd ~/src/opendev.org/windmill/windmill | |
git fetch https://review.opendev.org/windmill/windmill refs/changes/15/723915/7 && git cherry-pick FETCH_HEAD | |
git clone https://opendev.org/windmill/ansible-role-boto3 | |
mkdir -p ~/.ansible/roles/windmill.boto3 | |
cd ~/.ansible/roles/windmill.boto3 | |
git init | |
git pull https://review.opendev.org/windmill/ansible-role-boto3 refs/changes/83/724683/2 | |
) | |
#find ~/.ansible/roles -name requirements.txt|xargs -n1 -r pip install -r | |
cp src/opendev.org/windmill/windmill-config/ansible/ansible.cfg ~/.ansible.cfg | |
[ -d ~/.config/windmill ] || cp -r src/opendev.org/windmill/windmill-config ~/.config/windmill | |
mkdir -p ~/bastion/root/.ssh/ | |
[ -f ~/.ssh/id_rsa ] || ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -P "" | |
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
for i in 0 1 2 3 4 5 6 7 8 9; do | |
ssh-keyscan -H 127.0.${i}.1 >> ~/bastion/root/.ssh/known_hosts.j2 | |
done | |
cp ~/bastion/root/.ssh/known_hosts.j2 ~/.ssh/known_hosts | |
for repo in windmill; do | |
cd ~/src/opendev.org/windmill/${repo} | |
ANSIBLE_FORCE_COLOR=1 ANSIBLE_ANY_ERRORS_FATAL=1 ansible-playbook -v playbooks/site.yaml | |
done | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment