-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
88 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../upgrade.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#! /bin/bash | ||
set -eE | ||
|
||
abort() | ||
{ | ||
echo $1 | ||
exit 1 | ||
} | ||
|
||
echo " | ||
____ __ _ _ | ||
/ ___| __ _ / _| ___ | | (_) _ __ ___ | ||
\___ \ / _\` | | |_ / _ \ | | | | | '_ \ / _ \\ | ||
___) | | (_| | | _| | __/ | |___ | | | | | | | __/ | ||
|____/ \__,_| |_| \___| |_____| |_| |_| |_| \___| | ||
" | ||
|
||
if [[ "$#" -ne "0" ]]; then | ||
echo "Usage: run "$0" to set up Safeline CE at current working directory." | ||
exit 0 | ||
fi | ||
|
||
command -v docker > /dev/null || abort "docker not found, unable to deploy" | ||
compose_plugin=true | ||
compose_command="docker compose" | ||
docker --help | grep compose | grep v2 > /dev/null || compose_plugin=false || compose_command="docker-compose" | ||
|
||
if [[ "x${compose_plugin}" = "xfalse" ]]; then | ||
command -v docker-compose > /dev/null && docker-compose --version | grep v2 > /dev/null || abort "docker compose v2 not found, unable to deploy" | ||
fi | ||
|
||
COMPOSE_YAML="compose.yaml" | ||
wget https://waf-ce.chaitin.cn/release/latest/compose.yaml --no-check-certificate -O ${COMPOSE_YAML} | ||
|
||
ENV_FILE=".env" | ||
sed -i "s/IMAGE_TAG=.*/IMAGE_TAG=latest/g" ${ENV_FILE} | ||
|
||
$compose_command down && $compose_command pull && $compose_command up -d | ||
echo "Upgrade success!" |