Created
August 10, 2018 06:53
-
-
Save michaelneu/a187c08f3d22c4e86f4668e0015ca35c to your computer and use it in GitHub Desktop.
docker-compose configuration and Jenkinsfile to run builds in Docker containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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