Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 7 additions & 44 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,22 @@ pipeline {
skipDefaultCheckout true
}
stages {
stage('Web Tests') {
agent {
kubernetes {
label 'nodejs-devoptics'
yamlFile 'nodejs-pod.yaml'
stage('Test') {
agent { label 'nodejs-app' }
steps {
checkout scm
container('nodejs') {
echo 'Hello World!'
sh 'node --version'
}
}
when {
beforeAgent true
branch 'development'
}
stages {
stage('Nodejs Setup') {
steps {
checkout scm
container('nodejs') {
sh """
npm i -S express pug
node ./hello.js &
"""
}
}
}
stage('Testcafe') {
steps {
container('testcafe') {
sh '/opt/testcafe/docker/testcafe-docker.sh "chromium --no-sandbox" tests/*.js -r xunit:res.xml'
}
}
}
}
post {
success {
stash name: 'app', includes: '*.js, public/**, views/*, Dockerfile'
}
always {
junit 'res.xml'
}
}
}
stage('Build and Push Image') {
agent {
kubernetes {
label 'nodejs'
yamlFile 'nodejs-pod.yaml'
}
}
when {
beforeAgent true
branch 'master'
}
steps {
checkout scm
echo "TODO - build and push image"
}
}
Expand Down