Skip to content

Instantly share code, notes, and snippets.

@naturalett
Created January 24, 2020 11:02
Show Gist options
  • Select an option

  • Save naturalett/78656e083f4e3f0b008da6f12bad88cd to your computer and use it in GitHub Desktop.

Select an option

Save naturalett/78656e083f4e3f0b008da6f12bad88cd to your computer and use it in GitHub Desktop.
dags ci cd
pipeline {
agent {
kubernetes {
label podLabel
yaml pod
}
}
stages {
stage('Checkout') {
steps {
script {
git (credentialsId: 'github-token',
url: "https://github.com/<organization-name>/" + repoName,
branch: "master")
build job: 'dump-db-tables'
}
}
}
stage('Unit Tests') {
steps{
script {
runUnitTest()
}
}
}
stage('Test Env Setup') {
steps{
script {
echo "Launch DB"
createDB()
echo "Install Airflow"
installAirflow()
echo "Generate DAGs"
generateDags()
echo "Prepare DB"
createSchema()
importSchema()
echo "Set variables and connections for Airflow"
initAirflow()
}
}
}
stage('Integration Tests') {
steps{
script {
runIntegrationTest()
}
}
}
stage('Artifacts') {
steps{
script {
uploadDags()
}
}
}
}
post {
always {
script {
echo "Clean UP"
deleteAirflow()
deleteDB()
echo "Notify Users"
slackNotifier()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment