diff --git a/.circleci/config.yml b/.circleci/config.yml index 712181a751..0a35b93761 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,22 +1,23 @@ version: 2.1 references: - - &OTP23 cimg/elixir:1.11 # Contains Erlang 23.1 + - &OTP24 cimg/elixir:1.12 # Contains Erlang 24.0 executors: - otp_23: + # OTP24 + otp_24: working_directory: ~/app docker: - - image: *OTP23 - otp_23_redis: + - image: *OTP24 + otp_24_redis: working_directory: ~/app docker: - - image: *OTP23 + - image: *OTP24 - image: circleci/redis:6.0.5 - otp_23_redis_minio_rmq: + otp_24_redis_minio_rmq: working_directory: ~/app docker: - - image: *OTP23 + - image: *OTP24 - image: circleci/redis:6.0.5 - image: minio/minio:latest environment: @@ -576,85 +577,67 @@ workflows: # ============= PACKAGES ============= - package: name: centos_7 - executor: otp_23 + executor: otp_24 platform: centos_7 context: mongooseim-org - otp_package: 23.1-1 + otp_package: 24.0-1 filters: *all_tags - package: name: debian_stretch - executor: otp_23 + executor: otp_24 platform: debian_stretch context: mongooseim-org - otp_package: 23.1-1 + otp_package: 24.0-1 filters: *all_tags # ======== BASE DOCKER BUILDS ======== - build_in_docker: - name: otp_23_docker - executor: otp_23 + name: otp_24_docker + executor: otp_24 context: mongooseim-org build_prod: true # ============= DIALYZER ============= - dialyzer: name: dialyzer - executor: otp_23 + executor: otp_24 context: mongooseim-org requires: - - otp_23_docker + - otp_24_docker filters: *all_tags # ============= XREF ============= - xref: name: xref - executor: otp_23 + executor: otp_24 context: mongooseim-org requires: - - otp_23_docker + - otp_24_docker filters: *all_tags # ============= SMALL TESTS ============= - small_tests_in_docker: - name: small_tests_23 - executor: otp_23_redis + name: small_tests_24 + executor: otp_24_redis context: mongooseim-org requires: - - otp_23_docker + - otp_24_docker filters: *all_tags # ============= BIG TESTS ============= - big_tests_in_docker: - name: internal_mnesia - executor: otp_23_redis_minio_rmq + name: internal_mnesia_24 + executor: otp_24_redis_minio_rmq context: mongooseim-org preset: internal_mnesia db: "mnesia minio" tls_dist: true requires: - - otp_23_docker + - otp_24_docker filters: *all_tags # ============================================ # ============= IN VM EXECUTORS ============== - # ============= BASE BUILDS ============= + # ============= TESTS OTP 22 ============= - build: name: otp_22 otp_package: 22.3.4.9-1 context: mongooseim-org filters: *all_tags - - build: - name: otp_23 - otp_package: 23.0.3-1 - context: mongooseim-org - filters: *all_tags - - build: - name: otp_24 - otp_package: 24.0.2-1 - context: mongooseim-org - filters: *all_tags - # ============= SMALL TESTS ============= - - small_tests: - name: small_tests_24 - otp_package: 24.0.2-1 - context: mongooseim-org - requires: - - otp_24 - filters: *all_tags - small_tests: name: small_tests_22 otp_package: 22.3.4.9-1 @@ -662,95 +645,74 @@ workflows: requires: - otp_22 filters: *all_tags - # ============= MOST RECENT VERSION TESTS ============= - - big_tests: - name: mysql_redis - otp_package: 23.0.3-1 - preset: mysql_redis - db: mysql - context: mongooseim-org - requires: - - otp_23 - filters: *all_tags - big_tests: - name: mssql_mnesia - otp_package: 23.0.3-1 - preset: odbc_mssql_mnesia - db: mssql + name: ldap_mnesia_22 + otp_package: 22.3.4.9-1 + preset: ldap_mnesia + db: mnesia context: mongooseim-org requires: - - otp_23 + - otp_22 filters: *all_tags - big_tests: - name: elasticsearch_and_cassandra - otp_package: 23.0.3-1 - preset: elasticsearch_and_cassandra_mnesia - db: "elasticsearch cassandra" + name: pgsql_mnesia_22 + otp_package: 22.3.4.9-1 + preset: pgsql_mnesia + db: pgsql context: mongooseim-org requires: - - otp_23 + - otp_22 filters: *all_tags - - big_tests: - name: riak_mnesia - otp_package: 23.0.3-1 - preset: riak_mnesia - db: riak + # ============= TESTS OTP 23 ============= + - build: + name: otp_23 + otp_package: 23.3.1-1 context: mongooseim-org - requires: - - otp_23 filters: *all_tags - - big_tests: - name: pgsql_mnesia - otp_package: 23.0.3-1 - preset: pgsql_mnesia - db: pgsql + - small_tests: + name: small_tests_23 + otp_package: 23.3.1-1 context: mongooseim-org requires: - otp_23 filters: *all_tags - big_tests: name: ldap_mnesia_23 - otp_package: 23.0.3-1 + otp_package: 23.3.1-1 preset: ldap_mnesia db: mnesia context: mongooseim-org requires: - otp_23 filters: *all_tags - # ============= DYNAMIC DOMAINS ============= - big_tests: - name: dynamic_domains - otp_package: 23.0.3-1 - spec: dynamic_domains.spec + name: pgsql_mnesia_23 + otp_package: 23.3.1-1 preset: pgsql_mnesia db: pgsql context: mongooseim-org requires: - otp_23 filters: *all_tags - # ============= 1 VERSION OLDER TESTS ============= - - big_tests: - name: ldap_mnesia_22 - otp_package: 22.3.4.9-1 - preset: ldap_mnesia - db: mnesia - context: mongooseim-org - requires: - - otp_22 - filters: *all_tags - big_tests: - name: pgsql_mnesia_22 - otp_package: 22.3.4.9-1 + name: dynamic_domains_23 + otp_package: 23.3.1-1 + spec: dynamic_domains.spec preset: pgsql_mnesia db: pgsql context: mongooseim-org requires: - - otp_22 + - otp_23 + filters: *all_tags + # ============= TESTS OTP 24 ============= + - build: + name: otp_24 + otp_package: 24.0-1 + context: mongooseim-org filters: *all_tags - # ============= MOST RECENT VERSION TESTS OTP 24 ============= - big_tests: name: ldap_mnesia_24 - otp_package: 24.0.2-1 + otp_package: 24.0-1 preset: ldap_mnesia db: mnesia context: mongooseim-org @@ -759,7 +721,7 @@ workflows: filters: *all_tags - big_tests: name: mysql_redis_24 - otp_package: 24.0.2-1 + otp_package: 24.0-1 preset: mysql_redis db: mysql context: mongooseim-org @@ -768,7 +730,7 @@ workflows: filters: *all_tags - big_tests: name: mssql_mnesia_24 - otp_package: 24.0.2-1 + otp_package: 24.0-1 preset: odbc_mssql_mnesia db: mssql context: mongooseim-org @@ -777,7 +739,7 @@ workflows: filters: *all_tags - big_tests: name: elasticsearch_and_cassandra_24 - otp_package: 24.0.2-1 + otp_package: 24.0-1 preset: elasticsearch_and_cassandra_mnesia db: "elasticsearch cassandra" context: mongooseim-org @@ -786,7 +748,7 @@ workflows: filters: *all_tags - big_tests: name: riak_mnesia_24 - otp_package: 24.0.2-1 + otp_package: 24.0-1 preset: riak_mnesia db: riak context: mongooseim-org @@ -795,7 +757,17 @@ workflows: filters: *all_tags - big_tests: name: pgsql_mnesia_24 - otp_package: 24.0.2-1 + otp_package: 24.0-1 + preset: pgsql_mnesia + db: pgsql + context: mongooseim-org + requires: + - otp_24 + filters: *all_tags + - big_tests: + name: dynamic_domains_24 + otp_package: 24.0-1 + spec: dynamic_domains.spec preset: pgsql_mnesia db: pgsql context: mongooseim-org @@ -805,19 +777,28 @@ workflows: # ============= DOCKER IMAGE BUILD & UPLOAD ============= - docker_image: name: docker_build_and_ship - executor: otp_23 + executor: otp_24 context: mongooseim-org requires: - - ldap_mnesia_23 - - pgsql_mnesia - - riak_mnesia - - elasticsearch_and_cassandra - - internal_mnesia - - mysql_redis - - mssql_mnesia - - dialyzer - - xref - small_tests_22 + - ldap_mnesia_22 + - pgsql_mnesia_22 + - small_tests_23 + - ldap_mnesia_23 + - pgsql_mnesia_23 + - dynamic_domains_23 + - small_tests_24 + - internal_mnesia_24 + - pgsql_mnesia_24 + - mysql_redis_24 + - mssql_mnesia_24 + - ldap_mnesia_24 + - riak_mnesia_24 + - elasticsearch_and_cassandra_24 + - dynamic_domains_24 + + - dialyzer + - xref filters: *all_tags diff --git a/rel/files/scripts/bootstrap20-template.escript b/rel/files/scripts/bootstrap20-template.escript index 1223b05221..4d91217aad 100755 --- a/rel/files/scripts/bootstrap20-template.escript +++ b/rel/files/scripts/bootstrap20-template.escript @@ -26,7 +26,7 @@ init_and_template(MIM_DIR, TemplateConfigPath, TemplateConfigBin) -> %% Options defined in the ini config file FileOpts = maps:from_list(proplists:get_value(options, TemplateConfig, [])), - LowerEnvVars = [{string:to_lower(K), V} || {K, V} <- os:list_env_vars()], + LowerEnvVars = get_env_vars(), %% Add all env variables with prefix MIM_ EnvVars = maps:from_list([{list_to_atom(K), list_to_binary(V)} @@ -109,3 +109,16 @@ parse_template_config(TemplateConfigPath, TemplateConfigBin) -> io:format("Failed to parse ~p~n Reason ~p~n", [TemplateConfigPath, Other]), halt_with_error("parse_template_config_failed") end. + +-ifdef(OTP_RELEASE). +-if(?OTP_RELEASE >= 24). +get_env_vars() -> + LowerEnvVars = [{string:to_lower(K), V} || {K, V} <- os:env()]. +-else. +get_env_vars() -> + LowerEnvVars = [{string:to_lower(K), V} || {K, V} <- os:list_env_vars()]. +-endif. +-else. +get_env_vars() -> + LowerEnvVars = [{string:to_lower(K), V} || {K, V} <- os:list_env_vars()]. +-endif.