Skip to content
Snippets Groups Projects
Commit e7635601 authored by Tucker Gary Siegel's avatar Tucker Gary Siegel
Browse files

update manager

parent 9753d7ec
No related branches found
No related tags found
No related merge requests found
pipeline { pipeline {
agent { label 'node2' } agent { label 'node2' }
tools { nodejs 'node' } tools { nodejs 'node' }
stages { stages {
stage('notify') { stage('notify') {
steps { steps {
script { script {
slack_send_start() slack_send_start()
} }
} }
} }
stage('build') { stage('build') {
steps { steps {
git branch: 'main', git branch: 'main',
credentialsId: 'tucker-gitlab-login', credentialsId: 'tucker-gitlab-login',
url: 'https://gitlab.cs.umd.edu/dawn/go-backend/dawn-manager.git' url: 'https://gitlab.cs.umd.edu/dawn/go-backend/dawn-manager.git'
sh ''' sh '''
npm i sudo docker build -t docker.registry.dawn.int:5000/dawn/dawn-manager:latest . -f Dockerfile
npm run build-staging sudo docker push docker.registry.dawn.int:5000/dawn/dawn-manager:latest
''' '''
} }
} }
stage('copy build') { stage('deploy') {
steps { steps {
sh ''' dir('/home/kube/staging') {
sudo rm -rf /var/www/dawn_staging/_admin sh 'git pull'
sudo mkdir /var/www/dawn_staging/_admin sh 'kubectl delete -f dawn-manager'
sudo cp -r build/* /var/www/dawn_staging/_admin sh 'kubectl apply -f dawn-manager'
''' }
} }
} }
}
stage('restart nginx') {
steps { post {
sh ''' success {
sudo service nginx restart script {
''' slack_send_success()
} }
} }
} failure {
script {
post { slack_send_failure()
success { }
script { }
slack_send_success() }
} }
}
failure {
script {
slack_send_failure()
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment