1
Fork 0

Compare commits

..

No commits in common. "3df40715b40f1d8b4fbe8698daabd0760e7d3a83" and "6431c4c01e912cb5b06412bec5f9433ed6b66a4c" have entirely different histories.

6 changed files with 6 additions and 128 deletions

View file

@ -3,10 +3,7 @@ target := 'main'
# Internal endpoint of the Docker registry, where no authentication is necessary
registry_url := env_var_or_default('REGISTRY_URL', 'docker.io/')
forgejo_api_key := env_var("FORGEJO_API_KEY")
forgejo_url := shell("git remote get-url origin | sed 's|git@\\([^:]*\\):\\(.*\\).git|https://\\1/\\2|' | cut -d'/' -f-3")
repo_owner := shell("git remote get-url origin | sed 's|git@\\([^:]*\\):\\(.*\\).git|https://\\1/\\2|' | cut -d'/' -f4")
repo_name := shell("git remote get-url origin | sed 's|git@\\([^:]*\\):\\(.*\\).git|https://\\1/\\2|' | cut -d'/' -f5-")
repo_url := shell("git remote get-url origin | sed 's|git@\\([^:]*\\):\\(.*\\).git|https://\\1/\\2|'")
pipeline_file := shell('mktemp')
@ -33,10 +30,7 @@ set-pipeline: (make-pipeline pipeline_file)
--pipeline {{pipeline_name}} \
--config "{{pipeline_file}}" \
-v registry_url={{registry_url}} \
-v forgejo_api_key={{forgejo_api_key}} \
-v forgejo_url={{forgejo_url}} \
-v repo_owner={{repo_owner}} \
-v repo_name={{repo_name}}
-v repo_url={{repo_url}}
validate:
docker run --rm -v ./:/usr/src/app renovate/renovate renovate-config-validator --strict

View file

@ -30,5 +30,6 @@ ENV PATH=/home/runner/.local/bin:$PATH
COPY requirements.txt ./
RUN --mount=type=cache,id=pip-cache,target=/home/runner/.cache/pip \
pip install --user -r requirements.txt;
RUN set -e; \
pip install --user -r requirements.txt; \
rm -r /home/runner/.cache;

View file

@ -1,16 +1,5 @@
{%- import 'jobs/simple-image.yml.j2' as simple_image %}
{%- macro simple_image_resource(name, registry_url) -%}
- name: status-{{name}}
type: gitea-status
source:
access_token: ((forgejo_api_key))
url: ((forgejo_url))
owner: ((repo_owner))
name: ((repo_name))
type: generic
context: build/{{name}}
description: Building image {{name}}
- name: image-{{ name }}
type: registry-image
icon: docker
@ -26,17 +15,12 @@ resource_types:
source:
repository: concourse/github-release-resource
- name: gitea-status
type: registry-image
source:
repository: ((registry_url))/gitea-status
resources:
- name: repo
type: git
icon: github
source:
uri: ((forgejo_url))/((repo_owner))/((repo_name))
uri: ((repo_url))
branch: master
{%- set registry_url = "((registry_url))" %}
@ -58,5 +42,3 @@ jobs:
{{ job.jobs() }}
{%- endif %}
{% endfor %}
{# vim: ft=yaml-jinja #}

View file

@ -29,17 +29,6 @@
{% endmacro %}
{% macro resources(registry_url) -%}
- name: status-gitea
type: gitea-status
source:
access_token: ((forgejo_api_key))
url: ((forgejo_url))
owner: ((repo_owner))
name: ((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) }}
@ -48,33 +37,9 @@
{% 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') }}
@ -85,4 +50,3 @@
{{ put('pr') }}
{% endmacro %}
{# vim: ft=yaml-jinja #}

View file

@ -1,15 +1,4 @@
{% macro resources(registry_url) -%}
- name: status-rust-xwin
type: gitea-status
source:
access_token: ((forgejo_api_key))
url: ((forgejo_url))
owner: ((repo_owner))
name: ((repo_name))
type: generic
context: build/rust-xwin
description: Building image rust-xwin
- name: image-rust-xwin
type: registry-image
icon: docker
@ -28,33 +17,9 @@
{% macro jobs() -%}
- name: rust-xwin
serial: true
on_success:
put: state-success
resource: status-rust-xwin
no_get: true
params:
state: success
sha: ((.:git_sha))
on_failure:
put: state-failure
resource: status-rust-xwin
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-rust-xwin
no_get: true
params:
state: pending
sha: ((.:git_sha))
- task: build-rust-xwin
file: repo/tasks/build-image.yml
privileged: true
@ -84,5 +49,3 @@
params: { image: image-rust-xwin-ci/image.tar }
no_get: true
{% endmacro %}
{# vim: ft=yaml-jinja #}

View file

@ -1,33 +1,9 @@
{% macro jobs(job) -%}
- name: {{ job.name }}
serial: true
on_success:
put: state-success
resource: status-{{ job.name }}
no_get: true
params:
state: success
sha: ((.:git_sha))
on_failure:
put: state-failure
resource: status-{{ job.name }}
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-{{ job.name }}
no_get: true
params:
state: pending
sha: ((.:git_sha))
- task: build-image
privileged: true
file: repo/tasks/build-image.yml
@ -46,5 +22,3 @@
params: { image: image/image.tar }
no_get: true
{%- endmacro -%}
{# vim: ft=yaml-jinja #}