1
Fork 0

Compare commits

..

8 commits

Author SHA1 Message Date
dea08e07df
Fix beangrow
Their dependency definition ends up requiring a SSH clone, which pip
fails to do.
2024-08-27 16:57:28 +02:00
d0de1040ea
Fix gitea image 2024-08-27 16:54:32 +02:00
4d81a4eafc
Merge branch 'feat/gitea-resource'
* feat/gitea-resource:
  gitea: Implement commit statuses
  gitea: Implement package
  fix(gitea): Fix version data
  feat(gitea): Add Gitea resource to fetch PRs
2024-08-27 16:53:46 +02:00
01f4d05b37
Add Gitea resource type
* gitea-split/gitea-split:
  gitea: Implement commit statuses
  gitea: Implement package
  fix(gitea): Fix version data
  feat(gitea): Add Gitea resource to fetch PRs
2024-08-27 16:51:26 +02:00
0b40c16db4 gitea: Implement commit statuses
For now this is just a simple implementation only supporting `put`
steps. `in` is a noop, so `no_get: true` is recommended.
2023-11-23 11:39:12 +01:00
3c5067f7ac gitea: Implement package 2023-11-22 16:26:58 +01:00
6d8afda5dd fix(gitea): Fix version data
Concourse only accepts strings for values in the version data.
2023-03-29 23:49:57 +02:00
3993c2556a feat(gitea): Add Gitea resource to fetch PRs 2023-03-29 18:38:16 +02:00
6 changed files with 588 additions and 482 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
.envrc
**/target/

View file

@ -6,7 +6,7 @@ fava_envelope==0.5.9
fava-investor==0.7.0
# renovate: branch=main
git+https://github.com/andreasgerstmayr/fava-dashboards.git@50a0b7c8b20e50b15bf491329e1ecab6598d8b96
git+https://github.com/beancount/beangrow.git@56f1c2a62c808917fad66fbaa4aa4028a6d2def6
git+https://github.com/beancount/beangrow.git@8bc91509db0454ad87e257431c74d4d52e991bc9
# renovate: branch=main
git+https://github.com/daniel-wells/beancount_checkclosed.git@5abc380703105c12b518144f83a5c4fe25cc8f39
# renovate: branch=main

974
images/gitea/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,40 +1,29 @@
FROM rust:alpine AS builder
FROM rust:1.80.1-alpine3.20 AS builder
# Use a dummy project to ensure the crate index is up to date.
RUN set -e; \
cargo new --color always /tmp/dummy; \
cargo add --color always --manifest-path /tmp/dummy/Cargo.toml serde; \
rm -rf /tmp/dummy; \
cargo new --color always --bin /app
RUN apk add --no-cache musl-dev;
WORKDIR /app
RUN apk add --no-cache \
# openssl-dev \
# pkgconfig \
musl-dev
# Build dependencies with a dummy project to cache those regardless of changes
# in the actual source code
COPY ./Cargo.toml ./Cargo.lock /app/
RUN cargo build --color always --release --locked
COPY . .
RUN touch -a -m ./src/main.rs && cargo build --color always --release --locked
FROM alpine AS final
RUN --mount=type=cache,id=cargo-registry,target=/usr/local/cargo/registry \
--mount=type=cache,id=cargo-target,target=/app/target \
set -e; \
cargo build --color always --release --locked; \
# The cache will disappear after this directive, so we
# need to copy the binary to a persistent place.
cp target/release/gitea /app/gitea;
RUN apk add --no-cache ca-certificates
FROM alpine:3.20.2 AS final
RUN apk add --no-cache ca-certificates;
ENV RUST_BACKTRACE=1
ENV RUST_LOG=info
COPY --from=builder /app/target/release/gitea /bin/
COPY --from=builder /app/gitea /bin/
# Put this last, as it's the only thing that's different between variants.
# This way, the previous layers can all be shared.
ARG VARIANT="missing build arg 'VARIANT'"
ARG VERSION="0.1.0"
LABEL version="$VERSION"
COPY ./shims/${VARIANT}/* /opt/resource/

View file

@ -51,6 +51,10 @@
{
"type": "file",
"name": "rust-xwin"
},
{
"type": "file",
"name": "gitea"
}
]
}

View file

@ -0,0 +1,52 @@
{% 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:
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) -%}
{{ resource('package', registry_url) }}
{{ resource('status', registry_url) }}
{{ resource('pr', registry_url) }}
{% endmacro %}
{% macro jobs() -%}
- name: gitea
serial: true
plan:
- get: repo
trigger: true
{{ build('package') }}
{{ build('status') }}
{{ build('pr') }}
- in_parallel:
steps:
{{ put('package') }}
{{ put('status') }}
{{ put('pr') }}
{% endmacro %}