(gradle) Make docker image registry and tag configurable

This is to enable running an external repository for production and test.

Use the ./gradle -Pdocker-registry=registry.foo.bar -Pdocker-tag=my-tag while building to accomplish this.  By default, use 'marginalia' for repository and 'latest' as tag.
This commit is contained in:
Viktor Lofgren 2023-11-16 21:12:55 +01:00
parent f58a9f46be
commit 98efb08e17
4 changed files with 17 additions and 17 deletions

View File

@ -10,7 +10,7 @@ x-svc: &service
services: services:
screenshot-capture-tool: screenshot-capture-tool:
<<: *service <<: *service
image: "marginalia.nu/screenshot-capture-tool" image: "marginalia/screenshot-capture-tool"
container_name: "screenshot-capture-tool" container_name: "screenshot-capture-tool"
networks: networks:
- wmsa - wmsa

View File

@ -53,27 +53,27 @@ x-p2: &partition-2
services: services:
index-service-1: index-service-1:
<<: *partition-1 <<: *partition-1
image: "registry.marginalia.nu/index-service" image: "marginalia/index-service"
container_name: "index-service-1" container_name: "index-service-1"
executor-service-1: executor-service-1:
<<: *partition-1 <<: *partition-1
image: "registry.marginalia.nu/executor-service" image: "marginalia/executor-service"
container_name: "executor-service-1" container_name: "executor-service-1"
index-service-2: index-service-2:
<<: *partition-2 <<: *partition-2
image: "registry.marginalia.nu/index-service" image: "marginalia/index-service"
container_name: "index-service-2" container_name: "index-service-2"
executor-service-2: executor-service-2:
<<: *partition-2 <<: *partition-2
image: "registry.marginalia.nu/executor-service" image: "marginalia/executor-service"
container_name: "executor-service-2" container_name: "executor-service-2"
query-service: query-service:
<<: *service <<: *service
image: "registry.marginalia.nu/query-service" image: "marginalia/query-service"
container_name: "query-service" container_name: "query-service"
search-service: search-service:
<<: *service <<: *service
image: "registry.marginalia.nu/search-service" image: "marginalia/search-service"
container_name: "search-service" container_name: "search-service"
expose: expose:
- 80 - 80
@ -87,7 +87,7 @@ services:
- "traefik.http.middlewares.add-public.addprefix.prefix=/public" - "traefik.http.middlewares.add-public.addprefix.prefix=/public"
assistant-service: assistant-service:
<<: *service <<: *service
image: "registry.marginalia.nu/assistant-service" image: "marginalia/assistant-service"
container_name: "assistant-service" container_name: "assistant-service"
expose: expose:
- 80 - 80
@ -105,7 +105,7 @@ services:
- "traefik.http.middlewares.add-public.addprefix.prefix=/public" - "traefik.http.middlewares.add-public.addprefix.prefix=/public"
api-service: api-service:
<<: *service <<: *service
image: "registry.marginalia.nu/api-service" image: "marginalia/api-service"
container_name: "api-service" container_name: "api-service"
expose: expose:
- "80" - "80"
@ -119,7 +119,7 @@ services:
- "traefik.http.middlewares.add-public.addprefix.prefix=/public" - "traefik.http.middlewares.add-public.addprefix.prefix=/public"
dating-service: dating-service:
<<: *service <<: *service
image: "registry.marginalia.nu/dating-service" image: "marginalia/dating-service"
container_name: "dating-service" container_name: "dating-service"
expose: expose:
- 80 - 80
@ -133,7 +133,7 @@ services:
- "traefik.http.middlewares.add-public.addprefix.prefix=/public" - "traefik.http.middlewares.add-public.addprefix.prefix=/public"
explorer-service: explorer-service:
<<: *service <<: *service
image: "registry.marginalia.nu/explorer-service" image: "marginalia/explorer-service"
container_name: "explorer-service" container_name: "explorer-service"
expose: expose:
- 80 - 80
@ -147,7 +147,7 @@ services:
- "traefik.http.middlewares.add-public.addprefix.prefix=/public" - "traefik.http.middlewares.add-public.addprefix.prefix=/public"
control-service: control-service:
<<: *service <<: *service
image: "registry.marginalia.nu/control-service" image: "marginalia/control-service"
container_name: "control-service" container_name: "control-service"
expose: expose:
- 80 - 80

View File

@ -45,7 +45,9 @@ dockerfileZip {
docker { docker {
dockerfile = tasks.dockerFile.outputs.files.singleFile dockerfile = tasks.dockerFile.outputs.files.singleFile
name = 'registry.marginalia.nu/'+application.applicationName+':latest'
name = (project.hasProperty('docker-registry') ? project.property('docker-registry') : 'marginalia')+'/'+application.applicationName+':'+(project.hasProperty('docker-tag') ? project.property('docker-tag') : 'latest')
files tasks.distTar.outputs, \ files tasks.distTar.outputs, \
project(':code:processes:crawling-process').distTar.outputs, \ project(':code:processes:crawling-process').distTar.outputs, \
project(':code:processes:loading-process').distTar.outputs, \ project(':code:processes:loading-process').distTar.outputs, \
@ -53,8 +55,6 @@ docker {
project(':code:processes:index-constructor-process').distTar.outputs, \ project(':code:processes:index-constructor-process').distTar.outputs, \
project(':code:processes:website-adjacencies-calculator').distTar.outputs project(':code:processes:website-adjacencies-calculator').distTar.outputs
tags 'latest'
dependsOn project(':code:processes:crawling-process').distTar dependsOn project(':code:processes:crawling-process').distTar
dependsOn project(':code:processes:loading-process').distTar dependsOn project(':code:processes:loading-process').distTar
dependsOn project(':code:processes:converting-process').distTar dependsOn project(':code:processes:converting-process').distTar

View File

@ -34,8 +34,8 @@ dockerfileZip {
docker { docker {
dockerfile = tasks.dockerFile.outputs.files.singleFile dockerfile = tasks.dockerFile.outputs.files.singleFile
name = 'registry.marginalia.nu/'+application.applicationName+':latest'
name = (project.hasProperty('docker-registry') ? project.property('docker-registry') : 'marginalia')+'/'+application.applicationName+':' + (project.hasProperty('docker-tag') ? project.property('docker-tag') : 'latest')
files tasks.distTar.outputs files tasks.distTar.outputs
tags 'latest'
dependsOn tasks.distTar dependsOn tasks.distTar
} }