https://github.com/zoltan-nz/jenkins
https://github.com/zoltan-nz/jenkins
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zoltan-nz/jenkins
- Owner: zoltan-nz
- Created: 2017-09-28T10:25:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T12:31:07.000Z (almost 8 years ago)
- Last Synced: 2025-01-22T02:46:21.245Z (9 months ago)
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jenkins, Docker, Pipeline
* https://www.youtube.com/watch?v=38SAyBLSHUM&feature=youtu.be
* https://www.docker.com/sites/default/files/UseCase/RA_CI%20with%20Docker_08.25.2015.pdf
* https://jenkins.io/solutions/pipeline/
* https://jenkins.io/doc/book/pipeline/## Run Jenkins
```
$ mkdir jenkins-data
$ docker run -p 8888:8080 -v $PWD/jenkins-data:/var/jenkins_home jenkinsci/blueocean:latest
$ open localhost:8888
```## Setup a git repo
```
$ mkdir demo-app
$ cd demo-app
$ git init
...
```## Add Jenkinsfile to demo-app
[Jenkinsfile](https://jenkins.io/doc/book/pipeline/jenkinsfile/)
```
pipeline {
agent anystages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}
```## Importing file based git repo in Jenkins
Add new volume to the docker container
```
$ docker run -p 8888:8080 -v $PWD/jenkins-data:/var/jenkins_home -v $PWD/demo-app:/demo-app jenkinsci/blueocean:latest
```Using in Jenkins: `file:///demo-app`
## Using docker inside the Jenkins container
```
$ docker run -v /var/run/docker.sock:/var/run/docker.sock ...
```On MacOS:
```
docker run -v /private/var/run/docker.sock:/var/run/docker.sock
```