From 08bc7667fc45311cd7daf9c23f684892cb6342fd Mon Sep 17 00:00:00 2001 From: Andrew Camilleri Date: Mon, 17 Sep 2018 10:20:49 +0200 Subject: [PATCH 1/4] allow to specify generator image when building --- build.ps1 | 3 ++- build.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 840d9a4..89ed908 100755 --- a/build.ps1 +++ b/build.ps1 @@ -1,6 +1,7 @@ # This script will run docker-compose-generator in a container to generate the yml files +if (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } -docker pull btcpayserver/docker-compose-generator +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" ` diff --git a/build.sh b/build.sh index 62b1a65..eba13bd 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash # This script will run docker-compose-generator in a container to generate the yml files -docker pull btcpayserver/docker-compose-generator +docker pull ${BTCPAYGEN_DOCKER_IMAGE:-"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" \ From 6f2865617d7d8f4725ffd26f7eaf9dd6a030daae Mon Sep 17 00:00:00 2001 From: Andrew Camilleri Date: Sun, 16 Sep 2018 18:29:38 +0200 Subject: [PATCH 2/4] run cusom image as well --- build.ps1 | 2 +- build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 89ed908..d02efbd 100755 --- a/build.ps1 +++ b/build.ps1 @@ -17,7 +17,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 eba13bd..7f82e69 100755 --- a/build.sh +++ b/build.sh @@ -17,7 +17,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 From add439ddfac7a3af4d7f41d2dcaf12cfa63eed0d Mon Sep 17 00:00:00 2001 From: Andrew Camilleri Date: Tue, 25 Sep 2018 10:17:55 +0200 Subject: [PATCH 3/4] allow way to build a local generator image instead of relying of existing one --- build.ps1 | 9 +++++++-- build.sh | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index d02efbd..3c4da33 100755 --- a/build.ps1 +++ b/build.ps1 @@ -1,7 +1,12 @@ # This script will run docker-compose-generator in a container to generate the yml files -if (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } -docker pull $BTCPAYGEN_DOCKER_IMAGE: +If (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } +If($BTCPAYGEN_DOCKER_IMAGE -eq "build"){ + docker build docker-compose-generator --tag build +} 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" ` diff --git a/build.sh b/build.sh index 7f82e69..2820aaa 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,13 @@ #!/bin/bash +if [ "$BTCPAYGEN_DOCKER_IMAGE" == "build" ] +then + docker build docker-compose-generator --tag build +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 ${BTCPAYGEN_DOCKER_IMAGE:-"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" \ From a756f91c1c22e4e3d3d912ed9e4326d5e682f2cb Mon Sep 17 00:00:00 2001 From: Andrew Camilleri Date: Sat, 29 Sep 2018 18:03:09 +0200 Subject: [PATCH 4/4] pr changes --- build.ps1 | 6 +++--- build.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.ps1 b/build.ps1 index 3c4da33..0303c5f 100755 --- a/build.ps1 +++ b/build.ps1 @@ -1,10 +1,10 @@ # This script will run docker-compose-generator in a container to generate the yml files If (-not ($BTCPAYGEN_DOCKER_IMAGE)) { $BTCPAYGEN_DOCKER_IMAGE = "btcpayserver/docker-compose-generator" } -If($BTCPAYGEN_DOCKER_IMAGE -eq "build"){ - docker build docker-compose-generator --tag build +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 pull $BTCPAYGEN_DOCKER_IMAGE } docker run -v "$(Get-Location)\Generated:/app/Generated" ` diff --git a/build.sh b/build.sh index 2820aaa..b0d1b24 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,8 @@ #!/bin/bash -if [ "$BTCPAYGEN_DOCKER_IMAGE" == "build" ] +if [ "$BTCPAYGEN_DOCKER_IMAGE" == "btcpayserver/docker-compose-generator:local" ] then - docker build docker-compose-generator --tag build + docker build docker-compose-generator --tag $BTCPAYGEN_DOCKER_IMAGE else docker pull ${BTCPAYGEN_DOCKER_IMAGE:-"btcpayserver/docker-compose-generator"} fi