canvas-lms/Dockerfile.jenkins-cache

133 lines
4.7 KiB
Docker

# syntax = starlord.inscloudgate.net/jenkins/dockerfile:1.5.2
FROM starlord.inscloudgate.net/jenkins/core:focal
SHELL ["/usr/bin/bash", "-c"]
WORKDIR /tmp/src
RUN --mount=target=/tmp/src \
mkdir -p /tmp/dst && \
set -o errexit -o errtrace -o nounset -o pipefail && \
shopt -s globstar && \
tar --sort=name --mtime='1970-01-01' --owner=0 --group=0 --numeric-owner --mode='a+rwX' -cf - \
config/canvas_rails_switcher.rb \
Gemfile \
Gemfile*.lock \
Gemfile.d \
gems/gemfile_prefix.rb \
gems/**/Gemfile \
gems/**/Gemfile.lock \
gems/**/*.gemspec \
gems/**/gem_version.rb \
gems/**/version.rb \
gems/plugins/**/Gemfile.d \
vendor/gems/bundler-multilock \
\
| tee /tmp/dst/ruby-runner.tar | md5sum > /tmp/dst/ruby-runner.tar.md5 && \
\
tar --sort=name --mtime='1970-01-01' --owner=0 --group=0 --numeric-owner --mode='a+rwX' -cf - \
package.json \
yarn.lock \
gems/plugins/**/package.json \
ui/engine/**/package.json \
ui/shared/**/package.json \
packages/**/package.json \
\
| tee /tmp/dst/yarn-runner.tar | md5sum > /tmp/dst/yarn-runner.tar.md5 && \
\
tar --sort=name --mtime='1970-01-01' --owner=0 --group=0 --numeric-owner --mode='a+rwX' -cf - \
--exclude='**/__mocks__' \
--exclude='**/__tests__' \
--exclude='**/*.test.js' \
ui/engine \
packages \
\
| tee /tmp/dst/webpack-builder.tar | md5sum > /tmp/dst/webpack-builder.tar.md5 && \
\
tar --sort=name --mtime='1970-01-01' --owner=0 --group=0 --numeric-owner --mode='a+rwX' -cf - \
bin \
config/environments \
gems/{autoextend,canvas_color,canvas_text_helper,config_file,i18n_extraction,i18n_tasks,utf8_cleaner}/lib \
lib/canvas/cdn \
lib/rake \
lib/tasks \
ui-build \
\
config/application.rb \
config/boot.rb \
config/brandable_css.yml \
config/browsers.yml \
config/canvas_rails_switcher.rb \
config/environment.rb \
config/initializers/json.rb \
config/initializers/revved_asset_urls.rb \
db/migrate/*_regenerate_brand_files_based_on_new_defaults_*.rb \
gems/plugins/.i18n* \
lib/brandable_css.rb \
lib/canvas_logger.rb \
lib/logging_filter.rb \
lib/canvas/cdn.rb \
lib/base/canvas/reloader.rb \
.i18nignore \
.i18nrc \
Rakefile \
gulpfile.js \
rspack.config.js \
\
| tee /tmp/dst/webpack-runner-dependencies.tar | md5sum > /tmp/dst/webpack-runner-dependencies.tar.md5 && \
\
tar --sort=name --mtime='1970-01-01' --owner=0 --group=0 --numeric-owner --mode='a+rwX' -cf - \
--exclude='**/__mocks__' \
--exclude='**/__tests__' \
app/stylesheets \
config/locales \
gems/**/config/locales \
gems/plugins/**/app/coffeescripts \
gems/plugins/**/app/jsx \
gems/plugins/**/app/stylesheets \
gems/plugins/**/app/views/jst \
gems/plugins/**/public \
public \
ui \
\
| tee /tmp/dst/webpack-runner.tar | md5sum > /tmp/dst/webpack-runner.tar.md5 && \
\
tar --sort=name --mtime='1970-01-01' --owner=0 --group=0 --numeric-owner --mode='a+rwX' -cf - \
--exclude='vendor/qti_migration_tool' \
vendor \
\
| tee /tmp/dst/webpack-runner-vendor.tar | md5sum > /tmp/dst/webpack-runner-vendor.tar.md5 && \
\
{ \
if [ -d 'spec' ]; then \
tar --sort=name --mtime='1970-01-01' --owner=0 --group=0 --numeric-owner --mode='a+rwX' -cf - \
app/stylesheets \
config/brandable_css.yml \
config/browsers.yml \
gems/plugins/**/app/coffeescripts \
gems/plugins/**/app/jsx \
gems/plugins/**/app/stylesheets \
gems/plugins/**/public \
gems/plugins/**/spec_canvas/coffeescripts \
jest \
packages \
public \
spec/fixtures \
tmp \
ui \
ui-build \
jest.config.js \
karma.conf.js \
package.json \
tsconfig.json \
yarn.lock \
\
| tee /tmp/dst/js.tar | md5sum > /tmp/dst/js.tar.md5; \
fi \
} && \
touch /tmp/dst/environment.sh && \
echo "RUBY_RUNNER_MD5=$(cat /tmp/dst/ruby-runner.tar.md5 | cut -d' ' -f1)" >> /tmp/dst/environment.sh && \
echo "YARN_RUNNER_MD5=$(cat /tmp/dst/yarn-runner.tar.md5 | cut -d' ' -f1)" >> /tmp/dst/environment.sh && \
echo "WEBPACK_BUILDER_MD5=$(cat /tmp/dst/webpack-builder.tar.md5 | cut -d' ' -f1)" >> /tmp/dst/environment.sh && \
echo "WEBPACK_RUNNER_MD5=$(cat /tmp/dst/webpack-runner.tar.md5 | cut -d' ' -f1)" >> /tmp/dst/environment.sh && \
echo "WEBPACK_RUNNER_DEPENDENCIES_MD5=$(cat /tmp/dst/webpack-runner-dependencies.tar.md5 | cut -d' ' -f1)" >> /tmp/dst/environment.sh && \
echo "WEBPACK_RUNNER_VENDOR_MD5=$(cat /tmp/dst/webpack-runner-vendor.tar.md5 | cut -d' ' -f1)" >> /tmp/dst/environment.sh