Skip to content
Snippets Groups Projects
Commit 20289da1 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Merge branch 'ws1808-ingest_obs_dir_renaming' into 'main'

WS-1808 ingest_obs directory renaming

See merge request !1454
parents 44511616 ab8ec1ea
No related branches found
No related tags found
1 merge request!1454WS-1808 ingest_obs directory renaming
Pipeline #11727 passed
"""ingest obs workflow renaming
Revision ID: 569416c40ca8
Revises: 08090cb7acc4
Create Date: 2023-09-20 09:34:23.628834
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '569416c40ca8'
down_revision = '08090cb7acc4'
branch_labels = None
depends_on = None
old_ingest_obs_sh = """#!/bin/sh
set -o errexit
./ingest_envoy --observation $1 $2
"""
# Workflow will rename the directory to indicate the ingestion status
new_ingest_obs_sh = """#!/bin/sh
set -o errexit
running=$2.running
ingested=$2.ingested
failed=$2.failed
mv $2 $running
./ingest_envoy --observation $1 $running
status=$?
[ $status -eq 0 ] && mv $running $ingested || mv $running $failed
"""
def upgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{new_ingest_obs_sh}'
WHERE filename='ingest_obs.sh'
"""
)
def downgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{old_ingest_obs_sh}'
WHERE filename='ingest_obs.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