Exemplo n.º 1
0
def another_scm_step_run(another_scm_pipeline_run):
    scm_step_run = models.SCMStepRun(slug='another-release', name='Another Release Katka', stage='Production',
                                     scm_pipeline_run=another_scm_pipeline_run)

    with username_on_model(models.SCMStepRun, 'initial'):
        scm_step_run.save()

    return scm_step_run
Exemplo n.º 2
0
def scm_step_run(scm_pipeline_run):
    scm_step_run = models.SCMStepRun(slug='release', name='Release Katka', stage='Production', step_type='type',
                                     scm_pipeline_run=scm_pipeline_run, sequence_id='1.1-1',
                                     started_at='2018-11-11 08:25:30+0000', ended_at='2018-11-11 09:01:40+0000')

    with username_on_model(models.SCMStepRun, 'initial'):
        scm_step_run.save()

    return scm_step_run
Exemplo n.º 3
0
def deactivated_scm_step_run(my_scm_pipeline_run):
    scm_step_run = models.SCMStepRun(
        slug="another-release",
        name="Another Release Katka",
        stage="Production",
        scm_pipeline_run=my_scm_pipeline_run,
    )
    scm_step_run.deleted = True
    with username_on_model(models.SCMStepRun, "initial"):
        scm_step_run.save()

    return scm_step_run
Exemplo n.º 4
0
def another_scm_step_run(another_scm_pipeline_run):
    scm_step_run = models.SCMStepRun(
        slug="another-release",
        name="Another Release Katka",
        stage="Production",
        scm_pipeline_run=another_scm_pipeline_run,
    )

    with username_on_model(models.SCMStepRun, "initial"):
        scm_step_run.save()

    return scm_step_run
Exemplo n.º 5
0
def _create_steps_from_dict(scm_pipeline_run, step_data):
    saved_steps = []
    for step in step_data:
        scm_step_run = models.SCMStepRun(slug=step["name"], name=step["name"], stage=step["stage"],
                                         scm_pipeline_run=scm_pipeline_run, sequence_id=step["seq"],
                                         status=step["status"], tags=step["tags"], output=step["output"],
                                         started_at=step["started_at"], ended_at=step["ended_at"])

        with username_on_model(models.SCMStepRun, 'initial'):
            scm_step_run.save()
            saved_steps.append(scm_step_run)

    return saved_steps
Exemplo n.º 6
0
def my_scm_step_run(my_scm_pipeline_run):
    scm_step_run = models.SCMStepRun(
        slug="release",
        name="Release Katka",
        stage="Production",
        step_type="type",
        scm_pipeline_run=my_scm_pipeline_run,
        sequence_id="1.1-1",
        started_at="2018-11-11 08:25:30+0000",
        ended_at="2018-11-11 09:01:40+0000",
    )

    with username_on_model(models.SCMStepRun, "initial"):
        scm_step_run.save()

    return scm_step_run
Exemplo n.º 7
0
def my_scm_step_run_with_output(my_scm_pipeline_run):
    scm_step_run = models.SCMStepRun(
        slug="release",
        name="Release Katka",
        stage="Production",
        step_type="type",
        scm_pipeline_run=my_scm_pipeline_run,
        sequence_id="1.1-1",
        started_at="2018-11-11 08:25:30+0000",
        ended_at="2018-11-11 09:01:40+0000",
        output=json.dumps({
            "build_result": "failed",
            "build_number": 1,
            "comment": "comment 1",
            "field": "test"
        }),
    )

    with username_on_model(models.SCMStepRun, "initial"):
        scm_step_run.save()

    return scm_step_run