From a3d23a569818410c72337711cf10efd2013059cd Mon Sep 17 00:00:00 2001
From: Tucker Siegel <tgsiegel@umd.edu>
Date: Fri, 12 Nov 2021 10:16:27 -0800
Subject: [PATCH] add stage

---
 dawn-gateway/staging               | 54 +-----------------------------
 vars/backendServicePipeline.groovy | 11 +++++-
 2 files changed, 11 insertions(+), 54 deletions(-)

diff --git a/dawn-gateway/staging b/dawn-gateway/staging
index 66698f7..e7fadf9 100644
--- a/dawn-gateway/staging
+++ b/dawn-gateway/staging
@@ -1,53 +1 @@
-pipeline {
-  agent any
-  tools {
-        go 'go-1.16'
-  }
-  options {
-    buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')
-  }
-  stages {
-      
-      stage('checkout') {
-        steps {
-            git branch: 'staging',
-                credentialsId: 'tucker-gitlab-login',
-                url: 'https://gitlab.cs.umd.edu/dawn/go-backend/dawn-gateway.git'
-
-            sh "ls -lat"
-        }
-    }
-     
-    stage('test') {
-      steps {
-        sh """
-            dawn-cli test
-        """ 
-      }
-    }
-
-    stage('build') {
-      steps {
-        sh """
-            dawn-cli build-image -p .
-        """ 
-      }
-    }
-
-    stage('update backend services') {
-      steps {
-        git branch: 'main',
-                credentialsId: 'tucker-gitlab-login',
-                url: 'https://gitlab.cs.umd.edu/dawn/go-backend/dawn-cli'
-        sh """
-            dawn-cli deploy
-        """ 
-      }
-    }
-  }
-  post {
-        always {
-              cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: '**/coverage.xml', enableNewApi: true, failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 40, 60', maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
-        }
-    }
-}
\ No newline at end of file
+backendServicePipeline "https://gitlab.cs.umd.edu/dawn/go-backend/dawn-gateway.git", "staging"
\ No newline at end of file
diff --git a/vars/backendServicePipeline.groovy b/vars/backendServicePipeline.groovy
index 551571f..e785de8 100644
--- a/vars/backendServicePipeline.groovy
+++ b/vars/backendServicePipeline.groovy
@@ -1,4 +1,4 @@
-def call(String repo, String branch) {
+def call(String repo, String branch, Bool) {
     pipeline {
   agent any
   tools {
@@ -25,6 +25,15 @@ def call(String repo, String branch) {
       }
     }
 
+    stage("build docs") {
+      steps {
+        sh """
+            go get https://github.com/swaggo/swag
+            swag init --parseDependency --parseDepth 2
+        """ 
+      }
+    }
+
     stage('build') {
       steps {
         sh """
-- 
GitLab