Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions services/registry/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.DEFAULT_GOAL := help



# Internal VARIABLES ------------------------------------------------
# STACK_NAME defaults to name of the current directory. Should not to be changed if you follow GitOps operating procedures.
STACK_NAME = $(notdir $(shell pwd))
Expand All @@ -22,24 +20,24 @@ define create-s3-bucket
endef

.PHONY: up-local
up-local: .init .env ${TEMP_COMPOSE}-local ## Deploys registry stack
up-local: .init ${TEMP_COMPOSE}-local prune-docker-stack-configs ## Deploys registry stack
@$(create-s3-bucket)
docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-local ${STACK_NAME}

.PHONY: up-letsencrypt-http ## Deploys registry stack using let's encrypt http challenge
up-letsencrypt-http: .init .env ${TEMP_COMPOSE}-letsencrypt-http
.PHONY: up-letsencrypt-http
up-letsencrypt-http: .init ${TEMP_COMPOSE}-letsencrypt-http prune-docker-stack-configs ## Deploys registry stack using let's encrypt http challenge
docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-letsencrypt-http ${STACK_NAME}

.PHONY: up-letsencrypt-dns ## Deploys registry stack using let's encrypt dns challenge
up-letsencrypt-dns: .init .env ${TEMP_COMPOSE}-letsencrypt-dns
.PHONY: up-letsencrypt-dns
up-letsencrypt-dns: .init ${TEMP_COMPOSE}-letsencrypt-dns prune-docker-stack-configs ## Deploys registry stack using let's encrypt dns challenge
docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-letsencrypt-dns ${STACK_NAME}

.PHONY: up-dalco ## Deploys registry stack for Dalco Cluster
up-dalco: .init .env ${TEMP_COMPOSE}
.PHONY: up-dalco
up-dalco: .init ${TEMP_COMPOSE} prune-docker-stack-configs ## Deploys registry stack for Dalco Cluster
docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE} ${STACK_NAME}

.PHONY: up-aws
up-aws: .init .env ${TEMP_COMPOSE}-aws ## Deploys registry on AWS
up-aws: .init ${TEMP_COMPOSE}-aws prune-docker-stack-configs ## Deploys registry on AWS
@docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-aws ${STACK_NAME}

.PHONY: up-master ## Deploys registry on master cluster
Expand Down
13 changes: 13 additions & 0 deletions services/registry/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ services:
- monitored
deploy:
replicas: ${OPS_REGISTRY_REPLICAS}
update_config:
order: start-first
delay: 10s
failure_action: rollback
parallelism: 1
placement:
constraints:
- node.labels.ops==true
Expand Down Expand Up @@ -103,6 +108,11 @@ services:
- monitored
deploy:
mode: global
update_config:
order: start-first
delay: 10s
failure_action: rollback
parallelism: 1
placement:
constraints:
- node.labels.ops==true
Expand All @@ -128,8 +138,11 @@ networks:

configs:
registry_config.yml:
name: ${STACK_NAME}_registry_config_{{ "./config.yml" | sha256file | substring(0,10) }}
file: ./config.yml
nsswitch_conf:
name: ${STACK_NAME}_nsswitch_conf_{{ "./nsswitch.conf" | sha256file | substring(0,10) }}
file: ./nsswitch.conf
registry_init:
name: ${STACK_NAME}_registry_init_{{ "./init" | sha256file | substring(0,10) }}
file: ./init
2 changes: 2 additions & 0 deletions services/registry/template.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
STACK_NAME=${STACK_NAME}

OPS_REGISTRY_REPLICAS=${OPS_REGISTRY_REPLICAS}

REGISTRY_DOMAIN=${REGISTRY_DOMAIN}
Expand Down
Loading