Fix parameters in netlify cli script (#2258)

* Fix parameters in netlify cli script
* Use node-modules linker when deploying to netlify

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-07-31 00:39:49 +02:00 committed by GitHub
parent 27fc0764fa
commit b008cac781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 8 deletions

View file

@ -34,6 +34,9 @@ jobs:
with: with:
node-version: 18 node-version: 18
- name: Patch files
run: bash netlify/patch-files.sh
- name: Install dependencies - name: Install dependencies
run: yarn install --immutable run: yarn install --immutable

View file

@ -34,6 +34,9 @@ jobs:
with: with:
node-version: 18 node-version: 18
- name: Patch files
run: bash netlify/patch-files.sh
- name: Install dependencies - name: Install dependencies
run: yarn install --immutable run: yarn install --immutable

View file

@ -6,12 +6,11 @@
# SPDX-License-Identifier: AGPL-3.0-only # SPDX-License-Identifier: AGPL-3.0-only
# #
cd "$(dirname "$0")" json=$($(dirname "$0")/netlify-cli.sh deploy --build --prod --json --message "${1:0:8}: $2")
json=$(./netlify-cli.sh deploy --build --prod --json --message "${1:0:8}: $2")
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error while executing netlify! Will try again without json..." echo "Error while executing netlify! Will try again without json..."
./netlify-cli.sh deploy --build --prod --message "${1:0:8}: $2" $(dirname "$0")/netlify-cli.sh deploy --build --prod --message "${1:0:8}: $2"
exit 1 exit 1
fi fi

View file

@ -6,12 +6,11 @@
# SPDX-License-Identifier: AGPL-3.0-only # SPDX-License-Identifier: AGPL-3.0-only
# #
cd "$(dirname "$0")" json=$($(dirname "$0")/netlify-cli.sh deploy --build --context deploy-preview --alias "$1" --json --message "[#$1] $2")
json=$(./netlify-cli.sh deploy --build --context deploy-preview --alias "$1" --json --message "[#$1] $2")
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error while executing netlify! Will try again without json..." echo "Error while executing netlify! Will try again without json..."
./netlify-cli.sh deploy --build --context deploy-preview --alias "$1" --message "[#$1] $2" $(dirname "$0")/netlify-cli.sh deploy --build --context deploy-preview --alias "$1" --message "[#$1] $2"
exit 1 exit 1
fi fi

View file

@ -7,4 +7,4 @@
# #
NETLIFY_VERSION=10.13.0 NETLIFY_VERSION=10.13.0
exec npx --yes netlify-cli@${NETLIFY_VERSION} exec npx --yes netlify-cli@${NETLIFY_VERSION} $@

View file

@ -7,6 +7,8 @@
set -e set -e
echo 'Patch yarnrc to use node_modules'
sed -i "s/nodeLinker: pnp/nodeLinker: node-modules/" .yarnrc.yml
echo 'Patch intro.md to include netlify banner.' echo 'Patch intro.md to include netlify banner.'
cp netlify/intro.md public/mock-public/intro.md cp netlify/intro.md public/mock-public/intro.md
echo 'Patch motd.md to include privacy policy.' echo 'Patch motd.md to include privacy policy.'

View file

@ -4,7 +4,7 @@
"license": "AGPL-3.0", "license": "AGPL-3.0",
"scripts": { "scripts": {
"build": "next build", "build": "next build",
"build:netlify": "bash netlify/patch-files.sh && cross-env NEXT_PUBLIC_IGNORE_IFRAME_ORIGIN_CONFIG=true yarn build:mock", "build:netlify": "cross-env NEXT_PUBLIC_IGNORE_IFRAME_ORIGIN_CONFIG=true yarn build:mock",
"build:mock": "cross-env NEXT_PUBLIC_USE_MOCK_API=true next build", "build:mock": "cross-env NEXT_PUBLIC_USE_MOCK_API=true next build",
"build:test": "cross-env NEXT_PUBLIC_USE_MOCK_API=true NEXT_PUBLIC_TEST_MODE=true next build", "build:test": "cross-env NEXT_PUBLIC_USE_MOCK_API=true NEXT_PUBLIC_TEST_MODE=true next build",
"build:for-real-backend": "cross-env NEXT_PUBLIC_USE_MOCK_API=false NEXT_PUBLIC_BACKEND_BASE_URL=/ next build", "build:for-real-backend": "cross-env NEXT_PUBLIC_USE_MOCK_API=false NEXT_PUBLIC_BACKEND_BASE_URL=/ next build",