diff --git a/crop-progress-tool/dev b/crop-progress-tool/dev deleted file mode 100644 index eba0c5406bcfbfc353a1964d12996ee2d4600b09..0000000000000000000000000000000000000000 --- a/crop-progress-tool/dev +++ /dev/null @@ -1 +0,0 @@ -backendDevServicePipeline "crop-progress" \ No newline at end of file diff --git a/crop-progress-tool/staging b/crop-progress-tool/staging deleted file mode 100644 index 737b5ccaf0fee5970f2a71945daeb3deba7e0a94..0000000000000000000000000000000000000000 --- a/crop-progress-tool/staging +++ /dev/null @@ -1 +0,0 @@ -backendStagingServicePipeline "https://gitlab.cs.umd.edu/dawn/dawn-crop-progress.git", "staging", "crop-progress" \ No newline at end of file diff --git a/dawn-analytics/dev b/dawn-analytics/dev index 8d70ef1738d68d3d991a294743496edcaa90b9e5..4a3fa9c7b53d927b9d99f36fc95550f8d9e58d63 100644 --- a/dawn-analytics/dev +++ b/dawn-analytics/dev @@ -1 +1,45 @@ -backendDevServicePipeline "dawn-analytics" \ No newline at end of file +pipeline { + agent { label 'node2' } + tools { nodejs 'node' } + stages { + stage('notify') { + steps { + script { + slack_send_start() + } + } + } + + stage('build') { + steps { + git branch: 'main', + credentialsId: 'tucker-gitlab-login', + url: 'https://gitlab.cs.umd.edu/dawn/go-backend/dawn-analytics.git' + + sh ''' + sudo docker build -t docker.registry.dawn.int:5000/dawn/dawn-analytics:latest . -f Dockerfile + sudo docker push docker.registry.dawn.int:5000/dawn/dawn-analytics:latest + ''' + } + } + + stage('deploy') { + steps { + upgradeKubernetes('dawn-analytics', 'staging') + } + } + } + + post { + success { + script { + slack_send_success() + } + } + failure { + script { + slack_send_failure() + } + } + } +} diff --git a/dawn-analytics/staging b/dawn-analytics/staging index d869737927c65fa3103412cb9fe3ae68f92e6cd1..0486970915cc89aab5225cf132d22d114ad0b16f 100644 --- a/dawn-analytics/staging +++ b/dawn-analytics/staging @@ -1 +1,49 @@ -backendStagingServicePipeline "https://gitlab.cs.umd.edu/dawn/go-backend/dawn-analytics.git", "staging", "dawn-analytics" \ No newline at end of file +pipeline { + agent { label 'node2' } + tools { nodejs 'node' } + stages { + stage('notify') { + steps { + script { + slack_send_start() + } + } + } + + stage('build') { + steps { + git branch: 'main', + credentialsId: 'tucker-gitlab-login', + url: 'https://gitlab.cs.umd.edu/dawn/go-backend/dawn-analytics.git' + + sh ''' + sudo docker build -t docker.registry.dawn.int:5000/dawn/dawn-analytics:latest . -f Dockerfile + sudo docker push docker.registry.dawn.int:5000/dawn/dawn-analytics:latest + ''' + } + } + + stage('deploy') { + steps { + dir('/home/kube/staging') { + sh 'git pull' + sh 'kubectl delete -f dawn-analytics' + sh 'kubectl apply -f dawn-analytics' + } + } + } + } + + post { + success { + script { + slack_send_success() + } + } + failure { + script { + slack_send_failure() + } + } + } +} diff --git a/vars/upgradeKubernetes.groovy b/vars/upgradeKubernetes.groovy new file mode 100644 index 0000000000000000000000000000000000000000..12bd629988eeb15ba959d0d0db7233d444f7c2eb --- /dev/null +++ b/vars/upgradeKubernetes.groovy @@ -0,0 +1,7 @@ +def call(String serviceName, String serviceEnv) { + dir('/home/kube/' + serviceEnv) { + sh 'git pull' + sh 'kubectl delete -f ' + serviceName + sh 'kubectl apply -f ' + serviceName + } +}