status-go/_assets/ci/Jenkinsfile.tests
Samuel Hawksby-Robinson cab6281dc5
Adding postgres docker to jenkins test (#2225)
* wip

* file rename

* Adding postgres docker to jenkins test

* update and fix to jenkins file

* More fixing

* tinker

* more tinkering

* agent in stage

* agent in stage fix

* Integrated Andrea's Docker compose work

* Rework to include dockerfile into jenkins unit test

* Customer dockerfile agent

* Change to ENTRYPOINT

* No dir() in Unit Tests

* Removal dir property of dockerfile

* Added lable to agent.dockerfile

* agent set only at stage level

* Added Jakub's suggestion

* removed stage level agent

* replaced docker host name with default 127.0.0.1

* Fix of old NewWhisperEnvelope

* removed user and password settings from postgres connection

* Set explicit postgres user and password

* Change postgres creds to be more generic

* Removed unneeded docker files

* POSTGRES_HOST_AUTH_METHOD because we hate passwords

* chicken chicken chicken

* indents 2 spaces
2021-06-09 11:16:04 +01:00

70 lines
1.8 KiB
Plaintext

library 'status-jenkins-lib@v1.2.17'
pipeline {
agent { label 'linux' }
parameters {
string(
name: 'BRANCH',
defaultValue: 'develop',
description: 'Name of branch to build.'
)
}
options {
timestamps()
disableConcurrentBuilds()
/* Go requires a certain directory structure */
checkoutToSubdirectory('src/github.com/status-im/status-go')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '5',
daysToKeepStr: '30',
))
}
environment {
TARGET = 'linux'
STATUS_PATH = 'src/github.com/status-im/status-go'
GOPATH = "${env.WORKSPACE}"
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
}
stages {
stage('Prep') { steps { dir(env.STATUS_PATH) { script {
println("Version: ${utils.getVersion()}")
println("Git Branch: ${utils.branchName()}")
println("Git Commit: ${utils.gitCommit()}")
} } } }
stage('Setup') { steps { dir(env.STATUS_PATH) {
sh 'GO111MODULE=off make setup-build modvendor-install'
} } }
stage('Vendoring check') { steps { dir(env.STATUS_PATH) {
// fail build if vendoring hasn't been done
sh 'GO111MODULE=on make vendor && git diff --exit-code --no-color --stat vendor/'
} } }
stage('Lint') { steps { dir(env.STATUS_PATH) {
sh 'make lint'
} } }
stage('Canary') { steps { dir(env.STATUS_PATH) {
sh 'make canary-test'
} } }
stage('Unit Tests') { steps { script { dir(env.STATUS_PATH) {
docker.image('postgres:9.6-alpine').withRun(
'-e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432'
) { c ->
sh 'make test-unit'
}
} } } }
stage('Race E2E Tests') { steps { dir(env.STATUS_PATH) {
sh 'make test-e2e-race'
} } }
} // stages
} // pipeline