build locales

This commit is contained in:
Pirate Praveen 2018-02-23 00:00:41 +05:30
parent b9f2d25561
commit f2d44084dc
5 changed files with 13 additions and 1 deletions

2
debian/gitlab.links vendored
View file

@ -5,6 +5,8 @@ var/lib/gitlab/node_modules usr/share/gitlab/node_modules
var/lib/gitlab/.ssh usr/share/gitlab/.ssh
var/lib/gitlab/.bundle usr/share/gitlab/.bundle
var/lib/gitlab/secrets.yml etc/gitlab/secrets.yml
var/lib/gitlab/locale usr/share/gitlab/app/assets/javascripts/locale
usr/share/gitlab/app/assets/javascripts/locale.static/index.js var/lib/gitlab/locale/index.js
var/log/gitlab usr/share/gitlab/log
var/log/gitlab/builds usr/share/gitlab/builds
run/gitlab usr/share/gitlab/tmp

1
debian/maintscript vendored
View file

@ -1,3 +1,4 @@
rm_conffile /etc/gitlab/initializers/devise_async.rb 8.8.2+dfsg-5 gitlab
rm_conffile /etc/gitlab/gitlab.teatro.yml 8.11.3+dfsg1-1 gitlab
rm_conffile /etc/gitlab/initializers/haml.rb 8.11.3+dfsg1-1 gitlab
dir_to_symlink /usr/share/gitlab/app/assets/javascripts/locale /var/lib/gitlab/locale 9.5.4+dfsg-5 gitlab

3
debian/postinst vendored
View file

@ -109,6 +109,9 @@ case "$1" in
# Create .bundle for .bundle/config
mkdir -p ${gitlab_data_dir}/.bundle
chown -R ${gitlab_user}: ${gitlab_data_dir}/.bundle
# Create locale for app/assets/javascripts/locale
mkdir -p ${gitlab_data_dir}/locale
chown -R ${gitlab_user}: ${gitlab_data_dir}/locale
# Create more required directories
for i in ${gitlab_repo_path} ${gitlab_cache_path} ${gitlab_uploads_path}\
${gitlab_pid_path} ${gitlab_log_dir} ${gitlab_shell_log} ${gitlab_builds_log}; do

View file

@ -28,16 +28,20 @@ runuser -u ${gitlab_user} -- sh -c 'bundle exec rake db:migrate'
# Restrict permissions for secret files
chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
echo "Installing node modules"
echo "Installing node modules..."
runuser -u ${gitlab_user} -- sh -c 'install -d /var/lib/gitlab/node_modules'
runuser -u ${gitlab_user} -- sh -c 'rm -rf node_modules/jquery'
runuser -u ${gitlab_user} -- sh -c 'npm install npm'
runuser -u ${gitlab_user} -- sh -c 'node_modules/.bin/npm install'
runuser -u ${gitlab_user} -- sh -c 'rm -rf node_modules/jquery'
# workaround for broken libjs-jquery-atwho #890391
# npm i at.js won't work as it needs jquery@^1.7.0 as peer dependency
runuser -u ${gitlab_user} -- sh -c 'wget -O /tmp/at.js.tar.gz `npm view at.js dist.tarball`'
runuser -u ${gitlab_user} -- sh -c 'tar -C node_modules --transform "s/package/at.js/" -zxf /tmp/at.js.tar.gz'
runuser -u ${gitlab_user} -- sh -c 'npm i document-register-element@1.3.0'
echo "Precompiling locales..."
runuser -u ${gitlab_user} -- sh -c 'bundle exec rake gettext:po_to_json'
echo "Webpacking..."
runuser -u ${gitlab_user} -- sh -c 'rm -rf node_modules/webpack'
runuser -u ${gitlab_user} -- sh -c 'NODE_PATH=/usr/share/gitlab/node_modules webpack --config config/webpack.config.js'

2
debian/rules vendored
View file

@ -8,6 +8,8 @@ override_dh_install:
# Make sure we are installing all required files in debian/install
sh debian/upstream-file-count-check.sh
rm -rf debian/gitlab/usr/share/gitlab/tmp/*
mv debian/gitlab/usr/share/gitlab/app/assets/javascripts/locale \
debian/gitlab/usr/share/gitlab/app/assets/javascripts/locale.static
mv debian/gitlab/var/lib/gitlab/db/schema.rb debian/gitlab/var/lib/gitlab/db/schema.rb.template
override_dh_installinit: