Skip to content

Commit

Permalink
Merge pull request #2857 from paultbarham/azuremerge
Browse files Browse the repository at this point in the history
Azuremerge
  • Loading branch information
singhkays committed Dec 9, 2016
2 parents 3888928 + fee7eae commit 77f197d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 14 deletions.
9 changes: 5 additions & 4 deletions vsts-fullbuild-redhat-vm/README.md
@@ -1,21 +1,22 @@
# VM-Redhat - Team Services Build Agent and Cross-Platform SDKs installation

<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fpaultbarham%2Fazure-quickstart-templates%2Fazuremerge%2Fvsts-fullbuild-redhat-vm%2Fazuredeploy.json" target="_blank">
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fazure-quickstart-templates%2Fmaster%2Fvsts-fullbuild-redhat-vm%2Fazuredeploy.json" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png"/>
</a>
<a href="http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2Fpaultbarham%2Fazure-quickstart-templates%2Fazuremerge%2Fvsts-fullbuild-redhat-vm%2Fazuredeploy.json" target="_blank">
<a href="http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fazure-quickstart-templates%2Fmaster%2Fvsts-fullbuild-redhat-vm%2Fazuredeploy.json" target="_blank">
<img src="http://armviz.io/visualizebutton.png"/>
</a>

This template allows you to create an Red Hat VM with a full cross-platform development environment to support:
This template allows you to create multiple (1 or more) Red Hat VMs with a full cross-platform development environment to support:
* OpenJDK 6, 7 and 8;
* Ant, Maven and Gradle;
* npm and nodeJS;
* groovy and gulp;
* Gnu C and C++ along with make;
* Perl, Python, Ruby and Ruby on Rails;
* .NET;
* go; and
* go;
* Docker Engine and Docker Compose; and
* the VSTS CoreCLR Linux Build Agent.
(Build Agent available here: https://github.com/Microsoft/vsts-agent).

Expand Down
2 changes: 1 addition & 1 deletion vsts-fullbuild-redhat-vm/azuredeploy.json
Expand Up @@ -215,7 +215,7 @@
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"https://raw.githubusercontent.com/paultbarham/azure-quickstart-templates/azuremerge/vsts-fullbuild-redhat-vm/scripts/full-rh-vstsbuild-install.sh"
"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/vsts-fullbuild-redhat-vm/scripts/full-rh-vstsbuild-install.sh"
],
"commandToExecute": "[concat('sh full-rh-vstsbuild-install.sh', ' ', parameters('vstsAccountURL'), ' ', parameters('vstsPAT'), ' ', parameters('vstsPoolName'), ' ', concat(parameters('vstsAgentName'),copyIndex()), ' ', parameters('adminUserName'))]"
}
Expand Down
26 changes: 25 additions & 1 deletion vsts-fullbuild-redhat-vm/scripts/full-rh-vstsbuild-install.sh
Expand Up @@ -93,13 +93,37 @@ ln -s /usr/local/git/bin/git /usr/bin/git

/bin/date +%H:%M:%S >> /home/$5/install.progress.txt

# Install Docker Engine and Docker Compose
echo "Installing Docker Engine and Docker Compose" >> /home/$5/install.progress.txt
yum update -y >> /home/$5/install.out.txt 2>&1

echo [dockerrepo] > /etc/yum.repos.d/docker.repo
echo name=Docker Repository >> /etc/yum.repos.d/docker.repo
echo baseurl=https://yum.dockerproject.org/repo/main/centos/7/ >> /etc/yum.repos.d/docker.repo
echo enabled=1 >> /etc/yum.repos.d/docker.repo
echo gpgcheck=1 >> /etc/yum.repos.d/docker.repo
echo gpgkey=https://yum.dockerproject.org/gpg >> /etc/yum.repos.d/docker.repo

yum install -y docker-engine >> /home/$5/install.out.txt 2>&1
systemctl enable docker.service >> /home/$5/install.out.txt 2>&1
systemctl start docker >> /home/$5/install.out.txt 2>&1
systemctl enable docker >> /home/$5/install.out.txt 2>&1
groupadd docker >> /home/$5/install.out.txt 2>&1
usermod -aG docker $5 >> /home/$5/install.out.txt 2>&1

curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose >> /home/$5/install.out.txt 2>&1

/bin/date +%H:%M:%S >> /home/$5/install.progress.txt


# Download VSTS build agent and required security patch

echo "Downloading VSTS Build agent package" >> /home/$5/install.progress.txt

cd /home/$5/downloads

wget https://github.com/Microsoft/vsts-agent/releases/download/v2.109.1/vsts-agent-rhel.7.2-x64-2.109.1.tar.gz >> /home/$5/install.out.txt 2>&1
wget https://github.com/Microsoft/vsts-agent/releases/download/v2.109.2/vsts-agent-rhel.7.2-x64-2.109.2.tar.gz >> /home/$5/install.out.txt 2>&1

/bin/date +%H:%M:%S >> /home/$5/install.progress.txt

Expand Down
5 changes: 3 additions & 2 deletions vsts-fullbuild-ubuntu-vm/README.md
Expand Up @@ -14,8 +14,9 @@ This template allows you to create an Ubuntu VM with a full cross-platform devel
* groovy and gulp;
* Gnu C and C++ along with make;
* Perl, Python, Ruby and Ruby on Rails;
* .NET;
* go; and
* latest .NET Core;
* go;
* Docker Engine and Compose; and
* the VSTS CoreCLR Linux Build Agent.
(Build Agent available here: https://github.com/Microsoft/vsts-agent).

Expand Down
29 changes: 23 additions & 6 deletions vsts-fullbuild-ubuntu-vm/scripts/full-vstsbuild-install.sh
Expand Up @@ -104,15 +104,33 @@ sudo /bin/date +%H:%M:%S >> /home/$5/install.progress.txt
sudo -u $5 mkdir /home/$5/downloads
sudo -u $5 mkdir /home/$5/lib

# Install .NET
# Install latest release of .NET Core
echo "Installing .NET" >> /home/$5/install.progress.txt
sudo -u $5 mkdir /home/$5/lib/dotnet
cd /home/$5/downloads
sudo -u $5 wget https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/1.0.0-preview2-002875/dotnet-dev-ubuntu-x64.1.0.0-preview2-002875.tar.gz
sudo -u $5 wget https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/Latest/dotnet-ubuntu.16.04-x64.latest.tar.gz
cd /home/$5/lib/dotnet
sudo -u $5 tar zxfv /home/$5/downloads/dotnet-dev-ubuntu-x64.1.0.0-preview2-002875.tar.gz
sudo -u $5 tar zxfv /home/$5/downloads/dotnet-ubuntu.16.04-x64.latest.tar.gz
sudo /bin/date +%H:%M:%S >> /home/$5/install.progress.txt

# Install Docker Engine and Compose
echo "Installing Docker Engine and Compose" >> /home/$5/install.progress.txt
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install -y docker-engine
sudo service docker start
sudo systemctl enable docker
sudo groupadd docker
sudo usermod -aG docker $5

sudo curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

sudo /bin/date +%H:%M:%S >> /home/$5/install.progress.txt

# Install VSTS build agent dependencies

Expand All @@ -127,8 +145,7 @@ echo "Downloading VSTS Build agent package" >> /home/$5/install.progress.txt

cd /home/$5/downloads

# sudo -u $5 wget https://github.com/Microsoft/vsts-agent/releases/download/v2.101.1/vsts-agent-ubuntu.14.04-x64-2.101.1.tar.gz
sudo -u $5 wget https://github.com/Microsoft/vsts-agent/releases/download/v2.104.2/vsts-agent-ubuntu.14.04-x64-2.104.2.tar.gz
sudo -u $5 wget https://github.com/Microsoft/vsts-agent/releases/download/v2.109.2/vsts-agent-ubuntu.14.04-x64-2.109.2.tar.gz
sudo -u $5 wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-8ubuntu0.2_amd64.deb
sudo dpkg -i libicu52_52.1-8ubuntu0.2_amd64.deb

Expand Down Expand Up @@ -176,7 +193,7 @@ echo User: $5 >> /home/$5/vsts.install.log.txt 2>&1
echo =============================== >> /home/$5/vsts.install.log.txt 2>&1

echo Running Agent.Listener >> /home/$5/vsts.install.log.txt 2>&1
sudo -u $5 -E bin/Agent.Listener --configure --unattended --nostart --replace --acceptteeeula --url $1 --auth PAT --token $2 --pool $3 --agent $4 >> /home/$5/vsts.install.log.txt 2>&1
sudo -u $5 -E bin/Agent.Listener configure --unattended --nostart --replace --acceptteeeula --url $1 --auth PAT --token $2 --pool $3 --agent $4 >> /home/$5/vsts.install.log.txt 2>&1
echo =============================== >> /home/$5/vsts.install.log.txt 2>&1
echo Running ./svc.sh install >> /home/$5/vsts.install.log.txt 2>&1
sudo -E ./svc.sh install $5 >> /home/$5/vsts.install.log.txt 2>&1
Expand Down

0 comments on commit 77f197d

Please sign in to comment.