Skip to content

Instantly share code, notes, and snippets.

Created April 30, 2020 21:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save goneri/9b4664d99483c1899ff6ae5c35b03435 to your computer and use it in GitHub Desktop.
deploy a all-in-one Zuul with Windmill
set -eux
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/
source venv/bin/activate
pip install ansible
for repo in windmill-ops windmill windmill-backup windmill-config; do
[ -d ~/src/${repo} ] || git clone${repo} ~/src/${repo}
cd ~/src/${repo}
pip install -r requirements.txt
[ -f ./tools/ ] && ./tools/ --force
cd ~/src/
git fetch refs/changes/52/724152/10 && git cherry-pick FETCH_HEAD
cd ~/src/
git fetch refs/changes/15/723915/7 && git cherry-pick FETCH_HEAD
git clone
mkdir -p ~/.ansible/roles/windmill.boto3
cd ~/.ansible/roles/windmill.boto3
git init
git pull refs/changes/83/724683/2
#find ~/.ansible/roles -name requirements.txt|xargs -n1 -r pip install -r
cp src/ ~/.ansible.cfg
[ -d ~/.config/windmill ] || cp -r src/ ~/.config/windmill
mkdir -p ~/bastion/root/.ssh/
[ -f ~/.ssh/id_rsa ] || ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -P ""
cat ~/.ssh/ >> ~/.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
cp ~/bastion/root/.ssh/known_hosts.j2 ~/.ssh/known_hosts
for repo in windmill; do
cd ~/src/${repo}
ANSIBLE_FORCE_COLOR=1 ANSIBLE_ANY_ERRORS_FATAL=1 ansible-playbook -v playbooks/site.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment