Skip to content

Commit

Permalink
Fix dev green deploys (#693)
Browse files Browse the repository at this point in the history
* change port

* Make headend path an env var and add case for setting active headend as nil

* missing comma

* remove comma

* Address PR commentS
  • Loading branch information
PaulJKim authored Sep 15, 2023
1 parent 3690065 commit b69f020
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev-green.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
splunk-index: realtime-signs-dev-green
task-cpu: .5
task-memory: 2048M
task-port: 80
task-port: 8080
secrets:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ if config_env() != :test do
message_log_s3_bucket: System.get_env("MESSAGE_LOG_S3_BUCKET"),
message_log_s3_folder: System.get_env("MESSAGE_LOG_S3_FOLDER"),
message_log_report_s3_folder: System.get_env("MESSAGE_LOG_REPORT_S3_FOLDER"),
monitoring_api_key: System.get_env("MONITORING_API_KEY")
monitoring_api_key: System.get_env("MONITORING_API_KEY"),
active_headend_path: System.get_env("ACTIVE_HEADEND_S3_PATH")
end

if config_env() == :dev do
Expand Down
8 changes: 4 additions & 4 deletions lib/external_config/s3.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ defmodule ExternalConfig.S3 do

@behaviour ExternalConfig.Interface

@active_headend_path "/headend.json"

@impl ExternalConfig.Interface
def get(current_version) do
s3_client = Application.get_env(:realtime_signs, :s3_client)
Expand Down Expand Up @@ -37,8 +35,9 @@ defmodule ExternalConfig.S3 do
s3_client = Application.get_env(:realtime_signs, :s3_client)
aws_client = Application.get_env(:realtime_signs, :aws_client)
bucket = Application.get_env(:realtime_signs, :s3_bucket)
active_headend_path = Application.get_env(:realtime_signs, :active_headend_path)

case s3_client.get_object(bucket, @active_headend_path)
case s3_client.get_object(bucket, active_headend_path)
|> aws_client.request() do
{:ok, response} ->
body = Jason.decode!(response.body)
Expand All @@ -53,10 +52,11 @@ defmodule ExternalConfig.S3 do
s3_client = Application.get_env(:realtime_signs, :s3_client)
aws_client = Application.get_env(:realtime_signs, :aws_client)
bucket = Application.get_env(:realtime_signs, :s3_bucket)
active_headend_path = Application.get_env(:realtime_signs, :active_headend_path)

case s3_client.put_object(
bucket,
@active_headend_path,
active_headend_path,
Jason.encode!(%{active_headend_ip: ip})
)
|> aws_client.request() do
Expand Down

0 comments on commit b69f020

Please sign in to comment.