add tests to pipeline

This commit is contained in:
Andrea Maria Piana 2018-07-02 15:27:39 +02:00
parent 227a1e8b27
commit d64c9faf30
4 changed files with 17 additions and 0 deletions

9
Jenkinsfile vendored
View File

@ -1,4 +1,7 @@
properties([disableConcurrentBuilds()])
node('linux') {
def image_name = 'statusteam/universal-links-handler'
def commit
def image
@ -12,6 +15,12 @@ node('linux') {
image = docker.build(image_name + ':' + commit)
}
stage('Tests') {
image.withRun('-p 8080:80 -e PORT=80') { c ->
sh 'tests/run.sh -u 127.0.0.1:8080'
}
}
stage('Publish') {
withDockerRegistry([
credentialsId: "dockerhub-statusteam-auto", url: ""

View File

@ -48,3 +48,5 @@ Then you can run `bash tests/run.sh -u localhost:8080` or to run against against
Uses the awesome `https://github.com/robwhitby/shakedown`
## Deployment
The code is automatically deployed when pushed to master

6
tests/run.sh Normal file → Executable file
View File

@ -1,6 +1,12 @@
#!/bin/bash
source tests/shakedown.sh
until $(curl --output /dev/null --silent --head --fail $BASE_URL/health); do
printf '.'
sleep 1
done
shakedown GET /.well-known/assetlinks.json
status 200
content_type 'application/json'

0
tests/shakedown.sh Normal file → Executable file
View File