Last active
March 9, 2018 15:04
-
-
Save O5ten/a7a3e76b436dcfb0960040bd76d7d837 to your computer and use it in GitHub Desktop.
A TeamCity with a linux agent to test plugins with using Vagrant and Docker, put in a folder, do vagrant up
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.box_download_insecure = true | |
config.vm.network "forwarded_port", guest: 8080, host: 8080 | |
config.vm.provider :virtualbox do |vb| | |
vb.memory = "2048" | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get -y install \ | |
linux-image-extra-$(uname -r) \ | |
linux-image-extra-virtual | |
sudo apt-get -y install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt-get update | |
sudo apt-get -y install docker-ce | |
sudo docker run -d -it --name teamcity-server-instance \ | |
-v /vagrant/tc-data:/data/teamcity_server/datadir \ | |
-v /vagrant/tc-logs:/opt/teamcity/logs \ | |
-p 8080:8111 \ | |
jetbrains/teamcity-server | |
sudo docker run -d -it --link=teamcity-server-instance \ | |
-e SERVER_URL="http://teamcity-server:8080" \ | |
-v /vagrant/agent-data:/data/teamcity_agent/conf \ | |
jetbrains/teamcity-agent | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment