aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorlizyn <zhiylin@outlook.com>2020-02-24 10:04:13 +0800
committerGitHub <noreply@github.com>2020-02-24 10:04:13 +0800
commitb19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch)
treed0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /scripts
parent4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff)
parent04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff)
downloadwallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip
Merge pull request #1 from wallabag/master
Keep up with the master again
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dev.sh17
-rwxr-xr-xscripts/install.sh25
-rwxr-xr-xscripts/release.sh4
-rwxr-xr-xscripts/require.sh2
-rwxr-xr-xscripts/update.sh30
5 files changed, 56 insertions, 22 deletions
diff --git a/scripts/dev.sh b/scripts/dev.sh
index 0703ced1..cc465cf9 100755
--- a/scripts/dev.sh
+++ b/scripts/dev.sh
@@ -3,11 +3,18 @@
3# eg: `sh dev.sh` 3# eg: `sh dev.sh`
4 4
5COMPOSER_COMMAND='composer' 5COMPOSER_COMMAND='composer'
6REQUIRE_FILE='scripts/require.sh'
6 7
7DIR="${BASH_SOURCE}" 8if [ ! -f "$REQUIRE_FILE" ]; then
8if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi 9 echo "Cannot find $REQUIRE_FILE"
9. "$DIR/require.sh" 10 exit 1
11fi
12
13. "$REQUIRE_FILE"
10 14
11$COMPOSER_COMMAND install 15$COMPOSER_COMMAND install
12php bin/console wallabag:install 16if [ -z "$SKIP_WALLABAG_INITIALIZATION" ]
13php bin/console server:run 17then
18 php bin/console wallabag:install
19fi
20php bin/console server:run $HOST
diff --git a/scripts/install.sh b/scripts/install.sh
index 8b7ea03f..affa715f 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -5,9 +5,17 @@
5IGNORE_ROOT_ARG="--ignore-root-warning" 5IGNORE_ROOT_ARG="--ignore-root-warning"
6IGNORE_ROOT=0 6IGNORE_ROOT=0
7 7
8if [ "$1" == "$IGNORE_ROOT_ARG" ]; then 8while :; do
9 IGNORE_ROOT=1 9 case $1 in
10fi 10 $IGNORE_ROOT_ARG) IGNORE_ROOT=1
11 ;;
12 *[a-zA-Z]) ENV=$1
13 ;;
14 *) break
15 ;;
16 esac
17 shift
18done
11 19
12# Abort running this script if root 20# Abort running this script if root
13if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then 21if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
@@ -17,12 +25,15 @@ if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
17fi 25fi
18 26
19COMPOSER_COMMAND='composer' 27COMPOSER_COMMAND='composer'
28REQUIRE_FILE='scripts/require.sh'
29
30if [ ! -f "$REQUIRE_FILE" ]; then
31 echo "Cannot find $REQUIRE_FILE"
32 exit 1
33fi
20 34
21DIR="${BASH_SOURCE}" 35. "$REQUIRE_FILE"
22if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
23. "$DIR/require.sh"
24 36
25ENV=$1
26TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) 37TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
27 38
28git checkout $TAG 39git checkout $TAG
diff --git a/scripts/release.sh b/scripts/release.sh
index ee08a688..e697e220 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -9,8 +9,8 @@ ENV=$4
9 9
10rm -rf $TMP_FOLDER/$RELEASE_FOLDER 10rm -rf $TMP_FOLDER/$RELEASE_FOLDER
11mkdir $TMP_FOLDER/$RELEASE_FOLDER 11mkdir $TMP_FOLDER/$RELEASE_FOLDER
12git clone git@github.com:wallabag/wallabag.git -b release-$VERSION $TMP_FOLDER/$RELEASE_FOLDER/$VERSION 12git clone git@github.com:wallabag/wallabag.git $TMP_FOLDER/$RELEASE_FOLDER/$VERSION
13cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && SYMFONY_ENV=$ENV COMPOSER_MEMORY_LIMIT=-1 composer up -n --no-dev 13cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && SYMFONY_ENV=$ENV COMPOSER_MEMORY_LIMIT=-1 composer install -n --no-dev
14cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console wallabag:install --env=$ENV -n 14cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console wallabag:install --env=$ENV -n
15cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console assets:install --env=$ENV --symlink --relative 15cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console assets:install --env=$ENV --symlink --relative
16cd $TMP_FOLDER/$RELEASE_FOLDER && tar czf wallabag-$VERSION.tar.gz --exclude="var/cache/*" --exclude="var/logs/*" --exclude="var/sessions/*" --exclude=".git" $VERSION 16cd $TMP_FOLDER/$RELEASE_FOLDER && tar czf wallabag-$VERSION.tar.gz --exclude="var/cache/*" --exclude="var/logs/*" --exclude="var/sessions/*" --exclude=".git" $VERSION
diff --git a/scripts/require.sh b/scripts/require.sh
index c48ab936..63c38132 100755
--- a/scripts/require.sh
+++ b/scripts/require.sh
@@ -1,6 +1,6 @@
1#! /usr/bin/env bash 1#! /usr/bin/env bash
2# File used to check dependencies
3 2
3# Check for composer
4if [ ! -f composer.phar ]; then 4if [ ! -f composer.phar ]; then
5 echo "composer.phar not found, we'll see if composer is installed globally." 5 echo "composer.phar not found, we'll see if composer is installed globally."
6 command -v composer >/dev/null 2>&1 || { echo >&2 "wallabag requires composer but it's not installed (see http://doc.wallabag.org/en/master/user/installation.html). Aborting."; exit 1; } 6 command -v composer >/dev/null 2>&1 || { echo >&2 "wallabag requires composer but it's not installed (see http://doc.wallabag.org/en/master/user/installation.html). Aborting."; exit 1; }
diff --git a/scripts/update.sh b/scripts/update.sh
index c62d104a..1f31d429 100755
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -5,9 +5,17 @@
5IGNORE_ROOT_ARG="--ignore-root-warning" 5IGNORE_ROOT_ARG="--ignore-root-warning"
6IGNORE_ROOT=0 6IGNORE_ROOT=0
7 7
8if [ "$1" == "$IGNORE_ROOT_ARG" ]; then 8while :; do
9 IGNORE_ROOT=1 9 case $1 in
10fi 10 $IGNORE_ROOT_ARG) IGNORE_ROOT=1
11 ;;
12 *[a-zA-Z]) ENV=$1
13 ;;
14 *) break
15 ;;
16 esac
17 shift
18done
11 19
12# Abort running this script if root 20# Abort running this script if root
13if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then 21if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
@@ -20,12 +28,20 @@ set -e
20set -u 28set -u
21 29
22COMPOSER_COMMAND='composer' 30COMPOSER_COMMAND='composer'
31REQUIRE_FILE='scripts/require.sh'
32
33if [ ! -f "$REQUIRE_FILE" ]; then
34 echo "Cannot find $REQUIRE_FILE"
35 exit 1
36fi
23 37
24DIR="${BASH_SOURCE}" 38. "$REQUIRE_FILE"
25if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
26. "$DIR/require.sh"
27 39
28ENV=$1 40# Check for wallabag .git folder
41if [ ! -d .git ]; then
42 echo "Can not update because wallabag wasn't installed using git (see https://doc.wallabag.org/en/admin/upgrade.html#upgrade-on-a-shared-hosting). Aborting.";
43 exit 2;
44fi
29 45
30rm -rf var/cache/* 46rm -rf var/cache/*
31git fetch origin 47git fetch origin