Skip to content

Fix nullpointer condition on healthcheck (#1412) #14

Fix nullpointer condition on healthcheck (#1412)

Fix nullpointer condition on healthcheck (#1412) #14

name: OpenCue Packaging Pipeline
# Trigger this pipeline on new commits to master.
on:
push:
branches: [ master ]
jobs:
integration_test:
name: Run Integration Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run test
run: ci/run_integration_test.sh
- name: Archive log files
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-logs
path: /tmp/opencue-test/*.log
build_components:
needs: integration_test
strategy:
matrix:
component: [cuebot, rqd]
include:
- component: cuebot
NAME: Cuebot
ARTIFACTS: cuebot-${BUILD_ID}-all.jar opencue-cuebot-${BUILD_ID}-1.noarch.rpm
- component: rqd
NAME: RQD
ARTIFACTS: rqd-${BUILD_ID}-all.tar.gz
- component: cuegui
NAME: CueGUI
ARTIFACTS: cuegui-${BUILD_ID}-all.tar.gz
- component: pycue
NAME: PyCue
ARTIFACTS: pycue-${BUILD_ID}-all.tar.gz
- component: pyoutline
NAME: PyOutline
ARTIFACTS: pyoutline-${BUILD_ID}-all.tar.gz
- component: cuesubmit
NAME: CueSubmit
ARTIFACTS: cuesubmit-${BUILD_ID}-all.tar.gz
- component: cueadmin
NAME: CueAdmin
ARTIFACTS: cueadmin-${BUILD_ID}-all.tar.gz
name: Build ${{ matrix.NAME }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Fetch all Git history, otherwise the current version number will
# not be correctly calculated.
fetch-depth: 0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.S3_REGION }}
role-to-assume: ${{ secrets.AWS_S3_ROLE }}
role-duration-seconds: 1800
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Set build ID
run: |
set -e
ci/generate_version_number.sh > VERSION
echo "Build ID: $(cat ./VERSION)"
echo "BUILD_ID=$(cat ./VERSION)" >> ${GITHUB_ENV}
- name: Build Docker image
uses: docker/build-push-action@v3
with:
file: ${{ matrix.component }}/Dockerfile
tags: opencuebuild/${{ matrix.component }}:${{ env.BUILD_ID }}
context: .
push: true
- name: Extract Artifacts
run: |
set -e
image_name="opencuebuild/${{ matrix.component }}:${BUILD_ID}"
container_id=$(docker create ${image_name})
artifacts="${{ matrix.ARTIFACTS }}"
mkdir -p "${GITHUB_WORKSPACE}/artifacts/"
for artifact in $artifacts; do
docker cp ${container_id}:/opt/opencue/${artifact} "${GITHUB_WORKSPACE}/artifacts/"
done
docker rm $container_id
- name: Upload Artifacts
env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
run: |
artifacts="${{ matrix.ARTIFACTS }}"
for artifact in $artifacts; do
aws s3 cp ${GITHUB_WORKSPACE}/artifacts/${artifact} s3://${S3_BUCKET}/opencue/${BUILD_ID}/
done
create_other_artifacts:
name: Create Other Build Artifacts
needs: build_components
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Fetch all Git history, otherwise the current version number will
# not be correctly calculated.
fetch-depth: 0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.S3_REGION }}
role-to-assume: ${{ secrets.AWS_S3_ROLE }}
role-duration-seconds: 1800
- name: Set build ID
run: |
set -e
ci/generate_version_number.sh > VERSION
echo "Build ID: $(cat ./VERSION)"
echo "BUILD_ID=$(cat ./VERSION)" >> ${GITHUB_ENV}
- name: Extract database schema
run: |
mkdir -p "${GITHUB_WORKSPACE}/artifacts/"
ci/extract_schema.sh ${BUILD_ID} "${GITHUB_WORKSPACE}/artifacts/"
- name: Create build metadata
run: |
mkdir -p "${GITHUB_WORKSPACE}/artifacts/"
echo "{\"git_commit\": \"$(BUILD_SOURCEVERSION)\"}" | tee "${GITHUB_WORKSPACE}/artifacts/build_metadata.json"
- name: Upload artifacts
env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
run: |
aws s3 cp LICENSE s3://${S3_BUCKET}/opencue/${BUILD_ID}/
aws s3 cp VERSION s3://${S3_BUCKET}/opencue/${BUILD_ID}/
aws s3 cp "${GITHUB_WORKSPACE}/artifacts/schema-${BUILD_ID}.sql" s3://${S3_BUCKET}/opencue/${BUILD_ID}/
aws s3 cp "${GITHUB_WORKSPACE}/artifacts/seed_data-${BUILD_ID}.sql" s3://${S3_BUCKET}/opencue/${BUILD_ID}/
aws s3 cp "${GITHUB_WORKSPACE}/artifacts/build_metadata.json" s3://${S3_BUCKET}/opencue/${BUILD_ID}/
- name: Display artifacts
env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
run: |
aws s3 ls s3://${S3_BUCKET}/opencue/${BUILD_ID}/