DevOps Academy May 2019
Week 1 - DevOps culture and methodology: https://drive.google.com/open?id=13_Pdyzmin6qv6f_mHhgEi9BoXRRejGrb
- Install Vagrant and VirtualBox (or any other virtualization software).
- Clone this project and cd into it, then run
vagrant up
- Then, run
vagrant ssh
anddocker ps
, you should see 4 containers running. - After that, run
sudo chown -R 1000 /jenkins_home
thencd /vagrant
and finallydocker-compose up --build -d
- Now 5 containers should be running.
- Run
ifconfig
to see your VM's ip, usually located here:
- Then go to YOURIP:8050, you should see the Jenkins splash screen.
- Install all suggested plugins, and login.
- Go to
Manage Jenkins
->Manage Plugins
->Available
and search for Docker, then install this plugin:
- After it's installed, go to
Manage Jenkins
->Configure System
- At the bottom of the screen, click on
Add a new cloud
->Docker
, then click onDocker Cloud details
- On
Docker Host URI
typetcp://YOURIP:2375/
and tick theEnabled
box, then clickTest Connection
- You should see the Docker version and it's API version.
- If this doesn't work try running the
expose_docker.sh
script manually. - Now click on
Docker Agent templates
- On
Labels
typedocker-agent
, then tick theEnabled
box - On
Docker Image
typebenhall/dind-jenkins-agent:v2
- On
Connect method
selectConnect with SSH
- Then go to
Container Settings
- On
Volumes
, type/var/run/docker.sock:/var/run/docker.sock
, and on a new line/home/lucas/midatita/:/home/lucas/midatita
- Docker should be correctly configured, now go to
Credentials
->global
->Add credentials
at the top left. - Add your github and dockerhub credentials. For them to be recognized by the pipeline, their respective IDs should be
github-globant
anddocker-hub-credentials
- Now go to
New Item
and create aPipeline
project. - Go to
Configure
->Pipeline
and follow the instructions on the image below:
- Build the project, everything should work.
- The step where I suggest to
sudo chown -R 1000 /jenkins_home
can be avoided with better system provisioning but for some reason I could never make it work properly so I used this workaround. - The Wordpress Jenkinsfile is configured to search for some persistent data I typed into my Wordpress container, if you run the project for the first time you will encounter an error.
- To avoid this you will need to manually run the Wordpress and SQL containers, install it for the first time, and then type some random data into it, then modify the Jenkinsfile to look for it.
For any questions or suggestions, I can be reached at: [email protected]