oginstaller/python-installer/oginstaller.sh

47 lines
1002 B
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
}
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/
}
create_questions() {
echo "Creating questions..."
python3 /tmp/oginstall/oginstaller.py
}
install_packages
download_installer
extract_installer
create_questions