Skip to content

Commit

Permalink
Merge pull request #4057 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy v9.4.1 to production
  • Loading branch information
mbklein authored Jul 31, 2024
2 parents 2bd4024 + c43fbd4 commit 167e71e
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 56 deletions.
71 changes: 39 additions & 32 deletions app/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions app/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@emotion/react": "^11.11.4",
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-brands-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@honeybadger-io/js": "^6.9.3",
"@honeybadger-io/react": "^6.1.7",
Expand All @@ -45,7 +45,7 @@
"file-saver": "^2.0.5",
"graphql": "^16.9.0",
"graphql-tag": "^2.12.6",
"hls.js": "^1.5.11",
"hls.js": "^1.5.13",
"inflection": "^3.0.0",
"jest-environment-jsdom": "^29.7.0",
"js-cookie": "^3.0.5",
Expand Down Expand Up @@ -85,7 +85,7 @@
"@nulib/dcapi-types": "^2.3.1",
"@nulib/prettier-config": "^1.2.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/jest-dom": "^6.4.7",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
Expand All @@ -104,14 +104,14 @@
"lodash.isnull": "^3.0.0",
"lodash.isundefined": "3.0.1",
"node-fetch": "^2.6.1",
"prettier": "^3.3.2",
"prettier": "^3.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^5.3.0",
"react-router-prop-types": "^1.0.5",
"sass": "^1.77.6",
"sass": "^1.77.8",
"ts-node": "^10.9.2",
"typescript": "^5.5.3",
"typescript": "^5.5.4",
"use-phoenix-channel": "^1.1.1"
}
}
1 change: 1 addition & 0 deletions app/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ if prefix = System.get_env("DEV_PREFIX") do
end

config :meadow, :sitemaps,
base_url: "https://dc.library.northwestern.edu/",
gzip: false,
store: Sitemapper.FileStore,
sitemap_url: "https://devbox.library.northwestern.edu:3333/",
Expand Down
11 changes: 9 additions & 2 deletions app/config/releases.exs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ config :meadow,
bucket: aws_secret("meadow", dig: ["buckets", "sitemap"]),
path: "/"
],
sitemap_url: aws_secret("meadow", dig: ["dc", "base_url"])
base_url: aws_secret("meadow", dig: ["dc", "base_url"]),
sitemap_url:
aws_secret("meadow", dig: ["dc", "base_url"], apply: &{:ok, Path.join(&1, "api/sitemap")})
],
validation_ping_interval: environment_secret("VALIDATION_PING_INTERVAL", default: "1000")

Expand All @@ -125,7 +127,12 @@ config :meadow, Meadow.Scheduler,
overlap: false,
timezone: "America/Chicago",
jobs: [
# Runs daily at the configured time (default: 2AM Central)
# Sitemap generation runs daily at the configured time (default: 1AM Central)
{
aws_secret("meadow", dig: ["scheduler", "sitemap"], default: "0 1 * * *"),
{Meadow.Utils.Sitemap, :generate, []}
},
# Preservation check runs daily at the configured time (default: 2AM Central)
{
aws_secret("meadow", dig: ["scheduler", "preservation_check"], default: "0 2 * * *"),
{Meadow.Data.PreservationChecks, :start_job, []}
Expand Down
1 change: 1 addition & 0 deletions app/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ config :honeybadger,
config :meadow, :sitemaps,
gzip: true,
store: Sitemapper.S3Store,
base_url: "http://localhost:3333/",
sitemap_url: "http://localhost:3333/",
store_config: [bucket: prefix("uploads"), path: ""]

Expand Down
9 changes: 6 additions & 3 deletions app/lib/meadow/utils/sitemap.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ defmodule Meadow.Utils.Sitemap do
@moduledoc """
Generate and upload Digital Collection sitemaps
"""
alias Meadow.Data.{Collections, Works}
alias Meadow.Data.Collections
alias Meadow.Data.Schemas.Work
alias Meadow.Repo

import Ecto.Query

require Logger

@doc """
Expand Down Expand Up @@ -74,7 +77,7 @@ defmodule Meadow.Utils.Sitemap do
end

defp work_urls do
Works.work_query(visibility: "OPEN", work_type: "IMAGE")
from(w in Work, where: w.visibility["id"] == ^"OPEN" and w.published)
|> Repo.stream()
|> Stream.map(fn %{id: id, updated_at: updated_at} ->
%Sitemapper.URL{
Expand All @@ -88,7 +91,7 @@ defmodule Meadow.Utils.Sitemap do

defp expand_url(path) do
config()
|> Keyword.get(:sitemap_url)
|> Keyword.get(:base_url)
|> URI.parse()
|> URI.merge(path)
|> URI.to_string()
Expand Down
2 changes: 1 addition & 1 deletion app/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Code.require_file("lib/env.ex")
defmodule Meadow.MixProject do
use Mix.Project

@app_version "9.4.0"
@app_version "9.4.1"

def project do
[
Expand Down
Loading

0 comments on commit 167e71e

Please sign in to comment.