Skip to content

Commit

Permalink
Merge pull request #586 from City-of-Helsinki/update-configuration
Browse files Browse the repository at this point in the history
Automatic update
  • Loading branch information
teroelonen authored Feb 23, 2023
2 parents 1a60ba8 + 9a7f745 commit 7f4ac1e
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 72 deletions.
38 changes: 19 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions conf/cmi/oembed_providers.provider.icareus_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ endpoints:
formats:
json: true
xml: false
-
schemes:
- 'https://www.helsinkikanava.fi/*/web/helsinkikanava/player/embed/vod?assetId=*'
- 'https://helsinkikanava.fi/*/web/helsinkikanava/player/embed/vod?assetId=*'
url: 'https://suite.icareus.com/api/oembed'
discovery: false
formats:
json: true
xml: false
18 changes: 18 additions & 0 deletions conf/cmi/rest.resource.helfi_global_mobile_menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
uuid: e0348c15-c842-4db7-a841-e7c772a80b4d
langcode: en
status: true
dependencies:
module:
- helfi_navigation
- serialization
- user
id: helfi_global_mobile_menu
plugin_id: helfi_global_mobile_menu
granularity: resource
configuration:
methods:
- GET
formats:
- json
authentication:
- cookie
4 changes: 4 additions & 0 deletions conf/cmi/user.role.anonymous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ dependencies:
- helfi_tpr
- media
- system
- rest
config:
- rest.resource.helfi_global_mobile_menu
_core:
default_config_hash: EDyVdaROG6pYzyEct43c01Wq4gpATszrk-qR6gqnQ84
id: anonymous
Expand All @@ -21,3 +24,4 @@ permissions:
- 'view remote entities'
- 'view tpr_service'
- 'view tpr_unit'
- 'restful get helfi_global_mobile_menu'
4 changes: 4 additions & 0 deletions conf/cmi/user.role.authenticated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ dependencies:
- media
- system
- toolbar
- rest
config:
- rest.resource.helfi_global_mobile_menu
_core:
default_config_hash: 83Nuup-6oYkkdAsvg3nrR2pBOgtTXEV1JrzpCCLkYLM
id: authenticated
Expand All @@ -23,3 +26,4 @@ permissions:
- 'view remote entities'
- 'view tpr_service'
- 'view tpr_unit'
- 'restful get helfi_global_mobile_menu'
12 changes: 5 additions & 7 deletions tools/make/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DEFAULT_GOAL := help

BUILD_TARGETS :=
CLEAN_EXCLUDE := .idea dump.sql .env.local
COMPOSER_JSON_PATH ?= .
DRUIDFI_TOOLS_MAKE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
ENV := dev
Expand All @@ -19,13 +18,12 @@ include $(DRUIDFI_TOOLS_MAKE_DIR)include.mk

PHONY += debug
debug: ## Show debug information
@printf "\n${YELLOW}Debug starts:${NO_COLOR}\n\n"
@printf "\n$(YELLOW)Debug starts:$(NO_COLOR)\n\n"
$(call dbg,DOCKER,$(call has,docker))
$(call dbg,DOCKER_PROJECT_ROOT,${DOCKER_PROJECT_ROOT})
$(call dbg,DOCKER_COMPOSE_YML_EXISTS,${DOCKER_COMPOSE_YML_EXISTS})
$(call dbg,DOCKER_COMPOSE,${DOCKER_COMPOSE})
$(call dbg,CLI_SERVICE,${CLI_SERVICE})
$(call dbg,CLI_USER,${CLI_USER})
$(call dbg,DOCKER_PROJECT_ROOT,$(DOCKER_PROJECT_ROOT))
$(call dbg,DOCKER_COMPOSE_YML_EXISTS,$(DOCKER_COMPOSE_YML_EXISTS))
$(call dbg,CLI_SERVICE,$(CLI_SERVICE))
$(call dbg,CLI_USER,$(if $(CLI_USER),$(CLI_USER),default user from CLI image))
$(call dbg,CLI_SHELL,${CLI_SHELL})
$(call dbg,ENV,${ENV})
$(call dbg,PHP on host,$(call has,php))
Expand Down
7 changes: 4 additions & 3 deletions tools/make/common.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
ARTIFACT_INCLUDE_EXISTS := $(shell test -f conf/artifact/include && echo yes || echo no)
ARTIFACT_EXCLUDE_EXISTS := $(shell test -f conf/artifact/exclude && echo yes || echo no)
ARTIFACT_CMD := tar -hczf artifact.tar.gz
DUMP_SQL_FILENAME := dump.sql
DUMP_SQL_FILENAME ?= dump.sql
DUMP_SQL_EXISTS := $(shell test -f $(DUMP_SQL_FILENAME) && echo yes || echo no)
SSH_OPTS ?= -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
CLEAN_EXCLUDE := .idea $(DUMP_SQL_FILENAME) .env.local

ifeq ($(ARTIFACT_EXCLUDE_EXISTS),yes)
ARTIFACT_CMD := $(ARTIFACT_CMD) --exclude-from=conf/artifact/exclude
Expand Down Expand Up @@ -68,7 +69,7 @@ gh-download-dump: GH_FLAGS += $(if $(GH_REPO),-R $(GH_REPO),)
gh-download-dump: ## Download database dump from repository artifacts
$(call step,Download database dump from repository artifacts\n)
ifeq ($(DUMP_SQL_EXISTS),no)
$(call run,gh run download $(strip $(GH_FLAGS)),Downloaded dump.sql,Failed)
$(call run,gh run download $(strip $(GH_FLAGS)),Downloaded $(DUMP_SQL_FILENAME),Failed)
else
@echo "There is already dump.sql"
@echo "There is already $(DUMP_SQL_FILENAME)"
endif
8 changes: 2 additions & 6 deletions tools/make/composer.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ composer-update: ## Update Composer packages
PHONY += composer-install
composer-install: ## Install Composer packages
$(call step,Do Composer install...\n)
ifeq ($(ENV),production)
$(call composer,install $(COMPOSER_PROD_FLAGS))
else
$(call composer,install)
endif
$(call composer,install$(if $(filter production,$(ENV)), $(COMPOSER_PROD_FLAGS),))

PHONY += composer-outdated
composer-outdated: ## Show outdated Composer packages
Expand All @@ -27,7 +23,7 @@ composer-outdated: ## Show outdated Composer packages

ifeq ($(RUN_ON),docker)
define composer
$(call docker_run_cmd,cd $(DOCKER_PROJECT_ROOT) && composer --ansi$(if $(filter $(COMPOSER_JSON_PATH),.),, --working-dir=$(COMPOSER_JSON_PATH)) $(1))
$(call docker_compose_exec,composer --ansi$(if $(filter $(COMPOSER_JSON_PATH),.),, --working-dir=$(COMPOSER_JSON_PATH)) $(1))
endef
else
define composer
Expand Down
29 changes: 18 additions & 11 deletions tools/make/docker.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
CLI_SERVICE := cli
CLI_SERVICE := app
CLI_SHELL := sh
CLI_USER := root
DOCKER_COMPOSE := docker compose
DOCKER_COMPOSE_EXEC ?= $(DOCKER_COMPOSE) exec
DOCKER_COMPOSE_YML_PATH ?= docker-compose.yml
DOCKER_COMPOSE_YML_EXISTS := $(shell test -f $(DOCKER_COMPOSE_YML_PATH) && echo yes || echo no)
DOCKER_PROJECT_ROOT ?= /app
Expand Down Expand Up @@ -41,34 +38,44 @@ stop: ## Stop the environment
PHONY += up
up: ## Launch the environment
$(call step,Start up the container(s)...\n)
$(call docker_compose,up -d --pull always --wait --remove-orphans)
$(call docker_compose,up -d --remove-orphans)

PHONY += shell
shell: ## Login to CLI container
ifeq ($(RUN_ON),docker)
@$(DOCKER_COMPOSE) exec -u $(CLI_USER) $(CLI_SERVICE) $(CLI_SHELL)
$(call docker_compose,exec $(CLI_SERVICE) $(CLI_SHELL))
else
$(call warn,$(DOCKER_WARNING_INSIDE))
endif

PHONY += ssh-check
ssh-check: ## Check SSH keys on CLI container
$(call docker_run_cmd,ssh-add -L)
$(call docker_compose_exec,ssh-add -L)

ifeq ($(RUN_ON),docker)
define docker_run_cmd
@$(DOCKER_COMPOSE_EXEC) -u $(CLI_USER) -T $(CLI_SERVICE) $(CLI_SHELL) -c "$(1)"
define docker
@docker $(1) > /dev/null 2>&1 && $(if $(2),echo "$(2)",)
endef
else
define docker
$(call sub_step,$(DOCKER_WARNING_INSIDE))
endef
endif

ifeq ($(RUN_ON),docker)
define docker_compose_exec
$(call docker_compose,exec$(if $(CLI_USER), -u $(CLI_USER),) $(CLI_SERVICE) $(CLI_SHELL) -c "$(1)")
$(if $(2),@echo "$(2)",)
endef
else
define docker_run_cmd
define docker_compose_exec
@$(1) && echo $(2)
endef
endif

ifeq ($(RUN_ON),docker)
define docker_compose
@$(DOCKER_COMPOSE) $(1)
@docker compose$(if $(filter docker-compose.yml,$(DOCKER_COMPOSE_YML_PATH)),, -f $(DOCKER_COMPOSE_YML_PATH)) $(1)
endef
else
define docker_compose
Expand Down
9 changes: 5 additions & 4 deletions tools/make/drupal.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ LINT_PATHS_PHP += $(WEBROOT)/modules/custom
LINT_PATHS_PHP += $(WEBROOT)/themes/custom
LINT_PHP_TARGETS += lint-drupal
FIX_TARGETS += fix-drupal
DRUPAL_CREATE_FOLDERS := $(WEBROOT)/sites/default/files/private
DRUPAL_CREATE_FOLDERS += $(WEBROOT)/sites/default/files/translations

ifeq ($(GH_DUMP_ARTIFACT),yes)
DRUPAL_FRESH_TARGETS := gh-download-dump $(DRUPAL_FRESH_TARGETS)
Expand All @@ -38,8 +40,7 @@ endif

PHONY += drupal-create-folders
drupal-create-folders:
@mkdir -p $(WEBROOT)/sites/default/files/private
@mkdir -p $(WEBROOT)/sites/default/files/translations
@mkdir -p $(DRUPAL_CREATE_FOLDERS)

PHONY += drupal-update
drupal-update: ## Update Drupal core with Composer
Expand Down Expand Up @@ -193,10 +194,10 @@ mmfix:

ifeq ($(RUN_ON),docker)
define drush
$(call docker_run_cmd,drush --ansi --strict=0 $(1),$(2))
$(call docker_compose_exec,drush $(1),$(2))
endef
else
define drush
@drush --ansi --strict=0 $(1)
@drush $(1)
endef
endif
8 changes: 4 additions & 4 deletions tools/make/kubectl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ PHONY += kubectl-sync-db
kubectl-sync-db: ## Sync database from Kubernetes
ifeq ($(DUMP_SQL_EXISTS),no)
$(eval POD := $(call kubectl_get_pod))
$(call step,Get database dump from $(POD)...)
$(call step,Get database dump from $(POD)...\n)
$(call kubectl_exec_to_file,$(POD),drush sql-dump --structure-tables-key=common --extra-dump=--no-tablespaces,$(DUMP_SQL_FILENAME))
endif
$(call step,Import local SQL dump...)
$(call step,Import local SQL dump...\n)
$(call drush,sql-query --file=${DOCKER_PROJECT_ROOT}/$(DUMP_SQL_FILENAME))

PHONY += kubectl-sync-files-tar
kubectl-sync-files-tar: ## Sync files from Kubernetes using tar
$(call step,Copy files from remote...)
$(call step,Copy files from remote...\n)
$(eval POD := $(call kubectl_get_pod))
$(KUBECTL_BIN) exec $(KUBECTL_EXEC_FLAGS) $(POD) -- tar cf - $(SYNC_FILES_EXCLUDE) $(SYNC_FILES_PATH) | tar xfv - -C .

Expand All @@ -25,7 +25,7 @@ kubectl-rsync-files: FLAGS := -aurP --blocking-io
kubectl-rsync-files: REMOTE_PATH := $(KUBECTL_WORKDIR)/$(SYNC_FILES_PATH)/
kubectl-rsync-files: LOCAL_PATH := ./$(SYNC_FILES_PATH)/
kubectl-rsync-files: ## Sync files from Kubernetes using rsync
$(call step,Sync files from remote...)
$(call step,Sync files from remote...\n)
$(eval POD := $(call kubectl_get_pod))
rsync $(FLAGS) $(SYNC_FILES_EXCLUDE) --rsync-path=$(REMOTE_PATH) -e '$(KUBECTL_BIN) exec -i $(KUBECTL_EXEC_FLAGS) $(POD) -- env ' rsync: $(LOCAL_PATH)

Expand Down
8 changes: 1 addition & 7 deletions tools/make/lagoon.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
LAGOON_IN_LOCAL ?= no

CLI_SERVICE := cli
CLI_SHELL := bash

Expand All @@ -10,17 +8,13 @@ INSTANCE_test_USER ?= project-name-branch
INSTANCE_test_HOST ?= $(INSTANCE_prod_HOST)
INSTANCE_test_OPTS ?= $(INSTANCE_prod_OPTS)

ifeq ($(LAGOON_IN_LOCAL),yes)
DOCKER_COMPOSE := $(DOCKER_COMPOSE) -f docker-compose.lagoon.yml
endif

ifeq ($(MAKECMDGOALS),set-lagoon-secrets)
include .env.local.lagoon
endif

PHONY += lagoon-env
lagoon-env: ## Print Lagoon env variables
$(call docker_run_cmd,printenv | grep LAGOON_)
$(call docker_compose_exec,printenv | grep LAGOON_)

PHONY += deploy-lagoon-%
deploy-lagoon-%: ## Deploy lagoon branch
Expand Down
Loading

0 comments on commit 7f4ac1e

Please sign in to comment.