diff --git a/Justfile b/Justfile index 82920d1..5687431 100644 --- a/Justfile +++ b/Justfile @@ -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 diff --git a/images/python-script/Dockerfile b/images/python-script/Dockerfile index 2fe425b..522236d 100644 --- a/images/python-script/Dockerfile +++ b/images/python-script/Dockerfile @@ -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; diff --git a/pipelines/build-and-push.yml.j2 b/pipelines/build-and-push.yml.j2 index 7c3ef2b..2e06255 100644 --- a/pipelines/build-and-push.yml.j2 +++ b/pipelines/build-and-push.yml.j2 @@ -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 #} diff --git a/pipelines/jobs/gitea.yml.j2 b/pipelines/jobs/gitea.yml.j2 index c911653..22647a3 100644 --- a/pipelines/jobs/gitea.yml.j2 +++ b/pipelines/jobs/gitea.yml.j2 @@ -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 #} diff --git a/pipelines/jobs/rust-xwin.yml.j2 b/pipelines/jobs/rust-xwin.yml.j2 index 1e5b2d1..71a2c13 100644 --- a/pipelines/jobs/rust-xwin.yml.j2 +++ b/pipelines/jobs/rust-xwin.yml.j2 @@ -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 #} diff --git a/pipelines/jobs/simple-image.yml.j2 b/pipelines/jobs/simple-image.yml.j2 index 4cfbbb8..0341f1b 100644 --- a/pipelines/jobs/simple-image.yml.j2 +++ b/pipelines/jobs/simple-image.yml.j2 @@ -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 #}