55 lines
1.2 KiB
Bash
55 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# Setup installer environment
|
|
|
|
|
|
BRANCH=${BRANCH:-main}
|
|
GIT_SSL_NO_VERIFY=1
|
|
GIT_REPO="https://ognproject.evlt.uma.es/gitea/api/v1/repos/opengnsys/oginstaller/archive/$BRANCH.zip"
|
|
export GIT_SSL_NO_VERIFY
|
|
|
|
|
|
|
|
install_packages() {
|
|
apt-get update
|
|
apt-get install -y curl jq unzip python3 python3-git
|
|
}
|
|
|
|
download_installer() {
|
|
|
|
rm -f /tmp/oginstaller.zip
|
|
rm -rf /tmp/oginstaller-$BRANCH
|
|
rm -rf /tmp/oginstaller
|
|
|
|
curl -q -k $GIT_REPO -H 'accept: application/json' -o /tmp/oginstaller.zip
|
|
unzip /tmp/oginstaller.zip -d /tmp
|
|
mv /tmp/oginstaller /tmp/oginstaller-$BRANCH
|
|
}
|
|
|
|
extract_installer() {
|
|
rm -rf /tmp/oginstall
|
|
mkdir -p /tmp/oginstall
|
|
cp -r /tmp/oginstaller-$BRANCH/python-installer/* /tmp/oginstall/
|
|
cp -r /tmp/oginstaller-$BRANCH/component-installer/* /tmp/oginstall/
|
|
chmod 755 /tmp/oginstall/*.sh
|
|
chmod 755 /tmp/oginstall/*.py
|
|
}
|
|
|
|
create_questions() {
|
|
echo "Creating questions..."
|
|
python3 /tmp/oginstall/oginstaller.py
|
|
}
|
|
|
|
launch_component_installer() {
|
|
echo "Launching component installer..."
|
|
/tmp/oginstall/component-installer.sh
|
|
}
|
|
|
|
|
|
install_packages
|
|
download_installer
|
|
extract_installer
|
|
create_questions
|
|
launch_component_installer
|
|
|