mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-08 11:16:27 +02:00
Add dev/prod conditions in the nix files
This commit is contained in:
parent
b8e2af412e
commit
97fd8a16d4
3 changed files with 60 additions and 42 deletions
7
piston
7
piston
|
@ -12,8 +12,9 @@ IMAGE_NAME_DEV="piston"
|
|||
SUBCOMMAND="$1"
|
||||
shift
|
||||
|
||||
build_base(){
|
||||
CONTAINER_PATH="$(nix build ".#container" --no-link --json | jq '.[0].outputs.out' -r)"
|
||||
build_base() {
|
||||
container_flake_key=$([[ $1 == "dev" ]] && echo "devContainer" || echo "prodContainer")
|
||||
CONTAINER_PATH="$(nix build ".#$container_flake_key" --no-link --json | jq '.[0].outputs.out' -r)"
|
||||
echo "The image archive was created at: $CONTAINER_PATH"
|
||||
docker load -i $CONTAINER_PATH || exit 1
|
||||
docker tag "$IMAGE_NAME_DEV:$IMAGE_TAG" "$IMAGE_NAME:$IMAGE_TAG" || exit 1
|
||||
|
@ -64,7 +65,7 @@ case "$SUBCOMMAND" in
|
|||
echo "Removing the Nix volume if it exists"
|
||||
docker volume rm -f $DEV_VOLUME_NAME
|
||||
echo "Building the base docker image"
|
||||
build_base
|
||||
build_base dev
|
||||
echo "Installing the required node modules"
|
||||
docker run \
|
||||
--rm \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue