mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
changed bash to sh
This commit is contained in:
parent
496ae1c28f
commit
0421353d68
5 changed files with 10 additions and 51 deletions
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
repoName='qminer/mrfrys-node-server'
|
|
||||||
|
|
||||||
function getContainerId() {
|
|
||||||
docker ps -a | grep -i "${repoName}" | xargs | cut -d' ' -f1
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDockerRepoId() {
|
|
||||||
docker images | grep "${repoName}" | xargs | cut -d' ' -f3
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$1" == "build" ]; then
|
|
||||||
docker build . -t qminer/mrfrys-node-server
|
|
||||||
elif [ "$1" == "rebuild" ]; then
|
|
||||||
docker rmi -f $(getDockerRepoId)
|
|
||||||
docker build . -t qminer/mrfrys-node-server
|
|
||||||
elif [ "$1" == "build" ]; then
|
|
||||||
docker build . -t qminer/mrfrys-node-server
|
|
||||||
elif [ "$1" == "stop" ]; then
|
|
||||||
docker stop $(getContainerId)
|
|
||||||
elif [ "$1" == "start" ]; then
|
|
||||||
# --entrypoint bash \
|
|
||||||
scripts/setup.sh
|
|
||||||
docker start $(getContainerId)
|
|
||||||
elif [ "$1" == "run" ]; then
|
|
||||||
# --entrypoint bash \
|
|
||||||
scripts/setup.sh
|
|
||||||
|
|
||||||
docker run \
|
|
||||||
--network host \
|
|
||||||
--mount src="$(pwd)/stats",target="/server/stats",type=bind \
|
|
||||||
--mount src="$(pwd)/data",target="/server/data",type=bind \
|
|
||||||
--mount src="$(pwd)/publicDirs",target="/server/publicDirs",type=bind \
|
|
||||||
--mount src="/etc/letsencrypt",target="/etc/letsencrypt",type=bind \
|
|
||||||
qminer/mrfrys-node-server
|
|
||||||
elif [ "$1" == "bash" ]; then
|
|
||||||
docker exec -it $(getContainerId) /bin/bash
|
|
||||||
else
|
|
||||||
echo 'params: "build" or "run"'
|
|
||||||
fi
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
baseDir=$(pwd)
|
baseDir=$(pwd)
|
||||||
domainPath="./data/domain"
|
domainPath="./data/domain"
|
||||||
|
|
||||||
hr() { [ -t 0 ] && printf '\033[0;32m%*s\033[0m\n' "$(tput cols)" '' | tr ' ' '='; }
|
hr() { [ -t 0 ] && printf '\033[0;32m%*s\033[0m\n' "$(tput cols)" '' | tr ' ' '='; }
|
||||||
|
|
||||||
log() { hr; echo -e "\033[0;34m${1}\033[0m"; hr; }
|
log() { hr; printf "\033[0;34m%s\033[0m" "${1}"; hr; }
|
||||||
|
|
||||||
error() { echo -e "\033[0;41m${1}\033[0m"; }
|
error() { printf "\033[0;41m%s\033[0m" "${1}"; }
|
||||||
|
|
||||||
checkFile() {
|
checkFile() {
|
||||||
if [ ! -f "${1}" ]; then
|
if [ ! -f "${1}" ]; then
|
||||||
|
@ -22,7 +22,7 @@ makeNextSubmodule() {
|
||||||
npm install
|
npm install
|
||||||
npm audit fix > /dev/null 2> /dev/null
|
npm audit fix > /dev/null 2> /dev/null
|
||||||
checkFile "make.sh"
|
checkFile "make.sh"
|
||||||
./make.sh || exit 1
|
npm run export || exit 1
|
||||||
npx --yes next telemetry disable
|
npx --yes next telemetry disable
|
||||||
cd "${baseDir}" || exit 1
|
cd "${baseDir}" || exit 1
|
||||||
# TODO: check if link exists
|
# TODO: check if link exists
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
gitDir=".git"
|
gitDir=".git"
|
||||||
gitmoduleFile=".gitmodules"
|
gitmoduleFile=".gitmodules"
|
||||||
sshGitmodulesFile=".gitmodules.ssh"
|
sshGitmodulesFile=".gitmodules.ssh"
|
||||||
httpsGitmodulesFile=".gitmodules.https"
|
httpsGitmodulesFile=".gitmodules.https"
|
||||||
|
|
||||||
function error() { echo -e "\033[0;41m${1}\033[0m"; exit 1; }
|
error() { printf "\033[0;41m%s\033[0m" "${1}"; exit 1; }
|
||||||
|
|
||||||
if [ ! -d "${gitDir}" ]; then
|
if [ ! -d "${gitDir}" ]; then
|
||||||
error "${gitDir} does not exist! Maybe you ran this script in the wrong directory"
|
error "${gitDir} does not exist! Maybe you ran this script in the wrong directory"
|
||||||
|
@ -15,8 +15,8 @@ if [ "$1" != "ssh" ] && [ "$1" != "https" ]; then
|
||||||
error "Invalid param! Valid params are: 'ssh', 'https'"
|
error "Invalid param! Valid params are: 'ssh', 'https'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "ssh" ]; then
|
if [ "$1" = "ssh" ]; then
|
||||||
cp -v "$sshGitmodulesFile" "$gitmoduleFile"
|
cp -v "$sshGitmodulesFile" "$gitmoduleFile"
|
||||||
elif [ "$1" == "https" ]; then
|
elif [ "$1" = "https" ]; then
|
||||||
cp -v "$httpsGitmodulesFile" "$gitmoduleFile"
|
cp -v "$httpsGitmodulesFile" "$gitmoduleFile"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit b854b035c7b9d3054f4e61ee32b8802b395477a2
|
Subproject commit fa8d2459a3f7d2c27a28dbc287525921876a3af1
|
|
@ -1 +1 @@
|
||||||
Subproject commit 50daae3cf1713b96626fa5a55638570a910f5294
|
Subproject commit a2c3d7c72f0d1df812cfff15ec3738cb4374a247
|
Loading…
Add table
Add a link
Reference in a new issue