Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joutvhu/jenkins-training
Jenkins Training
https://github.com/joutvhu/jenkins-training
gitlab jenkins jenkinsfile pipeline training
Last synced: about 2 months ago
JSON representation
Jenkins Training
- Host: GitHub
- URL: https://github.com/joutvhu/jenkins-training
- Owner: joutvhu
- License: mit
- Created: 2023-07-15T12:34:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-08T14:01:21.000Z (over 1 year ago)
- Last Synced: 2024-04-18T05:06:05.454Z (8 months ago)
- Topics: gitlab, jenkins, jenkinsfile, pipeline, training
- Homepage:
- Size: 1.09 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jenkins Training
Run the following commands to create containers.
```
docker network create jenkinsdocker run --name jenkins -p 50000:50000 -p 58080:8080 --network jenkins jenkins/jenkins
docker run --name gitlab -p 5022:22 -p 5443:443 -p 5080:80 --network jenkins gitlab/gitlab-ce
```### Jenkins Admin Password
- Find in file `/var/jenkins_home/secrets/initialAdminPassword`
### Gitlab Admin User
- Username: `root`
- Password in file: `/etc/gitlab/initial_root_password`### Jenkins Setting
- Install Gitlab plugin
- Install tools (JDK, Maven): `Manage Jenkins` -> `Tools` : Select `Install automatically`
![image](doc/Screenshot%202023-07-16%20010405.png)
![image](doc/Screenshot%202023-07-16%20010525.png)
- Create SSH key. Open terminal in container and create a SSH key.
![image](doc/Screenshot%202023-07-16%20011323.png)
### GitLab Setting
- Get SSH public key from Jenkins and add to Gitlab.
- GitLab settings Admin -> `Settings` -> `Network` -> `Outbound Requests` -> `Allow requests to the local network from hooks and services.`
### Create Gitlab Project
- Create a repository with name `demo`
- Open the repository -> `Settings` -> `Integrations` -> `Jenkins`
- Jenkins server URL: `http://jenkins.jenkins:8080`
- Enable SSL verification: disable.
- Select events.
![image](doc/Screenshot%202023-07-16%20010734.png)
- If you use Github then use `Webhook` instead of `Integration` (`Settings` -> `Webhooks` -> `Add webhook`)
### Create Jenkins Pipeline Project
- Create a Pipeline project with name `demo`
- Enable _"Build when a change is pushed to GitLab. GitLab webhook URL: http://localhost:58080/project/demo"_
- Select events.
![image](doc/Screenshot%202023-07-16%20010615.png)
- Add repository link, example `[email protected]:root/demo.git`
![image](doc/Screenshot%202023-07-16%20010649.png)
## More Config
- [Sonarqube](./sonar)
- [Multibranch Pipeline](./multibranch)
- [Update GitLab Build Status](./gitlab-build-status)