Skip to content

Commit

Permalink
Merge pull request #352 from ivplus/cd
Browse files Browse the repository at this point in the history
Hook up continuous deployment via jenkins
  • Loading branch information
mjgiarlo authored Jun 10, 2021
2 parents 64339c8 + 4e2b67c commit c06da7d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ gem 'sidekiq'
gem 'inline_svg'
gem 'marc'
gem 'rexml' # see https://github.com/ruby-marc/ruby-marc/issues/67...
gem 'sidekiq'
gem 'whenever'

gem 'rack-attack'
Expand Down
51 changes: 51 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pipeline {
agent any

environment {
SIDEKIQ_PRO_SECRET = credentials("sidekiq_pro_secret")
SLACK_WEBHOOK_URL = credentials("access_slack_webhook")
}

stages {
stage('Deploy on release') {

when {
tag "v*"
}

steps {
checkout scm

sshagent (['sul-devops-team', 'sul-continuous-deployment']){
sh '''#!/bin/bash -l
export DEPLOY=1
export REVISION=$TAG_NAME
# Load RVM
rvm use 3.0.1@pod --create
gem install bundler
bundle install --without production
# Deploy it
bundle exec cap prod deploy
'''
}
}

post {
success {
sh '''#!/bin/bash -l
curl -X POST -H 'Content-type: application/json' --data '{"text":"The deploy to prod was successful"}' $SLACK_WEBHOOK_URL
'''
}

failure {
sh '''#!/bin/bash -l
curl -X POST -H 'Content-type: application/json' --data '{"text":"The deploy to prod was unsuccessful"}' $SLACK_WEBHOOK_URL
'''
}
}
}
}
}

0 comments on commit c06da7d

Please sign in to comment.