Development envrionment for the scrum for developers training told at codecentric. The environment is based on docker containers containers, which are orchestrated via docker-compose. The demo project build by this environment is the worblehat library application The environment consists of:
- Jenkins build server
- Artifactory artifact repository
- SonarQube quality analysis tool
- Tomcat as test deployment environment for the worblehat application
- MySQL as data store for the worblehat application and for SonarQube
- nginx as reversed proxy for the other systems
- Install docker
- Install docker-compose
- Run
cd docker; docker-compose up
- Point your browser to http://DOCKER_HOST_IP
Symptoms: The jenkins container doesn't start up correctly, the log contains sth. like
mkdir: cannot create directory '/var/jenkins_home/plugins': Permission denied
or the worblehat-020-quality job fails with the error message
cp: cannot create regular file '/home/jenkins/site-deploy/site/integration.html': Permission denied
Explanation: The jenkins home directory and the site-deploy directory (which is used by the quality-job) are
mounted as a docker volume. The required
directories under mounted_directories
must be readable/writable by the docker user.
Solution: The simplest solution is to grant write access to anybody for the mounted_directories
chmod -R a+w mounted_directories
- Generate a "personal access token" (https://git.fh-aachen.de/profile/personal_access_tokens)
- Add new Credentials in jenkins
- Navigate to /jenkins/credentials/store/system/domain/_/newCredentials
- Use the token and your username as credentials
- Change the repository URL
- Navigate to the pipeline configuration (/jenkins/job/worblehat-pipelines/configure)
- Change the "Project Repository" in the "Git" section and use the previously added credentials
- Test the connection with a simple push to the master or rerun the last execution
Restarting
sudo service jenkins restart
Connecting to Database:
sudo -u sonar psql --dbname=sonarqube -U sonar -W
- Password: 123qwe
Reset Admin password: See https://docs.sonarqube.org/7.4/instance-administration/security/
update users set crypted_password = '$2a$12$uCkkXmhW5ThVK8mpBvnXOOJRLd64LJeHTeCkSuB3lfaR2N0AYBaSi', salt=null, hash_method='BCRYPT' where login = 'admin';