Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 3 additions & 80 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,16 @@
pipeline {
agent any

triggers {
cron('H 2 * * 1')
}

environment {
SIDEKIQ_PRO_SECRET = credentials("sidekiq_pro_secret")
ACCESS_TEAM_SLACK_API_TOKEN = credentials("access-team-slack-token")
GH_ACCESS_TOKEN = credentials("sul-ci org token")
}

stages {
stage('Access') {

when {
allOf {
branch 'main';
not { triggeredBy 'SCMTrigger' }
}
}

steps {
checkout scm

sshagent (['sul-devops-team']){
sh '''#!/bin/bash -l
source /opt/rh/devtoolset-6/enable

export PATH=/ci/home/bin:$PATH
export HUB_CONFIG=/ci/home/config/hub
export REPOS_PATH=$WORKSPACE/access

# Load RVM
rvm use 3.2.2@access_dependency_updates --create
gem install bundler
bundle install

bundle config --global gems.contribsys.com $SIDEKIQ_PRO_SECRET
./autupdate.sh

bundle exec ./git_hub_links.rb
'''
}
}
}

stage('Infrastructure') {

when {
allOf {
branch 'main';
branch 'cocina-level2-updates';
not { triggeredBy 'SCMTrigger' }
}
}
Expand All @@ -66,48 +26,11 @@ pipeline {
export REPOS_PATH=$WORKSPACE/infrastructure

# Load RVM
rvm use 3.3.1@infrastructure_dependency_updates --create
rvm use 3.4.1@infrastructure_dependency_updates --create
gem install bundler
bundle install --without production staging

bundle config --global gems.contribsys.com $SIDEKIQ_PRO_SECRET
./autupdate.sh

bundle exec ./git_hub_links.rb
'''
}
}
}

stage('Libsys') {

when {
allOf {
branch 'main';
not { triggeredBy 'SCMTrigger' }
}
}

steps {
checkout scm

sshagent (['sul-devops-team']){
sh '''#!/bin/bash -l
source /opt/rh/devtoolset-6/enable
export PATH=/ci/home/bin:$PATH
export HUB_CONFIG=/ci/home/config/hub
export SLACK_DEFAULT_CHANNEL='#libsys'
export REPOS_PATH=$WORKSPACE/libsys

# Load RVM
rvm use 3.1.2@libsys_dependency_updates --create
gem install bundler
bundle install --without production staging

bundle config --global gems.contribsys.com $SIDEKIQ_PRO_SECRET
./autupdate.sh

bundle exec ./git_hub_links.rb
GITHUB_TOKEN=$GH_ACCESS_TOKEN BUNDLE_GEMS__CONTRIBSYS__COM=$SIDEKIQ_PRO_SECRET bundle exec ./cocina_level2_prs.rb
'''
}
}
Expand Down
4 changes: 4 additions & 0 deletions cocina_level2_prs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def create_branch
def update_gems
gemfile = File.read('Gemfile')
included_gems = %w[cocina-models dor-services-client sdr-client dor_indexing].filter { |gem_name| gemfile.include?(gem_name)}
# NOTE: --conservative flag can be too aggressive in avoiding updates to dependencies of OUR gems
# e.g. diff-lcs is a tertiary dependency of dor-services-client, so dsc would not be updated
# ErrorEmittingExecutor.execute("bundle update --conservative #{included_gems.join(' ')}") unless included_gems.empty?
# NOTE: NOT using --conservative flag can mean gems we don't want to update get updated (e.g. rails)
ErrorEmittingExecutor.execute("bundle update #{included_gems.join(' ')}") unless included_gems.empty?
end

Expand Down
19 changes: 8 additions & 11 deletions infrastructure/projects.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# set merge: false if you want PRs to be ignored when running merge_all
projects:
- repo: sul-dlss/argo
- repo: sul-dlss/argo-b3
- repo: sul-dlss/assembly-image
cocina_level2: false
- repo: sul-dlss/assembly-objectfile
Expand All @@ -9,7 +10,6 @@ projects:
cocina_level2: false
- repo: sul-dlss/common-accessioning
- repo: sul-dlss/datacite-ruby
cocina_level2: false
- repo: sul-dlss/dlme-airflow
cocina_level2: false
- repo: sul-dlss/dlme-transform
Expand All @@ -22,8 +22,6 @@ projects:
cocina_level2: false
- repo: sul-dlss/dor-services-client
cocina_level2: false
- repo: sul-dlss/dor-workflow-client
cocina_level2: false
- repo: sul-dlss/druid-tools
cocina_level2: false
- repo: sul-dlss/folio_client
Expand All @@ -32,8 +30,8 @@ projects:
- repo: sul-dlss/globus_client
cocina_level2: false
- repo: sul-dlss/google-books
- repo: sul-dlss/happy-heron
- repo: sul-dlss/hydra_etd
- repo: sul-dlss/heracles-etd
- repo: sul-dlss/hungry-hungry-hippo
- repo: sul-dlss/infrastructure-integration-test
- repo: sul-dlss/lyber-core
cocina_level2: false
Expand All @@ -45,18 +43,17 @@ projects:
cocina_level2: false
- repo: sul-dlss/orcid_client
cocina_level2: false
- repo: sul-dlss/parse_date
cocina_level2: false
- repo: sul-dlss/pre-assembly
- repo: sul-dlss/preservation-client
cocina_level2: false
- repo: sul-dlss/preservation_catalog
cocina_level2: false
- repo: sul-dlss/preservation_robots
cocina_level2: false
- repo: sul-dlss/rialto-airflow
cocina_level2: false
- repo: sul-dlss/rialto-orgs
cocina_level2: false
merge: false
- repo: sul-dlss/robot-console
cocina_level2: false
- repo: sul-dlss/sdr-api
Expand All @@ -65,6 +62,8 @@ projects:
cocina_level2: false
- repo: sul-dlss/sdr-deploy
cocina_level2: false
- repo: sul-dlss/speech-to-text
cocina_level2: false
- repo: sul-dlss/sul_pub
cocina_level2: false
- repo: sul-dlss/suri-rails
Expand All @@ -75,9 +74,7 @@ projects:
- repo: sul-dlss/was-pywb
cocina_level2: false
- repo: sul-dlss/was-registrar-app
- repo: sul-dlss/wasapi-downloader
cocina_level2: false
- repo: sul-dlss/workflow-server-rails
- repo: sul-dlss/wasapi_client
cocina_level2: false
- repo: LD4P/rdf2marc
cocina_level2: false
Expand Down
4 changes: 2 additions & 2 deletions lib/error_emitting_executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# @return [String] - returns 'FAILED' if command fails, whatever was stdout if it succeeds
class ErrorEmittingExecutor
def self.execute(command, exit_on_error: false)
out, err, status = Open3.capture3(command)
out, err, status = Open3.capture3(ENV.slice('BUNDLE_GEMS__CONTRIBSYS__COM'), command)
return out if status.success?

p "Error executing '#{command}': '#{err || out}'"
p "Error executing '#{command}': '#{err} #{out}'"
exit(1) if exit_on_error

'FAILED'
Expand Down