Skip to content

Commit

Permalink
Merge pull request skilld-labs#114 from davidferlay/adminvar
Browse files Browse the repository at this point in the history
Adding admin user login, pw and email in env variables
  • Loading branch information
rnabiullin authored Jul 19, 2019
2 parents f1fb66a + 7ef18cf commit 1ab14a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ MODULES=skilld_default_content
THEME_NAME=
SITE_NAME=Example
[email protected]
ADMIN_NAME=admin
ADMIN_PW=admin
[email protected]
PROJECT_INSTALL=
IMAGE_PHP=skilldlabs/php:72-fpm
IMAGE_NGINX=skilldlabs/nginx:1.14.1
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ endif
si:
@echo "Installing from: $(PROJECT_INSTALL)"
ifeq ($(PROJECT_INSTALL), config)
$(call php, drush si config_installer --db-url=$(DB_URL) --account-pass=admin -y config_installer_sync_configure_form.sync_directory=../config/sync)
$(call php, drush si config_installer --db-url=$(DB_URL) --account-name=$(ADMIN_NAME) --account-mail=$(ADMIN_MAIL) --account-pass=$(ADMIN_PW) -y config_installer_sync_configure_form.sync_directory=../config/sync)
else
$(call php, drush si $(PROFILE_NAME) --db-url=$(DB_URL) --account-pass=admin -y --site-name="$(SITE_NAME)" --site-mail="$(SITE_MAIL)" install_configure_form.site_default_country=FR install_configure_form.date_default_timezone=Europe/Paris)
$(call php, drush si $(PROFILE_NAME) --db-url=$(DB_URL) --account-name=$(ADMIN_NAME) --account-mail=$(ADMIN_MAIL) --account-pass=$(ADMIN_PW) -y --site-name="$(SITE_NAME)" --site-mail="$(SITE_MAIL)" install_configure_form.site_default_country=FR install_configure_form.date_default_timezone=Europe/Paris)
endif
ifneq ($(strip $(MODULES)),)
$(call php, drush en $(MODULES) -y)
Expand All @@ -101,6 +101,7 @@ info:
$(eval CONTAINERS = $(shell docker ps -f name=$(COMPOSE_PROJECT_NAME) --format "{{ .ID }}" -f 'label=traefik.enable=true'))
$(foreach CONTAINER, $(CONTAINERS),$(info http://$(shell printf '%-19s \n' $(shell docker inspect --format='{{(index .NetworkSettings.Networks "$(COMPOSE_NET_NAME)").IPAddress}}:{{index .Config.Labels "traefik.port"}} {{range $$p, $$conf := .NetworkSettings.Ports}}{{$$p}}{{end}} {{.Name}}' $(CONTAINER) | rev | sed "s/pct\//,pct:/g" | sed "s/,//" | rev | awk '{ print $0}')) ))
@echo "$(RESULT)"
@echo "UID1 - Login : \"$(ADMIN_NAME)\" - Password : \"$(ADMIN_PW)\""

## Run shell in PHP container as regular user
exec:
Expand Down

0 comments on commit 1ab14a0

Please sign in to comment.