Skip to content

Commit

Permalink
Merge pull request #1938 from NYPL-Simplified/qa
Browse files Browse the repository at this point in the history
Deploy CM 4.2.0 to OEB Production
  • Loading branch information
keithbauer authored Sep 3, 2024
2 parents 372d5f5 + dde7385 commit 8dc9b6f
Show file tree
Hide file tree
Showing 20 changed files with 650 additions and 2,542 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/publishQA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
project: [BPL, OE, SE]
project: [OE, SE]
stage: [cm_scripts_active, cm_webapp_active]
include:
- project: BPL
ECR_REPOSITORY: BPL_ECR_REPOSITORY
AWS_ACCESS_KEY_ID: SE_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: SE_AWS_SECRET_ACCESS_KEY
- project: OE
ECR_REPOSITORY: OE_ECR_REPOSITORY
AWS_ACCESS_KEY_ID: OE_AWS_ACCESS_KEY_ID
Expand All @@ -31,12 +27,6 @@ jobs:
container_tag: qa-cron-latest
- stage: cm_webapp_active
container_tag: qa-latest
- project: BPL
stage: cm_scripts_active
cluster_service: BPL_SCRIPTS_CLUSTER_SERVICE
- project: BPL
stage: cm_webapp_active
cluster_service: BPL_WEBAPP_CLUSTER_SERVICE
- project: OE
stage: cm_scripts_active
cluster_service: OE_SCRIPTS_CLUSTER_SERVICE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox tox-gh-actions tox-docker
pip install tox tox-gh-actions tox-docker==4.1.0 docker==6.1.3 -r requirements-dev.txt
- name: Run Tests
run: |
Expand Down
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ COPY ./docker/localdev_postgres_init.sh /docker-entrypoint-initdb.d/localdev_pos
#
# * We create a user, 'simplified', to be the non-root user we step down to
#
# * We install NodeJS from the Nodesource packages, which lets us use Node 10,
# and avoids dependency conflicts between node and libxmlsec1 over the SSL
# library version that we'll get via system packages.
# * We install NodeJS from the Nodesource packages.
#
###############################################################################

Expand All @@ -75,8 +73,8 @@ RUN apt-get update \
ca-certificates \
gnupg \
&& curl -sSL ${NODESOURCE_KEYFILE} | apt-key add - \
&& echo "deb https://deb.nodesource.com/node_14.x focal main" >> /etc/apt/sources.list.d/nodesource.list \
&& echo "deb-src https://deb.nodesource.com/node_14.x focal main" >> /etc/apt/sources.list.d/nodesource.list \
&& echo "deb https://deb.nodesource.com/node_20.x jammy main" >> /etc/apt/sources.list.d/nodesource.list \
&& echo "deb-src https://deb.nodesource.com/node_20.x jammy main" >> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install --yes --no-install-recommends \
build-essential \
Expand Down Expand Up @@ -223,14 +221,14 @@ CMD ["webapp"]
###############################################################################

FROM cm_webapp_base AS cm_webapp_local
ENV FLASK_ENV development
ENV FLASK_DEBUG 1

###############################################################################
## cm_webapp_active - self-contained version of webapp, for remote deploy
###############################################################################

FROM cm_webapp_base AS cm_webapp_active
ENV FLASK_ENV production
ENV FLASK_DEBUG 0

COPY --chown=simplified:simplified . /home/simplified/circulation/

Expand Down Expand Up @@ -265,14 +263,14 @@ CMD ["scripts", "|& tee -a /var/log/cron.log 2>$1"]
###############################################################################

FROM cm_scripts_base AS cm_scripts_local
ENV FLASK_ENV development
ENV FLASK_DEBUG 1

###############################################################################
## cm_scripts_active - self-contained version of scripts, for remote deploy
###############################################################################

FROM cm_scripts_base AS cm_scripts_active
ENV FLASK_ENV production
ENV FLASK_DEBUG 0

COPY --chown=simplified:simplified . /home/simplified/circulation/

Expand All @@ -288,13 +286,13 @@ CMD ["exec"]
###############################################################################

FROM cm_exec_base AS cm_exec_local
ENV FLASK_ENV development
ENV FLASK_DEBUG 1

###############################################################################
## cm_exec_active - self-contained version of exec, for remote deploy
###############################################################################

FROM cm_exec_base AS cm_exec_active
ENV FLASK_ENV production
ENV FLASK_DEBUG 0

COPY --chown=simplified:simplified . /home/simplified/circulation/
14 changes: 7 additions & 7 deletions api/admin/controller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,16 @@ def __call__(self, collection, book, path=None):
redirect_url = flask.request.url

if (collection):
quoted_collection = urllib.parse.quote(collection)
redirect_url = redirect_url.replace(
quoted_collection,
quoted_collection.replace("/", "%2F"))
collection,
urllib.parse.quote_plus(collection)
)

if (book):
quoted_book = urllib.parse.quote(book)
if (book):
redirect_url = redirect_url.replace(
quoted_book,
quoted_book.replace("/", "%2F"))
book,
urllib.parse.quote_plus(book)
)

return redirect(self.url_for('admin_sign_in', redirect=redirect_url))

Expand Down
Loading

0 comments on commit 8dc9b6f

Please sign in to comment.