Moving gvm
This commit is contained in:
parent
4bfc7c98df
commit
2c84b8c064
|
@ -234,7 +234,7 @@ GIT_DOMAIN_REPO="https://github.com/gogits/gogs"
|
|||
GIT_ADMIN_PASSWORD=
|
||||
GOGS_COMMIT='3fb4f7f4980b4339fd9ef6a3ba5b0acab83d264d'
|
||||
GO_PACKAGE_MANAGER_REPO="https://github.com/gpmgo/gopm"
|
||||
GVM_HOME=$HOME/.gvm
|
||||
GVM_HOME=/home/git/.gvm
|
||||
GVM_REPO="https://github.com/moovweb/gvm"
|
||||
GVM_COMMIT='25ea8ae158e2861c92e2b22c458e60840157832f'
|
||||
|
||||
|
@ -6368,6 +6368,12 @@ function upgrade_golang {
|
|||
# TODO: this script is all over the place
|
||||
# and contains hardcoded github. See if you can do better
|
||||
./binscripts/gvm-installer
|
||||
|
||||
if [ ! -d /home/git ]; then
|
||||
# add a gogs user account within which the gvm home directory will exist
|
||||
adduser --disabled-login --gecos 'Gogs' git
|
||||
fi
|
||||
|
||||
export GVM_ROOT=$GVM_HOME
|
||||
[[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
|
||||
if [ ! -f $GVM_ROOT/bin/gvm ]; then
|
||||
|
@ -6388,6 +6394,8 @@ function upgrade_golang {
|
|||
fi
|
||||
gvm use go${GO_VERSION} --default
|
||||
|
||||
chown -R git:git $GVM_HOME
|
||||
|
||||
if ! grep -q "gvm commit" $COMPLETION_FILE; then
|
||||
echo "gvm commit:$GVM_COMMIT" >> $COMPLETION_FILE
|
||||
else
|
||||
|
@ -6416,20 +6424,15 @@ function install_gogs {
|
|||
|
||||
# http://gogs.io/docs/installation/install_from_source.md
|
||||
|
||||
if [ ! -d /home/git ]; then
|
||||
# add a gogs user account
|
||||
adduser --disabled-login --gecos 'Gogs' git
|
||||
fi
|
||||
|
||||
if [ -d $GOPATH/src/github.com/gogits ]; then
|
||||
rm -rf $GOPATH/src/github.com/gogits
|
||||
fi
|
||||
|
||||
if [ -d /home/gogs ]; then
|
||||
userdel -r gogs
|
||||
fi
|
||||
if [ -d /home/gogs ]; then
|
||||
rm -rf /home/gogs
|
||||
fi
|
||||
|
||||
# add a gogs user account
|
||||
adduser --disabled-login --gecos 'Gogs' git
|
||||
|
||||
# install Go
|
||||
apt-get -y install golang libpam0g-dev
|
||||
if ! grep -q "export GOPATH=" ~/.bashrc; then
|
||||
|
@ -6544,7 +6547,7 @@ function install_gogs {
|
|||
sed -i 's|#After=mysqld.service|After=mysqld.service|g' /etc/systemd/system/gogs.service
|
||||
sed -i "s|WorkingDirectory=.*|WorkingDirectory=$GOPATH/src/github.com/gogits/gogs|g" /etc/systemd/system/gogs.service
|
||||
sed -i "s|ExecStart=.*|ExecStart=$GOPATH/src/github.com/gogits/gogs/gogs web|g" /etc/systemd/system/gogs.service
|
||||
sed -i "s|Environment.*|Environment=\"USER=git\" \"HOME=/home/git\" \"GOPATH=$GOPATH\"|g" /etc/systemd/system/gogs.service
|
||||
sed -i "s|Environment.*|Environment=\"USER=git\" \"HOME=/home/git\" \"GOPATH=$GOPATH\" \"GVM_ROOT=/home/git/.gvm\"|g" /etc/systemd/system/gogs.service
|
||||
systemctl enable gogs
|
||||
systemctl daemon-reload
|
||||
systemctl restart gogs
|
||||
|
@ -10257,7 +10260,7 @@ function install_ipfs {
|
|||
echo "WorkingDirectory=/home/$MY_USERNAME" >> /etc/systemd/system/ipfs.service
|
||||
echo "ExecStart=$IPFS_PATH/ipfs daemon --mount" >> /etc/systemd/system/ipfs.service
|
||||
echo 'Restart=on-failure' >> /etc/systemd/system/ipfs.service
|
||||
echo "Environment=\"USER=$MY_USERNAME\" \"HOME=/home/$MY_USERNAME\" \"GOPATH=$GOPATH\"" >> /etc/systemd/system/ipfs.service
|
||||
echo "Environment=\"USER=$MY_USERNAME\" \"HOME=/home/$MY_USERNAME\" \"GOPATH=$GOPATH\" \"GVM_ROOT=/home/git/.gvm\"" >> /etc/systemd/system/ipfs.service
|
||||
echo '' >> /etc/systemd/system/ipfs.service
|
||||
echo '[Install]' >> /etc/systemd/system/ipfs.service
|
||||
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/ipfs.service
|
||||
|
|
Loading…
Reference in New Issue