There is a Jenkinsfile included in this repo for use with Jenkins Blue Ocean. Our CI setup makes use of the following:
- Docker
- The
jenkinsci/blueoceandocker image - ue4-docker
- ue4cli
Jenkins is run inside a docker container, and Holodeck itself is built inside a docker container generated by ue4-docker. ue4-cli is used to make the build process easier.
Install Docker and Python 3.6+, you'll need these later.
You'll want to do this first, since it takes several hours.
-
Follow the instructions for Configuring Linux
You might need to add ppas for Python 3.6 (
-devtoo!) and thenpython3.6 -m pip install ...to install the pip package -
Build the
ue4-completeimage. Make sure to specify the current Holodeck engine version.Note that you will need ~300gb of disk space for this to succeed! The requirements aren't overestimating
We run Jenkins in a docker container, and use a Docker volume to persist data (instead of a bind mount. Avoids permissions issues).
-
Install
jenkinsci/blueoceandocker pull jenkinsci/blueocean -
Create a docker volume
docker volume create jenkins-data -
Copy this sample startup script somewhere
docker run \ -u root \ --rm \ -d \ -p 80:8080 \ -p 50000:50000 \ -v jenkins-data:/var/jenkins_home \ -v /var/run/docker.sock:/var/run/docker.sock \ jenkinsci/blueocean
-
-uruns Jenkins as the root user in the container -
--rmcleans up any temporary volumes -
-p 80:8080forwards port 8080 in the container to port 80 on the host -
-v jenkins-data..binds/var/jenkins_homein the container to the docker volumejenkins-data -
-v -v /var/run/docker.sock...allows the Jenkins instance inside the container to access the docker deamon outside of the container so that the dockerized Jenkins can have docker containers for builds.(we heard you liked docker so we put docker inside your docker so you can docker while you docker)
-
-
Configure that script to be run on startup somehow
-
Connect to
localhost, wait until you get the Unlock Jenkins screen.We will need to put in a password that Jenkins generated, to do so we need to enter the docker container.
-
Run
docker ps- note the name for thejenkinsci/blueoceancontainer (egvigilant_mayer) -
Run
docker exec -it vigilant_mayer bash- this should get you a shell inside the container. Get the password from/var/jenkins_home/secrets/initialAdminPassword -
Install suggested plugins, create an admin user, wait for it to restart.
-
Navigate to
localhost/blue, you should see the new-looking Jenkins Blue UI instead of the janky old one -
Select "Create new Pipeline" -> "Github"
-
Follow the link to create a new Personal Access Token. Write it down somewhere, once generated you can never see it again!
Note - I think this token is associated with a user and not the organization, so if my GitHub account (jaydenmilne) gets removed from the org, Jenkins might break.
-
Select the Holodeck-Engine repo, it should detect the repo and begin to build it
-
Open a pull request, verify that Jenkins automatically begins to build it.
If it doesn't there could be an issue with the Jenkins server being publicly accessible, if it isn't on the open internet, Github won't be able to use webhooks to notifiy Jenkins of a new commit or PR. You will have to manually make Jenkins scan the repo every time:
- Open the configuration for the pipeline
- "Scan Repository Now" on the left
If the server is publically availible and build still aren't automatically happening, you may be a victim of JENKINS-50883. See this blog post