You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo"Please make sure that you are running this script as the gogs user"
77
+
exit 1
78
+
fi
79
+
80
+
########## Version check
81
+
gogs_version=$(./$gogs_binary --version)
82
+
original_IFS=$IFS
83
+
IFS="."&& current_version=(${gogs_version#"Gogs version "}) && minimal_version=($tested_gogs_version)
84
+
IFS=$original_IFS
85
+
86
+
count=0
87
+
foriin"${current_version[@]}"
88
+
do
89
+
if [ $i-gt${minimal_version[$count]} ];then
90
+
echo -e "!!!--WARNING--!!!\nYour $gogs_version is newer than the tested Gogs version $tested_gogs_version\nUse this script on your own risk\n!!!--WARNING--!!!"
91
+
break
92
+
fi
93
+
let count+=1
94
+
done
95
+
96
+
########## Disclaimer
97
+
continueYN "This migration script creates a backup before it starts with the actual migration
98
+
If something goes wrong you could always resotre this backup.
99
+
The backups are stored into your gogs folder in gogs-dump-[timestamp].zip file
100
+
101
+
Migrating from gogs to gitea, are you sure?"
102
+
103
+
########## gogs dump
104
+
echo"Creating a backup of gogs, this could take a while..."
105
+
./"$gogs_binary" dump
106
+
exitOnError "Failed to create a gogs dump"
107
+
108
+
########## Create Gitea folder
109
+
if [ -z"$gitea_path" ];then
110
+
echo"Where do you want to install Gitea?"
111
+
read gitea_path
112
+
fi
113
+
114
+
if [ !-d"$gitea_path" ];then
115
+
mkdir -p "$gitea_path"
116
+
exitOnError
117
+
fi
118
+
119
+
if [ "$(ls -A $gitea_path)" ];then
120
+
continueYN "!!!--WARNING--!!!\nDirectory $gitea_path is not empty, do you want to continue?"
121
+
fi
122
+
123
+
124
+
########## Download Gitea
125
+
if [ $download_gitea==true ];then
126
+
127
+
########## Detect os
128
+
case"$OSTYPE"in
129
+
darwin*) platform="darwin-10.6";;
130
+
linux*) platform="linux" ;;
131
+
freebsd*) platform="bsd" ;;
132
+
netbsd*) platform="bsd" ;;
133
+
openbsd*) platform="bsd" ;;
134
+
*) echo"Unsupported os: $OSTYPE\n Please download/compile your own binary and run this script with the -b option"exit 1;;
135
+
esac
136
+
137
+
arch=""
138
+
bits=""
139
+
if [[ "$platform"=="linux" ]] || [[ "$platform"=="bsd" ]];then
140
+
arch="$(uname -m | sed -e 's/arm\(.*\)/arm-\1/' -e s/aarch64.*/arm64/)"
141
+
fi
142
+
143
+
if [[ "$platform"=="bsd" ]] && [[ "$arch"!="arm"* ]];then
144
+
echo"Currently Gitea only supports arm prebuilt binarys on bsd"
145
+
exit 1
146
+
fi
147
+
148
+
if [[ "$arch"!="arm"* ]] && [[ "$arch"!="mips"* ]];then
0 commit comments