Browse Source

Merge pull request #615 from nextcloud/chore/remove-update-script

Chore/remove update script
pull/616/head
Kate 1 year ago committed by GitHub
parent
commit
525314efaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      tool/Dockerfile.dev
  2. 38
      tool/update.sh

6
tool/Dockerfile.dev

@ -12,9 +12,9 @@ RUN OC_PASS="user1" ./occ user:add --password-from-env --display-name "User One"
RUN OC_PASS="user2" ./occ user:add --password-from-env --display-name "User Two" user2
RUN OC_PASS="demo" ./occ user:add --password-from-env --display-name "Demo" demo
RUN ./occ app:install news --force --allow-unstable # 21.2.0
RUN ./occ app:install notes --force --allow-unstable # 4.8.0
RUN ./occ app:install uppush --force --allow-unstable # 1.4.0
RUN ./occ app:install --force --allow-unstable news
RUN ./occ app:install --force --allow-unstable notes
RUN ./occ app:install --force --allow-unstable uppush
RUN ./occ app:enable password_policy
RUN (sh /entrypoint.sh php -S 0.0.0.0:8080 &) && \

38
tool/update.sh

@ -1,38 +0,0 @@
#!/bin/bash
set -euxo pipefail
cd "$(dirname "$0")/.."
if [[ "$1" == "flutter" ]]; then
flutter_channel="stable"
flutter_version="$(curl https://raw.githubusercontent.com/fluttertools/fvm/main/releases_linux.json | jq -r "[.releases[] | select(.channel==\"$flutter_channel\")][0].version")"
yes | fvm use --force "$flutter_version@$flutter_channel" || true
dart_version="$(fvm flutter --version --machine | jq -r ".dartSdkVersion")"
dart_version_major="$(echo "$dart_version" | cut -d "." -f 1)"
dart_version_minor="$(echo "$dart_version" | cut -d "." -f 2)"
dart_version_next_major=$(( dart_version_major + 1 ))
find ./packages -name "pubspec.yaml" -exec sed -i "s/flutter: '>=.*'/flutter: '>=$flutter_version'/" {} \;
find ./packages -name "pubspec.yaml" -exec sed -i "s/sdk: '>=.* <.*'/sdk: '>=$dart_version_major.$dart_version_minor.0 <$dart_version_next_major.0.0'/" {} \;
melos exec flutter pub get
elif [[ "$1" == "dependencies" ]]; then
melos exec flutter pub upgrade --major-versions
melos exec flutter pub upgrade
elif [ -d "external/nextcloud-$1" ]; then
(
cd "external/nextcloud-$1"
git fetch --tags --force
latest_tag="$(git tag --sort=v:refname | grep -vi "rc" | grep -vi "alpha" | grep -vi "beta" | tail -n 1)"
git reset --hard "$latest_tag"
git submodule update
# shellcheck disable=SC2001
latest_version=$(echo "$latest_tag" | sed "s/^v//")
if [[ "$1" == "server" ]]; then
sed -i "s/FROM nextcloud:.*/FROM nextcloud:$latest_version/" ../../tool/Dockerfile.dev
else
sed -i "s/RUN \.\/occ app:install $1 .*/RUN .\/occ app:install $1 --force --allow-unstable # $latest_version/" ../../tool/Dockerfile.dev
fi
)
else
echo "$1 not found"
exit 1
fi
Loading…
Cancel
Save