{% macro resource(variant, registry_url) -%} - name: image-gitea-{{ variant }} type: registry-image icon: docker source: repository: "{{ registry_url }}/gitea-{{ variant }}" tag: latest {% endmacro %} {% macro build(variant) -%} - task: build-gitea-{{ variant }} file: repo/tasks/build-image.yml privileged: true vars: context: repo/images/gitea target: '' dockerfile: '' params: BUILD_ARG_VARIANT: {{ variant }} output_mapping: image: image-gitea-{{ variant }} {% endmacro %} {% macro put(variant) -%} - put: image-gitea-{{ variant }} inputs: detect params: { image: image-gitea-{{ variant }}/image.tar } no_get: true {% endmacro %} {% macro resources(registry_url) -%} - name: status-gitea type: gitea-status source: access_token: ((forgejo_api_key)) url: ((forgejo_url)) owner: ((repo_owner)) repo: ((repo_name)) type: generic context: build/gitea description: Building images gitea-package, gitea-pr, gitea-status {{ resource('package', registry_url) }} {{ resource('status', registry_url) }} {{ resource('pr', registry_url) }} {% endmacro %} {% macro jobs() -%} - name: gitea serial: true on_success: put: state-success resource: status-gitea no_get: true params: state: success sha: ((.:git_sha)) on_failure: put: state-failure resource: status-gitea no_get: true params: state: failure sha: ((.:git_sha)) plan: - get: repo trigger: true - load_var: git_sha file: repo/.git/ref - put: state-pending resource: status-gitea no_get: true params: state: pending sha: ((.:git_sha)) {{ build('package') }} {{ build('status') }} {{ build('pr') }} - in_parallel: steps: {{ put('package') }} {{ put('status') }} {{ put('pr') }} {% endmacro %} {# vim: ft=yaml-jinja #}