Grid環境構築用のChefリポジトリです。
Revision | dc380910284e7a055d73868a48da3d96ffa0e329 (tree) |
---|---|
Zeit | 2022-01-04 17:11:16 |
Autor | whitestar <whitestar@user...> |
Commiter | whitestar |
add backup cron configuration.
@@ -1,5 +1,9 @@ | ||
1 | 1 | # bubbleupnp-server CHANGELOG |
2 | 2 | |
3 | +0.2.3 | |
4 | +----- | |
5 | +- add backup cron configuration. | |
6 | + | |
3 | 7 | 0.2.2 |
4 | 8 | ----- |
5 | 9 | - fix the restore script. |
@@ -86,7 +86,7 @@ override_attributes( | ||
86 | 86 | 'config' => { |
87 | 87 | 'services' => { |
88 | 88 | 'bubbleupnp-server' => { |
89 | - 'restart' => 'no', | |
89 | + 'restart' => 'unless-stopped', | |
90 | 90 | }, |
91 | 91 | }, |
92 | 92 | }, |
@@ -65,7 +65,7 @@ version_2_config = { | ||
65 | 65 | 'services' => { |
66 | 66 | 'bubbleupnp-server' => { |
67 | 67 | 'image' => '${REGISTRY}/${NAME}:${VER}', |
68 | - 'restart' => 'always', | |
68 | + 'restart' => 'unless-stopped', | |
69 | 69 | 'network_mode' => 'host', |
70 | 70 | 'volumes' => [ |
71 | 71 | # These volumes will be set by the bubbleupnp-server::docker-compose recipe automatically. |
@@ -26,8 +26,12 @@ app_dir = node['bubbleupnp-server']['docker-compose']['app_dir'] | ||
26 | 26 | data_dir = node['bubbleupnp-server']['docker-compose']['data_dir'] |
27 | 27 | dot_env = node['bubbleupnp-server']['docker-compose']['dot_env'] |
28 | 28 | |
29 | +file_owner = 'root' | |
30 | +file_group = 'root' | |
29 | 31 | workdir = '/usr/share/bubbleupnpserver' |
30 | 32 | if dot_env['VER'] > '0.9-5' || dot_env['VER'] == 'latest' |
33 | + file_owner = 'bubbleupnpserver' | |
34 | + file_group = 'users' | |
31 | 35 | workdir = '/opt/bubbleupnpserver' |
32 | 36 | end |
33 | 37 |
@@ -92,6 +96,8 @@ end | ||
92 | 96 | group 'root' |
93 | 97 | mode '0755' |
94 | 98 | variables( |
99 | + file_owner: file_owner, | |
100 | + file_group: file_group, | |
95 | 101 | workdir: workdir |
96 | 102 | ) |
97 | 103 | end |
@@ -14,3 +14,4 @@ APP_HOME=<%= node['bubbleupnp-server']['docker-compose']['app_dir'] %> | ||
14 | 14 | OPTS='<%= opts %>' |
15 | 15 | |
16 | 16 | @reboot root sleep <%= wait_time %> && date "$DATE_F" > $LOG && cd $APP_HOME && docker-compose $OPTS stop >> $LOG 2>&1 && docker-compose $OPTS up -d >> $LOG 2>&1 && docker-compose ps >> $LOG 2>&1 |
17 | +30 * * * * root date "$DATE_F" >> $LOG && cd $APP_HOME && ./backup.sh >> $LOG 2>&1 |
@@ -9,4 +9,4 @@ sudo docker cp ./${backup_dir}/cache ${container_id}:<%= @workdir %>/ | ||
9 | 9 | sudo docker cp ./${backup_dir}/Playlists ${container_id}:<%= @workdir %>/ |
10 | 10 | |
11 | 11 | # fix file owner |
12 | -sudo docker exec -u root ${container_id} chown -R bubbleupnpserver:users <%= @workdir %>/{configuration.xml,cache,Playlists} | |
12 | +sudo docker exec -u root ${container_id} chown -R <%= @file_owner %>:<%= @file_group %> <%= @workdir %>/{configuration.xml,cache,Playlists} |
@@ -1 +1 @@ | ||
1 | -0.2.2 | |
1 | +0.2.3 |