evergreen/Jenkinsfile

187 lines
5.3 KiB
Plaintext
Raw Normal View History

pipeline {
agent { label 'linux' }
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(daysToKeepStr: '10'))
timestamps()
}
triggers {
pollSCM('H * * * *')
}
environment {
// Squid is enabled by default in the dev environment
DISABLE_PROXY_CACHE = 'true'
}
stages {
stage('Prepare Workspace') {
steps {
sh 'make clean || true'
}
}
stage('Lint code') {
steps {
sh 'make lint'
}
}
stage('Validate essentials.yaml') {
steps {
dir('services') {
sh 'make generate-essentials && git diff --quiet essentials.yaml'
}
}
post {
failure {
echo 'Please ensure that updates to essentials.yaml are committed!'
}
always {
archiveArtifacts artifacts: 'services/essentials.yaml', fingerprint: true
}
}
}
stage('Prepare ingest') {
steps {
sh 'make -C services generate-ingest'
}
post {
success {
archiveArtifacts artifacts: 'services/ingest.json', fingerprint: true
}
}
}
stage('Verifications') {
parallel {
stage('Evergreen Client') {
steps {
sh 'make -C distribution/client check'
}
post {
success {
archiveArtifacts 'distribution/client/coverage/**'
}
}
}
stage('Backend Services') {
steps {
sh 'make -C services check'
}
post {
success {
archiveArtifacts 'services/coverage/**'
}
cleanup {
sh 'make -C services stop'
}
}
}
}
}
stage('Build Distribution') {
steps {
sh 'make -C distribution distribution'
}
post {
success {
archiveArtifacts artifacts: 'distribution/build/*.zip', fingerprint: true
}
}
}
2018-07-18 12:33:33 +00:00
stage('Build images') {
parallel {
stage('jenkins/evergreen') {
environment {
// Since tests have already been successfully run, skip them
SKIP_TESTS = 'true'
}
steps {
sh 'make -C distribution container'
}
}
stage('jenkinsciinfra/evergreen-backend') {
environment {
// Since tests have already been successfully run, skip them
SKIP_TESTS = 'true'
}
steps {
sh 'make -C services container'
}
}
}
post {
cleanup {
sh 'make -C services stop'
}
}
}
stage('Test images') {
environment {
// Since tests have already been successfully run, skip them
SKIP_TESTS = 'true'
}
parallel {
stage('Docker Cloud image') {
Force an agent for each parallel stage To avoid conflict like this ``` ---> Running in a1855d049c6f Removing intermediate container a1855d049c6f ---> b134bc6c1cb3 Successfully built b134bc6c1cb3 Successfully tagged jenkinsciinfra/evergreen-backend:latest Image for service backend was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`. Creating infraevergreenpr95d6lei27mpdy4xpni7yv3lfayry3wnmjzk3mue42dps736bjy5xya_db_1 ... Creating infraevergreenpr95d6lei27mpdy4xpni7yv3lfayry3wnmjzk3mue42dps736bjy5xya_db_1 ... error ERROR: for infraevergreenpr95d6lei27mpdy4xpni7yv3lfayry3wnmjzk3mue42dps736bjy5xya_db_1 Cannot create container for service db: Conflict. The container name "/infraevergreenpr95d6lei27mpdy4xpni7yv3lfayry3wnmjzk3mue42dps736bjy5xya_db_1" is already in use by container "984d2c8bc9e0de2b526717963d8808904d1bd58768deb6622b64aead323534df". You have to remove (or rename) that container to be able to reuse that name. ERROR: for db Cannot create container for service db: Conflict. The container name "/infraevergreenpr95d6lei27mpdy4xpni7yv3lfayry3wnmjzk3mue42dps736bjy5xya_db_1" is already in use by container "984d2c8bc9e0de2b526717963d8808904d1bd58768deb6622b64aead323534df". You have to remove (or rename) that container to be able to reuse that name. Encountered errors while bringing up the project. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6b90a47d7ad9 postgres:alpine "docker-entrypoint.s…" 5 minutes ago Up 2 minutes 5432/tcp services_db_1 Error: No such container: shunit2:FATAL oneTimeSetUp() returned non-zero return code. ASSERT:Unknown failure encountered running a test Ran 0 tests. FAILED (failures=1) Makefile:31: recipe for target 'base-container-check' failed make: *** [base-container-check] Error 2 script returned exit code 2 ```
2018-06-06 14:02:56 +00:00
agent { label 'linux' }
steps {
sh 'make -C distribution clean docker-cloud-container-check'
}
post {
always {
archiveArtifacts artifacts: '**/build/tests-run*/**'
}
}
}
stage('Rollback testing') {
agent { label 'linux' }
steps {
sh 'make -C distribution clean rollback-check'
}
post {
always {
archiveArtifacts artifacts: '**/build/tests-run*/**'
}
}
2018-05-14 21:01:51 +00:00
}
stage('AWS Cloud image (smokes)') {
agent { label 'linux' }
steps {
sh 'make -C distribution clean aws-cloud-container-check'
}
post {
always {
archiveArtifacts artifacts: '**/build/tests-run*/**'
}
}
}
2018-05-14 21:01:51 +00:00
}
}
stage('Publish jenkins/evergreen') {
when {
expression { infra.isTrusted() }
}
steps {
withCredentials([[$class: 'ZipFileBinding',
credentialsId: 'jenkins-dockerhub',
variable: 'DOCKER_CONFIG']]) {
sh 'make publish'
}
}
}
}
}
// vim: ft=groovy