Skip to content
Snippets Groups Projects
Commit 9adb76fc authored by drebs's avatar drebs
Browse files

Create staging weblate repository and update hook.

Create a weblate staging repository by cloning from the weblate main
repository. A git post update hook is added to the main repository so
the staging repository always merges changes made to the main
repository.

Part of #12311.
parent 6e4ea273
No related tags found
No related merge requests found
......@@ -134,6 +134,35 @@ class tails::weblate (
user => root,
}
# Staging repository
#file { "${mutable_data_dir}/repositories/vcs/tails/index":
# ensure => directory,
# owner => weblate,
# group => weblate,
# mode => '2770',
#}
vcsrepo { "${mutable_data_dir}/staging":
# TODO: the creation of this repository depends on the existence of the
# main weblate git repository, which is currently not managed by puppet.
provider => git,
source => "${mutable_data_dir}/repositories/vcs/tails/index",
revision => $code_git_revision,
user => weblate,
#require => File["$mutable_data_dir/repositories/vcs/tails/index"],
}
file { "${mutable_data_dir}/repositories/vcs/tails/index/.git/hooks/post-update"
owner => weblate,
group => weblate_admin,
mode => '0770',
content => template('weblate/hooks/main/post-update.sh.erb'),
require => Vcsrepo["$${mutable_data_dir}/staging"],
# TODO: this should also require existence of the .git/hooks directory,
# which is currently not managed by puppet.
}
# Service
service { 'apache2':
......
#!/bin/sh
STAGING_PATH=<%= mutable_data_dir %>/staging
# import all changes from main weblate repo into staging repo
git -C ${STAGING_PATH} merge -S recursive -X theirs origin master
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment