This commit is contained in:
Thomas Legay 2023-09-02 22:51:34 +02:00
parent efdd66373e
commit 5220958c0a
18 changed files with 61 additions and 112 deletions

View file

@ -11,12 +11,14 @@ install_package_dependency(){
}
get_git_source(){
[ -e /tmp/${APP} ] && rm -fr /tmp/${APP}
GIT_PATH=/tmp/${APP}
[ ! "$1" == "" ] && GIT_PATH=$1
[ -e ${GIT_PATH} ] && rm -fr ${GIT_PATH}
if [ "${GIT_VERSION}" = "last" ] ;
then
git clone --depth 1 ${DEPOT} /tmp/${APP}
git clone --depth 1 ${DEPOT} ${GIT_PATH}
else
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/${APP}
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} ${GIT_PATH}
fi
}
@ -28,20 +30,21 @@ configure_depot_yarn() {
configure_depot_nodejs() {
NODE_VERSION=16
[ ! "$1" == "" ] && NODE_VERSION=$1
DEB_FILE=/etc/apt/sources.list.d/nodesource.list
XNODE_VERSION=${NODE_VERSION}.x
grep -q ${XNODE_VERSION} /etc/apt/sources.list.d/nodesource.list
if [ $? -ne 0 ]
if [ -e ${DEB_FILE} ] && [ $(grep -c ${XNODE_VERSION} ${DEB_FILE}) -ne 0 ]
then
wget -qO - https://deb.nodesource.com/setup_${XNODE_VERSION} | bash
fi
wget -qO - https://deb.nodesource.com/setup_${XNODE_VERSION} | bash
echo -e "Package: nodejs\\nPin: version ${NODE_VERSION}.*\\nPin-Priority: 1000" > /etc/apt/preferences.d/nodejs
}
install_go() {
GO_VERSION=1.20.6
GO_VERSION=1.20.7
[ ! "$1" == "" ] && GO_VERSION=$1
PATH=$PATH:/usr/local/go/bin
if [ ! "$(go version)" == "go version go${GO_VERSION} linux/amd64" ] ;
if [ -e /usr/local/go/bin/go ] || [ ! "$(go version)" == "go version go${GO_VERSION} linux/amd64" ] ;
then
rm -rvf /usr/local/go/
wget -qO - https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xz