diff options
author | Amit Kumar <amitkma@e.email> | 2021-05-07 00:33:43 +0530 |
---|---|---|
committer | Amit Kumar <amitkma@e.email> | 2021-05-07 00:33:43 +0530 |
commit | 725f9e3449526e3a88a38dca9ef9b5ee64e4ba50 (patch) | |
tree | 0b6ab4fd0b733ef2f7c8d181c9a24ed595eb0ff3 | |
parent | ca97c46120b3ce298bfd72bfeb208aa136076ea3 (diff) |
Use correct environment variables for mapbox based on git branch
-rw-r--r-- | .gitlab-ci.yml | 8 | ||||
-rw-r--r-- | load-properties.gradle | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da31bd1..05e73ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,11 @@ stages: - build - test +# By default load dev keys. +variables: + MAPBOX_KEY: $MAPBOX_KEY_DEV + MAPBOX_SECRET_KEY: $MAPBOX_SECRET_KEY_DEV + workflow: rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' @@ -85,6 +90,9 @@ build-full: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - if: '$CI_COMMIT_BRANCH == "master"' + variables: + MAPBOX_KEY: $MAPBOX_KEY_PROD + MAPBOX_SECRET_KEY: $MAPBOX_SECRET_KEY_PROD when: always - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"' when: always diff --git a/load-properties.gradle b/load-properties.gradle index b8c6844..71c9fb5 100644 --- a/load-properties.gradle +++ b/load-properties.gradle @@ -28,6 +28,6 @@ if (localPropertiesFile.exists()) { new FileInputStream(localPropertiesFile).withCloseable { is -> p.load(is) } p.each { name, value -> ext[name] = value } } else { - ext["MAPBOX_KEY"] = System.getenv('MAPBOX_KEY_DEV') - ext["MAPBOX_SECRET_KEY"] = System.getenv('MAPBOX_SECRET_KEY_DEV') + ext["MAPBOX_KEY"] = System.getenv('MAPBOX_KEY') + ext["MAPBOX_SECRET_KEY"] = System.getenv('MAPBOX_SECRET_KEY') }
\ No newline at end of file |