|
@@ -38,7 +38,7 @@ GIT_ADMIN_PASSWORD=
|
38
|
38
|
GOGS_COMMIT='3fb4f7f4980b4339fd9ef6a3ba5b0acab83d264d'
|
39
|
39
|
|
40
|
40
|
function reconfigure_gogs {
|
41
|
|
- echo -n ''
|
|
41
|
+ echo -n ''
|
42
|
42
|
}
|
43
|
43
|
|
44
|
44
|
function upgrade_gogs {
|
|
@@ -146,7 +146,41 @@ function restore_local_gogs {
|
146
|
146
|
}
|
147
|
147
|
|
148
|
148
|
function backup_remote_gogs {
|
149
|
|
- echo -n ''
|
|
149
|
+ export GVM_ROOT=/home/git/gvm
|
|
150
|
+ if [ -d $GVM_ROOT/bin ]; then
|
|
151
|
+ cd $GVM_ROOT/bin
|
|
152
|
+ [[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
|
|
153
|
+ gvm use go${GO_VERSION} --default
|
|
154
|
+ systemctl set-environment GOPATH=$GOPATH
|
|
155
|
+ fi
|
|
156
|
+
|
|
157
|
+ if [ -d $GOPATH/src/github.com/gogits ]; then
|
|
158
|
+ GIT_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Gogs domain" | awk -F ':' '{print $2}')
|
|
159
|
+ function_check suspend_site
|
|
160
|
+ suspend_site ${GIT_DOMAIN_NAME}
|
|
161
|
+
|
|
162
|
+ function_check backup_database_to_friend
|
|
163
|
+ backup_database_to_friend gogs
|
|
164
|
+
|
|
165
|
+ echo $"Obtaining Gogs settings backup"
|
|
166
|
+
|
|
167
|
+ function_check backup_directory_to_friend
|
|
168
|
+ backup_directory_to_friend $GOPATH/src/github.com/gogits/gogs/custom gogs
|
|
169
|
+
|
|
170
|
+ echo $"Obtaining Gogs repos backup"
|
|
171
|
+
|
|
172
|
+ mv /home/git/gogs-repositories/*.git /home/git/gogs-repositories/bob
|
|
173
|
+ backup_directory_to_friend /home/git/gogs-repositories gogsrepos
|
|
174
|
+
|
|
175
|
+ echo $"Obtaining Gogs authorized_keys backup"
|
|
176
|
+
|
|
177
|
+ backup_directory_to_friend /home/git/.ssh gogsssh
|
|
178
|
+
|
|
179
|
+ function_check restart_site
|
|
180
|
+ restart_site
|
|
181
|
+
|
|
182
|
+ echo $"Gogs backup complete"
|
|
183
|
+ fi
|
150
|
184
|
}
|
151
|
185
|
|
152
|
186
|
function restore_remote_gogs {
|