Skip to content

Instantly share code, notes, and snippets.

@michaelneu
Created August 10, 2018 06:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelneu/a187c08f3d22c4e86f4668e0015ca35c to your computer and use it in GitHub Desktop.
Save michaelneu/a187c08f3d22c4e86f4668e0015ca35c to your computer and use it in GitHub Desktop.
docker-compose configuration and Jenkinsfile to run builds in Docker containers
version: "3"
services:
jenkins:
image: zenika/alpine-jenkins-with-docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./jenkins:/var/jenkins_home
ports:
- 8080:8080
- 50000:50000
stage('Build') {
node (label: 'linux') {
checkout scm
docker.image('node:alpine').inside {
sh 'yarn install'
sh 'yarn build'
}
}
}
stage('Lint') {
node (label: 'linux') {
checkout scm
docker.image('node:alpine').inside {
sh 'yarn install'
sh 'yarn lint'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment