From b0a3961cbef55bf4f92aebd579746c6fe8da063a Mon Sep 17 00:00:00 2001 From: Logan Koester Date: Wed, 19 Jan 2022 20:03:09 +0700 Subject: [PATCH] Adds REDIS_PASSWORD secret --- .drone.yml | 6 ++++++ src/index.js | 1 + waypoint.hcl | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/.drone.yml b/.drone.yml index 42fa3db..c72ab88 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,6 +21,8 @@ steps: environment: WAYPOINT_SERVER_TOKEN: from_secret: WAYPOINT_SERVER_TOKEN + WP_VAR_redis_password: + from_secret: REDIS_PASSWORD - name: deploy image: registry.gitlab.com/gitlab-org/waypoint-images:latest @@ -32,6 +34,8 @@ steps: environment: WAYPOINT_SERVER_TOKEN: from_secret: WAYPOINT_SERVER_TOKEN + WP_VAR_redis_password: + from_secret: REDIS_PASSWORD - name: release image: registry.gitlab.com/gitlab-org/waypoint-images:latest @@ -43,6 +47,8 @@ steps: environment: WAYPOINT_SERVER_TOKEN: from_secret: WAYPOINT_SERVER_TOKEN + WP_VAR_redis_password: + from_secret: REDIS_PASSWORD volumes: - name: dockersock diff --git a/src/index.js b/src/index.js index e3c8f7c..2d959e0 100644 --- a/src/index.js +++ b/src/index.js @@ -37,6 +37,7 @@ const init = async () => { //partition: 'my_cached_data', host: (process.env.REDIS_HOST || 'localhost'), port: (process.env.REDIS_PORT || 6379), + password: process.env.REDIS_PASSWORD, database: 0, //tls: {}, }, diff --git a/waypoint.hcl b/waypoint.hcl index 1252d59..2bd5332 100644 --- a/waypoint.hcl +++ b/waypoint.hcl @@ -18,6 +18,7 @@ app "page-recorder" { env = { REDIS_HOST = var.redis_host REDIS_PORT = var.redis_port + REDIS_PASSWORD = var.redis_password } } @@ -40,6 +41,7 @@ app "page-recorder" { "NODE_ENV": "production" "REDIS_HOST": var.redis_host "REDIS_PORT": var.redis_port + "REDIS_PASSWORD": var.redis_password } labels = { @@ -75,3 +77,8 @@ variable "redis_port" { default = 6379 description = "Redis port" } + +variable "redis_password" { + type = string + description = "Redis password" +}