Last active
March 29, 2021 16:20
-
-
Save nikoly/511bf1a8a1431824ae72531388c043c0 to your computer and use it in GitHub Desktop.
Complete Jenkins Pipeline to run selenium tests
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
#!groovy | |
node { | |
wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) { | |
stage("Checkout") { | |
checkout scm | |
} | |
stage("Cleaning and preparing") { | |
sh '''#!/bin/bash -e | |
git clean -dfx | |
mkdir reports | |
''' | |
} | |
stage('Build an image with App') { | |
sh """ | |
docker-compose build app:{BUILD_NUMBER} | |
""" | |
} | |
stage('Build an image with Tests') { | |
sh """ | |
docker-compose build robottests:{BUILD_NUMBER} | |
""" | |
} | |
stage('Run Docker Compose') { | |
sh """#!/bin/bash -e | |
docker-compose run --rm robottests:{BUILD_NUMBER} ./wait-for-it.sh -t 15 chromenode:5555 -- robot -d reports --variablefile variables/config.py --variable BROWSER:chrome tests/ | |
""" | |
} | |
stage('Stop all containers') { | |
sh """ | |
docker-compose down | |
""" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment