-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: preview deploy * fix: preview deploy temporary fix * fix: file name * fix: update file permission
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
export VERSION="${1:?"Veuillez préciser la version"}" | ||
mode=${2:?"Veuillez préciser le mode <push|load>"} | ||
shift 2 | ||
|
||
get_channel() { | ||
local version="$1" | ||
channel=$(echo "$version" | cut -d '-' -f 2) | ||
|
||
if [ "$channel" == "$version" ]; then | ||
channel="latest" | ||
else | ||
channel=$(echo $channel | cut -d '.' -f 1 ) | ||
fi | ||
|
||
echo $channel | ||
} | ||
|
||
if [[ $# == "0" ]]; then | ||
echo "Veuillez spécifier les environnements à build (production, recette, preview, local)" | ||
exit 1; | ||
fi; | ||
|
||
set +e | ||
docker buildx create --name mna-lba --driver docker-container --config "$SCRIPT_DIR/buildkitd.toml" 2> /dev/null | ||
set -e | ||
|
||
if [[ ! -z "${CI:-}" ]]; then | ||
export DEPS_ID=($(md5sum $ROOT_DIR/yarn.lock)) | ||
else | ||
export DEPS_ID="" | ||
fi | ||
|
||
export CHANNEL=$(get_channel $VERSION) | ||
|
||
# "$@" is the list of environements | ||
docker buildx bake --builder mna-lba --${mode} "$@" | ||
docker builder prune --builder mna-lba --keep-storage 20GB --force | ||
docker buildx stop --builder mna-lba |
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