Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nulldb for assets precompilation #1338

Merged
merged 2 commits into from
Apr 24, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ pipeline {
withRVM(['bundle exec rake jenkins:integration TESTOPTS="-v" --trace'], env.RUBY_VER, env.GEMSET)
}
}
stage("assets-precompile-2.5-postgres-ui") {
steps {
withRVM(['bundle exec rake assets:precompile RAILS_ENV=production'], env.RUBY_VER, env.GEMSET)
}
}
}
post {
always {
Expand All @@ -107,31 +102,31 @@ pipeline {
}
}
}
stage('ruby-2.5-sqlite3') {
stage('ruby-2.5-nulldb-assets') {
agent { label 'fast' }
environment {
RUBY_VER = '2.5'
GEMSET = 'ruby-2.5-sqlite3'
GEMSET = 'ruby-2.5-nulldb-assets'
}
stages {
stage("setup-2.5-sqlite3") {
stage("setup-2.5-nulldb") {
steps {
git url: git_url, branch: git_ref
configureRVM(env.RUBY_VER, env.GEMSET)
databaseFile(gemset(env.GEMSET), 'sqlite3')
configureDatabase(env.RUBY_VER, env.GEMSET)
withRVM(['bundle install --without=development --jobs=5 --retry=5'], env.RUBY_VER, env.GEMSET)
sh "cp db/schema.rb.nulldb db/schema.rb"
withRVM(['npm install'], env.RUBY_VER, env.GEMSET)
}
}
stage("unit-tests-2.5-sqlite3") {
stage("assets-precompile-2.5-nulldb") {
steps {
withRVM(['bundle exec rake jenkins:unit TESTOPTS="-v" --trace'], env.RUBY_VER, env.GEMSET)
withRVM(['bundle exec rake assets:precompile RAILS_ENV=production DATABASE_URL=nulldb://nohost'], env.RUBY_VER, env.GEMSET)
}
}
}
post {
always {
cleanup(env.RUBY_VER, env.GEMSET)
junit(testResults: 'jenkins/reports/unit/*.xml')
deleteDir()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pipeline {
steps {
dir('foreman') {
withRVM(["bundle exec npm install"], ruby)
withRVM(['bundle exec rake plugin:assets:precompile[katello] RAILS_ENV=production --trace'], ruby)
withRVM(['bundle exec rake plugin:assets:precompile[katello] RAILS_ENV=production DATABASE_URL=nulldb://nohost --trace'], ruby)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ bundle exec rake $tasks TESTOPTS="-v" --trace

# Test asset precompile
if [ "${UI}" = "true" ]; then
bundle exec rake db:drop RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=true || true
bundle exec rake db:create RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=true
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake assets:precompile RAILS_ENV=production
bundle exec rake webpack:compile RAILS_ENV=production
bundle exec rake assets:precompile RAILS_ENV=production DATABASE_URL=nulldb://nohost
bundle exec rake webpack:compile RAILS_ENV=production DATABASE_URL=nulldb://nohost
fi