* pipeline

* pipeline

* slack channel

* slack channel
This commit is contained in:
Rafi Greenberg
2021-01-08 10:55:17 -08:00
committed by GitHub
parent c51199111f
commit 26e25a5b23
9 changed files with 217 additions and 25 deletions

81
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,81 @@
@Library('fisker') _
pipeline {
agent none
options {
ansiColor('xterm')
}
environment {
PROJECT = getProject()
ENV = getEnv()
}
stages {
stage('Build') {
when {
beforeAgent true
allOf {
not {
changeRequest()
}
anyOf {
branch 'development'
branch 'main'
}
}
}
agent {
kubernetes {
cloud 'dev'
inheritFrom 'fisker'
}
}
steps {
slack("Build Started - ${env.JOB_NAME} (${env.BUILD_URL})", 'info', '#team-eng-compute-jenkins')
slack(getChanges(), 'info', '#team-eng-compute-jenkins')
container('awscli') {
ecr()
}
container('kaniko') {
buildImage()
}
}
post {
failure {
slack("${env.JOB_NAME} build failed!", 'error', '#team-eng-compute-jenkins')
}
}
}
stage('Deploy') {
when {
beforeAgent true
allOf {
not {
changeRequest()
}
anyOf {
branch 'development'
branch 'main'
}
}
}
agent {
kubernetes {
cloud getEnv()
inheritFrom 'fisker'
}
}
steps {
slack("Deploying ${PROJECT} to ${ENV}... :partydeploy: ", 'info', '#team-eng-compute-jenkins')
container('helm') {
deploy(getEnv())
}
slack("Successfully deployed ${PROJECT} to ${ENV}! :tada: ", 'info', '#team-eng-compute-jenkins')
}
post {
failure {
slack("${PROJECT} deploy to ${ENV} failed!", 'error', '#team-eng-compute-jenkins')
}
}
}
}
}