Created
January 24, 2020 11:02
-
-
Save naturalett/78656e083f4e3f0b008da6f12bad88cd to your computer and use it in GitHub Desktop.
dags ci cd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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