diff --git a/build.ps1 b/build.ps1 index 840d9a4..0303c5f 100755 --- a/build.ps1 +++ b/build.ps1 @@ -1,6 +1,12 @@ # This script will run docker-compose-generator in a container to generate the yml files -docker pull btcpayserver/docker-compose-generator +If (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } +If($BTCPAYGEN_DOCKER_IMAGE -eq "btcpayserver/docker-compose-generator:local"){ + docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE +} Else { + docker pull $BTCPAYGEN_DOCKER_IMAGE +} + docker run -v "$(Get-Location)\Generated:/app/Generated" ` -v "$(Get-Location)\docker-compose-generator\docker-fragments:/app/docker-fragments" ` -e "BTCPAYGEN_CRYPTO1=$BTCPAYGEN_CRYPTO1" ` @@ -16,7 +22,7 @@ docker run -v "$(Get-Location)\Generated:/app/Generated" ` -e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" ` -e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" ` -e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" ` - --rm btcpayserver/docker-compose-generator + --rm $BTCPAYGEN_DOCKER_IMAGE If ($BTCPAYGEN_REVERSEPROXY -eq "nginx") { Copy-Item ".\Production\nginx.tmpl" -Destination ".\Generated" diff --git a/build.sh b/build.sh index 62b1a65..b0d1b24 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,13 @@ #!/bin/bash +if [ "$BTCPAYGEN_DOCKER_IMAGE" == "btcpayserver/docker-compose-generator:local" ] +then + docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE +else + docker pull ${BTCPAYGEN_DOCKER_IMAGE:-"btcpayserver/docker-compose-generator"} +fi + # This script will run docker-compose-generator in a container to generate the yml files -docker pull btcpayserver/docker-compose-generator docker run -v "$(pwd)/Generated:/app/Generated" \ -v "$(pwd)/docker-compose-generator/docker-fragments:/app/docker-fragments" \ -e "BTCPAYGEN_CRYPTO1=$BTCPAYGEN_CRYPTO1" \ @@ -17,7 +23,7 @@ docker run -v "$(pwd)/Generated:/app/Generated" \ -e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" \ -e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" \ -e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" \ - --rm btcpayserver/docker-compose-generator + --rm ${BTCPAYGEN_DOCKER_IMAGE:-"btcpayserver/docker-compose-generator"} if [ "$BTCPAYGEN_REVERSEPROXY" == "nginx" ]; then cp Production/nginx.tmpl Generated/nginx.tmpl