annotate workers/bin/installInTemplate.sh @ 23:cc065b2a2543

more tweaks wrt getting H4 going
author Henry S. Thompson <ht@markup.co.uk>
date Wed, 31 Oct 2018 21:42:34 +0000
parents 9631fca89cc6
children db75ec542c66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
580221a17890 comment out a lot not needed for vmss
Henry S. Thompson <ht@markup.co.uk>
parents: 4
diff changeset
1 #!/bin/bash
23
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
2 sudo mkdir /var/data
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
3 sudo mount -t tmpfs -o size=8g tmpfs /var/data
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
4 sudo chmod og+w /var/data
4
56d8823c68e0 pretty much complete...
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
5 sudo apt-get -y install python3 parallel psmisc jq mercurial curl
56d8823c68e0 pretty much complete...
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
6 curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
56d8823c68e0 pretty much complete...
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
7 echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ jessie main" |\
56d8823c68e0 pretty much complete...
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
8 sudo tee /etc/apt/sources.list.d/azure-cli.list
56d8823c68e0 pretty much complete...
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
9 sudo apt-get -y --force-yes install apt-transport-https
56d8823c68e0 pretty much complete...
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
10 sudo apt-get -y update
56d8823c68e0 pretty much complete...
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
11 sudo apt-get -y install azure-cli
18
9631fca89cc6 F2-related stuff, and new experiment
Henry S. Thompson <ht@markup.co.uk>
parents: 14
diff changeset
12 if [ ! -d ~cc/.ssh ]
9631fca89cc6 F2-related stuff, and new experiment
Henry S. Thompson <ht@markup.co.uk>
parents: 14
diff changeset
13 then
23
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
14 if [ ! -d ~cc ]
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
15 then
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
16 sudo adduser --disabled-password --GECOS "CC master" cc
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
17 fi
18
9631fca89cc6 F2-related stuff, and new experiment
Henry S. Thompson <ht@markup.co.uk>
parents: 14
diff changeset
18 sudo su -c 'ssh-keygen -t rsa -N "" -f /home/cc/.ssh/id_rsa' cc
23
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
19 echo "$1" >> /home/cc/.ssh/authorized_keys
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
20 sudo su -c 'mkdir bin' cc
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
21 sudo su -c 'sed "5i # Unless login (in which case .profile will have done this), add ~/bin to PATH\
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
22 case $- in\
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
23 *l*) ;;\
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
24 *) export PATH=/home/cc/bin:$PATH ;;\
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
25 esac\
cc065b2a2543 more tweaks wrt getting H4 going
Henry S. Thompson <ht@markup.co.uk>
parents: 18
diff changeset
26 "' cc
18
9631fca89cc6 F2-related stuff, and new experiment
Henry S. Thompson <ht@markup.co.uk>
parents: 14
diff changeset
27 fi
14
c1c8275bd194 trying to make this work
Henry S. Thompson <ht@markup.co.uk>
parents: 5
diff changeset
28 sudo cat ~cc/.ssh/id_rsa.pub