Skip to content

Commit

Permalink
chore(ci): disable etl retries, script revisions (#1515)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Aug 15, 2024
1 parent 6949d07 commit 02bf725
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ jobs:

- name: Run sync ETL
if: github.event_name == 'pull_request'
run: ./sync/oc_run.sh ${{ secrets.oc_token }}
run: ./sync/oc_run.sh ${{ inputs.tag }} ${{ secrets.oc_token }}
23 changes: 1 addition & 22 deletions .github/workflows/job-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,4 @@ jobs:
working-directory: /usr/local/bin/

- name: ETL Sync
run: |
# Run and verify job
# Login
oc login --token=${{ secrets.oc_token }} --server=${{ vars.oc_server }}
oc project ${{ vars.oc_namespace }} #Safeguard!
# Exit on errors or unset variables
set -eu
# Create job
CRONJOB=nr-spar-test-sync
RUN_JOB=${CRONJOB}--$(date +"%Y-%m-%d--%H-%M-%S")
oc create job ${RUN_JOB} --from=cronjob/${CRONJOB}
# Follow
oc wait --for=condition=ready pod --selector=job-name=${RUN_JOB} --timeout=1m
oc logs -l job-name=${RUN_JOB} --tail=50 --follow
# Verify successful completion
oc wait --for jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=${RUN_JOB} --timeout=1m
echo "Job successful!"
run: ./sync/oc_run.sh test ${{ secrets.oc_token }}
6 changes: 3 additions & 3 deletions sync/oc_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ set -eux
# Run and verify job

# Login
if [ ! -z "${1:-}" ]; then
oc login --token=${1} --server=https://api.silver.devops.gov.bc.ca:6443
if [ ! -z "${2:-}" ]; then
oc login --token=${2} --server=https://api.silver.devops.gov.bc.ca:6443
oc project #Safeguard!
fi

# Create job
CRONJOB=nr-spar-1502-sync
CRONJOB=nr-spar-${1:-test}-sync
RUN_JOB=${CRONJOB}--$(date +"%Y-%m-%d--%H-%M-%S")
oc create job ${RUN_JOB} --from=cronjob/${CRONJOB}

Expand Down
4 changes: 2 additions & 2 deletions sync/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ parameters:
### Usually a bad idea - not recommended
- name: JOB_BACKOFF_LIMIT
description: "The number of attempts to try for a successful job outcome"
value: "3"
value: "0"
- name: JOB_HISTORY_FAIL
description: "The number of failed jobs that will be retained"
value: "2"
value: "1"
- name: JOB_HISTORY_SUCCESS
description: "The number of successful jobs that will be retained"
value: "5"
Expand Down

0 comments on commit 02bf725

Please sign in to comment.