Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (34 sloc) 1.34 KB
node {
def ENVIRONMENT = "qa"
def IMAGE = "rafazzevedo/janger"
wrap([$class: 'AnsiColorBuildWrapper']) {
stage('Clean workspace') {
deleteDir()
}
stage('Setup') {
checkout([
$class: 'GitSCM',
branches: [
[name: 'refs/heads/master']
],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'DisableRemotePoll'],
[$class: 'PathRestriction', excludedRegions: '', includedRegions: ''],
],
submoduleCfg: [],
userRemoteConfigs: [
[
credentialsId: 'credentials',
url: 'git@github.com:rafaelaazevedo/Janger.git'
]
]
])
sh "docker build --pull . -t ${IMAGE}:latest"
sh "docker push ${IMAGE}:latest"
}
stage('Tests') {
sh "kubectl run microservices-tests -i --rm --namespace=${ENVIRONMENT} --restart=Never --image=${IMAGE}:latest --image-pull-policy=Always -- run /etc/newman/api/collections/collection.postman_collection.json -e /etc/newman/api/envs/${ENVIRONMENT}.postman_environment.json --reporters cli --reporter-cli-no-failures"
}
}
}