diff --git a/.travis.yml b/.travis.yml index 1328266..bf2703b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: minimal services: - docker -env: - - ACTIVATE_NOTES=1 ACTIVATE_XQUEUE=1 script: - - make configure SILENT=1 + - make configure SILENT=1 ACTIVATE_NOTES=1 ACTIVATE_XQUEUE=1 - make build - make migrate #- make assets # too time-consuming diff --git a/Makefile b/Makefile index c6b972d..f36eedf 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ PWD ?= $$(pwd) USERID ?= $$(id -u) EDX_PLATFORM_SETTINGS ?= universal.production DOCKER_COMPOSE = docker-compose -f docker-compose.yml +-include $(PWD)/config/Makefile.env post_configure_targets = ifneq ($(DISABLE_STATS), 1) @@ -34,7 +35,12 @@ endif DOCKER_COMPOSE_RUN_LMS = $(DOCKER_COMPOSE_RUN_OPENEDX) -p 8000:8000 lms DOCKER_COMPOSE_RUN_CMS = $(DOCKER_COMPOSE_RUN_OPENEDX) -p 8001:8001 cms -all: configure $(post_configure_targets) update migrate assets daemonize +all: configure # other targets are not listed as requirements in order to reload the env file + @$(MAKE) post_configure + @$(MAKE) update + @$(MAKE) migrate + @$(MAKE) assets + @$(MAKE) daemonize @echo "All set \o/ You can access the LMS at http://localhost and the CMS at http://studio.localhost" ##################### Bootstrapping @@ -45,6 +51,8 @@ configure: build-configurator -e SETTING_ACTIVATE_HTTPS=$(ACTIVATE_HTTPS) -e SETTING_ACTIVATE_NOTES=$(ACTIVATE_NOTES) -e SETTING_ACTIVATE_PORTAINER=$(ACTIVATE_PORTAINER) -e SETTING_ACTIVATE_XQUEUE=$(ACTIVATE_XQUEUE) \ regis/openedx-configurator:hawthorn +post_configure: $(post_configure_targets) + stats: @docker run --rm -it --volume="$(PWD)/config:/openedx/config" \ regis/openedx-configurator:hawthorn /openedx/config/openedx/stats 2> /dev/null|| true diff --git a/README.md b/README.md index 1eb8968..02d1ce2 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ Some optional features may be activated by defining `ACTIVATE_*` environment var ACTIVATE_HTTPS=1 make all +Technically, the `ACTIVATE_*` environment variables are only required during `make configure`. After that, they will be automatically loaded from `config/Makefile.env`. + ### SSL/TLS certificates for HTTPS access (`ACTIVATE_HTTPS`) By activating this feature, a free SSL/TLS certificate from the [Let's Encrypt](https://letsencrypt.org/) certificate authority will be created for your platform. With this feature, **your platform will no longer be accessible in HTTP**. Calls to http urls will be redirected to https url. diff --git a/configurator/bin/configure.py b/configurator/bin/configure.py index 20555ba..5e58df6 100755 --- a/configurator/bin/configure.py +++ b/configurator/bin/configure.py @@ -154,6 +154,8 @@ def interactive(args): 'XQUEUE_MYSQL_PASSWORD', "", random_string(8) ).add( 'XQUEUE_SECRET_KEY', "", random_string(24) + ).add_bool( + 'DISABLE_STATS', "", False ).add_bool( 'ACTIVATE_NOTES', "", False ).add_bool( diff --git a/configurator/templates/Makefile.env b/configurator/templates/Makefile.env new file mode 100644 index 0000000..d40317f --- /dev/null +++ b/configurator/templates/Makefile.env @@ -0,0 +1,5 @@ +DISABLE_STATS = {{ 1 if DISABLE_STATS else 0 }} +ACTIVATE_HTTPS = {{ 1 if ACTIVATE_HTTPS else 0 }} +ACTIVATE_XQUEUE = {{ 1 if ACTIVATE_XQUEUE else 0 }} +ACTIVATE_NOTES = {{ 1 if ACTIVATE_NOTES else 0 }} +ACTIVATE_PORTAINER = {{ 1 if ACTIVATE_PORTAINER else 0 }}