{% set done = status in ('complete', 'failed') if status is defined else (job and job.status.value in ('complete', 'failed')) %} {% set current_status = status if status is defined else (job.status.value if job else 'unknown') %} {% set log_lines = log if log is defined else (job.log if job else []) %} {% set _job_id = job_id if job_id is defined else (job.id if job else '') %} {% set _poll_url = '/api/builder/jobs/' ~ _job_id ~ '/status' %}
{% if current_status == 'complete' %} Build Complete {% elif current_status == 'failed' %} Build Failed {% else %} {{ current_status | replace('_', ' ') }}… {% endif %}
{% if current_status == 'complete' and job and job.result %} Build Another {% elif current_status == 'failed' %} Try Again {% endif %}
{% if job %}
{% if job.base_image %}
Base Image
{{ job.base_image }}
{% endif %} {% if job.region %}
Region
{{ job.region }}
{% endif %} {% if job.instance_type %}
Instance Type
{{ job.instance_type }}
{% endif %} {% if job.subnet_id %}
{% if job.subnet_id.startswith('vpc-') %}VPC{% else %}Subnet{% endif %}
{{ job.subnet_id }}
{% endif %}
{% endif %} {% if current_status == 'complete' and job and job.result %}
Golden Image Ready
{{ job.result.artifact_id }}
{% if job.result.region %}
{{ job.result.region }}
{% endif %}
{% if job.region and job.result.artifact_id %} AWS Console {% endif %}
{% endif %}
{% set steps = [('provisioning', 'Provision'), ('hardening', 'Harden'), ('scanning', 'Scan'), ('snapshotting', 'Snapshot'), ('complete', 'Done')] %} {% set step_order = ['provisioning', 'hardening', 'scanning', 'snapshotting', 'complete'] %} {% for step_val, step_label in steps %} {% set step_idx = step_order.index(step_val) %} {% set current_idx = step_order.index(current_status) if current_status in step_order else (-1 if current_status != 'failed' else 4) %}
{% if current_idx > step_idx or current_status == 'complete' %} {% else %} {{ loop.index }} {% endif %}
{{ step_label }}
{% endfor %}
{% if log_lines %}
Build Log
{% for line in log_lines %} {% if line.strip() %}
{{ line }}
{% endif %} {% endfor %}
{% endif %}