From 38c4df754911fa1b200fde0e991128ab298d623d Mon Sep 17 00:00:00 2001 From: David Cliff Date: Tue, 28 Jan 2025 18:08:20 +0000 Subject: [PATCH] Moved .atlas to .env - modify github actions to use .env. Add arch value to docker compose files. --- .atlas | 1 - .env.example | 2 ++ .github/workflows/build_publish.yml | 5 +++++ .github/workflows/build_test.yml | 7 ++++++- .github/workflows/deploy.yml | 7 ++++++- .gitignore | 2 ++ .version | 2 +- README.md | 9 +++++++-- docker-compose.ci.yml | 1 - docker-compose.dev.yml | 1 - docker-compose.yml | 3 +-- 11 files changed, 30 insertions(+), 10 deletions(-) delete mode 100644 .atlas create mode 100644 .env.example diff --git a/.atlas b/.atlas deleted file mode 100644 index 9014c1825..000000000 --- a/.atlas +++ /dev/null @@ -1 +0,0 @@ -0.0.157 diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..6885d42fd --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +ATLAS=0.0.157 +ARCH=amd64 diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index fc73ee2f7..2a9c55ec8 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -13,6 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Make env file + run: | + cp .env.example .env + - name: Dotenv Action + uses: falti/dotenv-action@v1.1.4 - name: Check version is not already published run: scripts/tag_check.sh $(cat .version) - name: Github Action cache diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index e95880607..b3e4f5b04 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -12,6 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Make env file + run: | + cp .env.example .env + - name: Dotenv Action + uses: falti/dotenv-action@v1.1.4 - name: Github Action cache uses: actions/cache@v3 with: @@ -33,7 +38,7 @@ jobs: - name: Start server run: | set -x - ATLAS=$(cat .atlas) docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d + docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d # - name: Create database and migrate # run: | # docker compose exec -T web bundle exec rake db:migrate diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b819cc8bb..3b142e0d8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,7 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Make env file + run: | + cp .env.example .env + - name: Dotenv Action + uses: falti/dotenv-action@v1.1.4 - name: Install HTTPie run: sudo apt-get install httpie - name: Deploy - run: http --check-status --ignore-stdin PUT cerberusv2.library.northeastern.edu/deploy token=${{ secrets.CERBERUS_TOKEN }} cerberus_version=$(cat .version) atlas_version=$(cat .atlas) + run: http --check-status --ignore-stdin PUT cerberusv2.library.northeastern.edu/deploy token=${{ secrets.CERBERUS_TOKEN }} cerberus_version=$(cat .version) atlas_version=${ATLAS} diff --git a/.gitignore b/.gitignore index 253d97f77..834a34afe 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ *.Identifier /coverage/ + +.env diff --git a/.version b/.version index 38bc52136..56f5e1b70 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.8.11 +2.8.12 diff --git a/README.md b/README.md index e4a898c19..deb8e86d3 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,19 @@ Get a copy of the codebase git clone git@github.com:NEU-Libraries/cerberus.git ``` +Make an .env file from .env.example, change as needed (i.e. ARCH to arm64) +``` +cp .env.example .env +``` + Use docker compose to pull down the containers and build Cerberus ``` -ATLAS=0.0.157 docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build +docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build ``` Once running, use another console/tab to go inside the container. ``` -docker exec -ti cerberus-web-1 /bin/sh +docker exec -ti cerberus-web-1 /bin/bash ``` Once inside, generate some test objects diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index 3af184120..4ff6aa74c 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -1,5 +1,4 @@ # Use postgres/example user/password credentials -version: '3.7' services: web: environment: diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 4f0e7c024..36233f3b2 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,5 +1,4 @@ # Use postgres/example user/password credentials -version: '3.7' services: atlas: volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 652011f63..4f916d204 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,4 @@ # Use postgres/example user/password credentials -version: '3.7' volumes: solr: db: @@ -44,7 +43,7 @@ services: CANTALOUPE_PROCESSOR_SELECTION_STRATEGY: 'ManualSelectionStrategy' CANTALOUPE_CACHE_CLIENT_ENABLED: 'true' solr: - image: nakatomi/blacklight-solr + image: nakatomi/blacklight-solr:${ARCH} ports: - 8983:8983 volumes: