Skip to content

Commit

Permalink
Enhancements to locally running CI tests (#77)
Browse files Browse the repository at this point in the history
* 302 means we're redirecting to /core/install.php which is a failure, not a success
* Allow testing PRs from islandora-starter-site easier
  • Loading branch information
joecorall authored Nov 20, 2024
1 parent 612df53 commit 1eac0a8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ on:
required: true
type: string
default: 'main'
starter-site-owner:
description: "The GitHub org the starter site resides in"
required: true
type: string
default: 'Islandora-Devops'
starter-site-ref:
description: "The islandora-starter-site ref to checkout (heads/BRANCH-NAME or tags/TAG-NAME)"
description: "The islandora-starter-site git ref to checkout (heads/BRANCH-NAME or tags/TAG-NAME)"
required: true
type: string
default: 'heads/main'
Expand All @@ -23,6 +28,7 @@ jobs:
os: [ubuntu-22.04, ubuntu-24.04]
env:
ISLANDORA_TAG: "${{ github.event.inputs.buildkit-tag }}"
ISLANDORA_STARTER_OWNER: "${{ github.event.inputs.starter-site-owner }}"
ISLANDORA_STARTER_REF: "${{ github.event.inputs.starter-site-ref }}"
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion tests/init-template-starter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ if [ ! -v ISLANDORA_STARTER_REF ] || [ "$ISLANDORA_STARTER_REF" = "" ]; then
ISLANDORA_STARTER_REF=heads/main
fi

if [ ! -v ISLANDORA_STARTER_OWNER ] || [ "$ISLANDORA_STARTER_OWNER" = "" ]; then
ISLANDORA_STARTER_OWNER="islandora-devops"
fi

if [ ! -v ISLANDORA_TAG ] || [ "$ISLANDORA_TAG" = "" ]; then
ISLANDORA_TAG=main
fi

# save the site template default settings.php
# so we can overwrite it for the starter site
mv drupal/rootfs/var/www/drupal/assets/patches/default_settings.txt .
curl -L "https://github.com/Islandora-Devops/islandora-starter-site/archive/refs/${ISLANDORA_STARTER_REF}.tar.gz" \
curl -L "https://github.com/${ISLANDORA_STARTER_OWNER}/islandora-starter-site/archive/refs/${ISLANDORA_STARTER_REF}.tar.gz" \
| tar --strip-components=1 -C drupal/rootfs/var/www/drupal -xz
mv default_settings.txt drupal/rootfs/var/www/drupal/assets/patches/default_settings.txt

Expand Down
2 changes: 1 addition & 1 deletion tests/ping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COUNTER=0
while true; do
HTTP_STATUS=$(curl -w '%{http_code}' -o /dev/null -s https://islandora.dev/)
echo "Ping returned http status ${HTTP_STATUS}, exit code $?"
if [ "${HTTP_STATUS}" -eq 200 ] || [ "${HTTP_STATUS}" -eq 302 ]; then
if [ "${HTTP_STATUS}" -eq 200 ]; then
echo "We're live 🚀"
exit 0
fi
Expand Down

0 comments on commit 1eac0a8

Please sign in to comment.