Skip to content
Snippets Groups Projects
Commit 01050f23 authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

added schema revisions for workflow template scripts to fail when expections...

added schema revisions for workflow template scripts to fail when expections are throw from productfetcher
parent 9e524b0d
No related branches found
No related tags found
1 merge request!321added schema revisions for workflow template scripts to fail when expections...
Pipeline #2086 passed
"""empty message
Revision ID: 12b2de18a383
Revises: 6231bb30d95d, 7c1f6f0cef32
Create Date: 2021-07-01 16:04:19.731212
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '12b2de18a383'
down_revision = ('6231bb30d95d', '7c1f6f0cef32')
branch_labels = None
depends_on = None
def upgrade():
pass
def downgrade():
pass
"""added errexit to std_calibration script template
Revision ID: 2ac701610fc7
Revises: 12b2de18a383
Create Date: 2021-07-01 16:04:31.042789
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2ac701610fc7'
down_revision = '12b2de18a383'
branch_labels = None
depends_on = None
def upgrade():
shell_script_content_std_calibration = """#!/bin/sh
export HOME=$TMPDIR
set -o errexit
./framework.sh -d .
chmod 770 .
cd rawdata/
../productfetcher --product-locator $1
cd ../
./casa_envoy --standard-cal $3 $4
./conveyor --deliver $3
"""
op.execute(
"UPDATE workflow_templates "
f"SET content = E'{shell_script_content_std_calibration}' "
"WHERE filename = 'std_calibration.sh'"
)
def downgrade():
shell_script_content_std_calibration = """#!/bin/sh
export HOME=$TMPDIR
./framework.sh -d .
chmod 770 .
cd rawdata/
../productfetcher --product-locator $1
cd ../
./casa_envoy --standard-cal $3 $4
./conveyor --deliver $3
"""
op.execute(
"UPDATE workflow_templates "
f"SET content = E'{shell_script_content_std_calibration}' "
"WHERE filename = 'std_calibration.sh'"
)
"""update download workflow script to fail on error
Revision ID: 7c1f6f0cef32
Revises: a832fcb74a8c
Create Date: 2021-06-30 22:56:03.478526
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7c1f6f0cef32'
down_revision = 'a832fcb74a8c'
branch_labels = None
depends_on = None
def upgrade():
shell_script_content = """#!/bin/sh
set -o errexit
chmod 770 .
./productfetcher --product-locator $1
./deliver -r . --prefix $2
"""
op.execute(
"UPDATE workflow_templates "
f"SET content = E'{shell_script_content}' "
"WHERE filename = 'test_download.sh'"
)
def downgrade():
shell_script_content = """#!/bin/sh
chmod 770 .
./productfetcher --product-locator $1
./deliver -r . --prefix $2
"""
op.execute(
"UPDATE workflow_templates "
f"SET content = E'{shell_script_content}' "
"WHERE filename = 'test_download.sh'"
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment