Skip to content

HARMONY-1573: Add retry for build other images. #64

HARMONY-1573: Add retry for build other images.

HARMONY-1573: Add retry for build other images. #64

name: Harmony in a box
on: [push]
jobs:
harmony-in-a-box:
runs-on: macos-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install setuptools
run: sudo -H pip install setuptools
- name: Install docker
run: |
brew update
brew install docker
brew install kubectl
colima start --cpu 2 --memory 12 --with-kubernetes
- name: Install awslocal
run: |
pip install awscli-local
- name: Print awslocal Version
run: |
awslocal --version
- name: Pull down basic harmony docker images
run: bin/pull-harmony-images
- name: Install dependencies
run: |
source bin/helper
retry_command 10 npm ci
- name: Build harmony image
run: |
source bin/helper
retry_command 10 npm run build
- name: Build all other images
run: |
source bin/helper
retry_command 10 npm run build-sequential
- name: list images
run: docker images
- name: Start harmony in a box
run: KUBE_CONTEXT=colima EXEC_CONTEXT=workflow bin/bootstrap-harmony
env:
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
OAUTH_UID: ${{ secrets.OAUTH_UID }}
OAUTH_PASSWORD: ${{ secrets.OAUTH_PASSWORD }}
- name: debug pods
run: |
kubectl -n harmony get pods
- name: Check if harmony server is up
run: |
HTTP_STATUS=$(curl -I -s -o /dev/null -w "%{http_code}" "http://localhost:3000")
echo "harmony server status code: $HTTP_STATUS"
- name: Run harmony request
id: curl
run: |
HTTP_STATUS=$(curl -Ln -bj -w "%{http_code}" "http://localhost:3000/C1233800302-EEDTEST/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?granuleId=G1233800343-EEDTEST&format=image/tiff" -o ./output.tif)
echo "http_status=$HTTP_STATUS" >> "$GITHUB_OUTPUT"
- name: Check HTTP status code
env:
HTTP_STATUS: ${{ steps.curl.outputs.http_status }}
run: |
if [[ "$HTTP_STATUS" -eq 200 ]]; then
echo "HTTP request was successful!"
else
echo "HTTP request failed with status code $HTTP_STATUS"
exit 1
fi