Skip to content

Commit

Permalink
Allow using rails 6.1 in jenkins
Browse files Browse the repository at this point in the history
Change-Id: I789009a956751510825092c084db128aaf085ec4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285337
Product-Review: Charley Kline <[email protected]>
Product-Review: Jacob Burroughs <[email protected]>
Tested-by: Jacob Burroughs <[email protected]>
Reviewed-by: Charley Kline <[email protected]>
QA-Review: Jacob Burroughs <[email protected]>
  • Loading branch information
maths22 committed Feb 16, 2022
1 parent 2c5445d commit 888baaf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ARG CANVAS_RAILS6_0=1
ENV CANVAS_RAILS6_0=${CANVAS_RAILS6_0}
ARG CANVAS_RAILS6_1=0
ENV CANVAS_RAILS6_1=${CANVAS_RAILS6_1}

ENV YARN_VERSION 1.19.1-1
ENV BUNDLER_VERSION 2.2.17
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ARG CANVAS_RAILS6_0=1
ENV CANVAS_RAILS6_0=${CANVAS_RAILS6_0}
ARG CANVAS_RAILS6_1=0
ENV CANVAS_RAILS6_1=${CANVAS_RAILS6_1}

ENV YARN_VERSION 1.19.1-1
ENV BUNDLER_VERSION 2.2.17
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ pipeline {
buildParameters += string(name: 'PATCHSET_TAG', value: "${env.PATCHSET_TAG}")
buildParameters += string(name: 'POSTGRES', value: "${env.POSTGRES}")
buildParameters += string(name: 'RUBY', value: "${env.RUBY}")
buildParameters += string(name: 'CANVAS_RAILS6_0', value: '1')
buildParameters += string(name: 'CANVAS_RAILS6_1', value: "${env.CANVAS_RAILS6_1}")

// If modifying any of our Jenkinsfiles set JENKINSFILE_REFSPEC for sub-builds to use Jenkinsfiles in
// the gerrit rather than master. Stable branches also need to check out the JENKINSFILE_REFSPEC to prevent
Expand Down
4 changes: 2 additions & 2 deletions build/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ARG CANVAS_RAILS6_0=1
ENV CANVAS_RAILS6_0=${CANVAS_RAILS6_0}
ARG CANVAS_RAILS6_1=0
ENV CANVAS_RAILS6_1=${CANVAS_RAILS6_1}

ENV YARN_VERSION 1.19.1-1
ENV BUNDLER_VERSION 2.2.17
Expand Down
2 changes: 1 addition & 1 deletion build/new-jenkins/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ WEBPACK_CACHE_DOCKERFILE_MD5=$(cat Dockerfile.jenkins.webpack-cache | md5sum)
BASE_IMAGE_ID=$(docker images --filter=reference=starlord.inscloudgate.net/jenkins/ruby-passenger:$RUBY --format '{{.ID}}')

BASE_RUNNER_BUILD_ARGS=(
--build-arg CANVAS_RAILS6_0=${CANVAS_RAILS6_0:-1}
--build-arg CANVAS_RAILS6_1=${CANVAS_RAILS6_1:-0}
--build-arg POSTGRES_CLIENT="$POSTGRES_CLIENT"
--build-arg RUBY="$RUBY"
)
Expand Down
8 changes: 5 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ class Application < Rails::Application
Canvas::Plugins::DefaultPlugins.apply_all
ActiveSupport::JSON::Encoding.escape_html_entities_in_json = true

# On rails 6.1, this comes from switchman; on rails 6.0 canvas provides it
require_relative "#{__dir__}/../app/models/unsharded_record.rb"
Switchman::UnshardedRecord = UnshardedRecord
if CANVAS_RAILS6_0
# On rails 6.1, this comes from switchman; on rails 6.0 canvas provides it
require_relative "#{__dir__}/../app/models/unsharded_record.rb"
Switchman::UnshardedRecord = UnshardedRecord
end
end

module PostgreSQLEarlyExtensions
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.new-jenkins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
RERUNS_RETRY:
COVERAGE:
FORCE_FAILURE:
CANVAS_RAILS6_0:
CANVAS_RAILS6_1:
CANVAS_ZEITWERK:
TEST_CACHE_CLASSES:

Expand Down

0 comments on commit 888baaf

Please sign in to comment.