Skip to content

Commit

Permalink
Merge pull request #4273 from nulib/fix-dev-uploads
Browse files Browse the repository at this point in the history
Fix names of upload/preservation buckets in dev
  • Loading branch information
mbklein authored Nov 20, 2024
2 parents 12e470f + 9665c5f commit 1af6d01
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/lib/meadow/config/pipeline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule Meadow.Config.Pipeline do
|> configure!()
end

def configure!(true), do: Logger.warn("Pipeline already configured. Skipping.")
def configure!(true), do: Logger.warning("Pipeline already configured. Skipping.")

def configure!(_) do
prefix =
Expand Down
4 changes: 2 additions & 2 deletions app/lib/meadow/config/runtime.ex
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ defmodule Meadow.Config.Runtime do
ingest_bucket: get_secret(:meadow, ["buckets", "ingest"], prefix("ingest")),
preservation_bucket:
get_secret(:meadow, ["buckets", "preservation"], prefix("preservation")),
pyramid_bucket: get_secret(:meadow, ["buckets", "pyramid"], prefix("pyramid")),
upload_bucket: get_secret(:meadow, ["buckets", "upload"], prefix("upload")),
pyramid_bucket: get_secret(:meadow, ["buckets", "pyramid"], prefix("pyramids")),
upload_bucket: get_secret(:meadow, ["buckets", "upload"], prefix("uploads")),
preservation_check_bucket:
get_secret(:meadow, ["buckets", "preservation_check"], prefix("preservation-checks")),
streaming_bucket: get_secret(:meadow, ["buckets", "streaming"], prefix("streaming"))
Expand Down
17 changes: 5 additions & 12 deletions app/test/meadow/config_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ defmodule Meadow.ConfigTest do

test "aws_environment/0" do
with env <- Config.aws_environment() |> Enum.into(%{}) do
assert env |> Map.has_key?('TMPDIR')
assert env |> Map.has_key?(~c"TMPDIR")

if Application.get_env(:ex_aws, :s3) do
assert env |> Map.get('AWS_REGION') == 'us-east-1'
assert env |> Map.get('AWS_SECRET_ACCESS_KEY') == 'fake'
assert env |> Map.get('AWS_ACCESS_KEY_ID') == 'fake'
assert env |> Map.get('AWS_S3_ENDPOINT') |> Enum.slice(0..15) == 'http://localhost'
assert env |> Map.get(~c"AWS_REGION") == ~c"us-east-1"
assert env |> Map.get(~c"AWS_SECRET_ACCESS_KEY") == ~c"fake"
assert env |> Map.get(~c"AWS_ACCESS_KEY_ID") == ~c"fake"
assert env |> Map.get(~c"AWS_S3_ENDPOINT") |> Enum.slice(0..15) == ~c"http://localhost"
end
end
end
Expand Down Expand Up @@ -103,12 +103,5 @@ defmodule Meadow.ConfigTest do
assert Config.iiif_manifest_url_deprecated() ==
"http://no-slash-test/minio/test-pyramids/public/"
end

test "validate release config" do
System.put_env("__COMPILE_CHECK__", "TRUE")
assert ConfigReader.read!("config/releases.exs") |> is_list()
after
System.delete_env("__COMPILE_CHECK__")
end
end
end
6 changes: 6 additions & 0 deletions infrastructure/deploy/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
locals {
dc_base = trimsuffix(var.digital_collections_url, "/")

config_secrets = {
buckets = {
ingest = aws_s3_bucket.meadow_ingest.bucket
Expand All @@ -22,6 +24,10 @@ locals {
base_url = var.digital_collections_url
}

ezid = {
target_base_url = "${local.dc_base}/items/"
}

geonames = {
username = var.geonames_username
}
Expand Down

0 comments on commit 1af6d01

Please sign in to comment.