1
Fork 0
ci-images/Justfile
Lucas Schwiderski ea4acbb4b9
Fix commit-based pip packages
It seems that Renovate assumes Git tags for these kind of definitions,
and therefore cannot handle commit refs.
So a custom regex manager is needed, with a way to manually specify the
branch to use, thanks to the `master` vs `main` split.
2024-08-26 10:56:34 +02:00

47 lines
1.5 KiB
Makefile

pipeline_name := 'ci-images'
target := 'main'
# Internal endpoint of the Docker registry, where no authentication is necessary
registry_url := env_var_or_default('REGISTRY_URL', 'docker.io/')
repo_url := shell("git remote get-url origin | sed 's|git@\\([^:]*\\):\\(.*\\).git|https://\\1/\\2|'")
pipeline_file := shell('mktemp')
build context dockerfile='' image_target='' *args='':
fly -t {{target}} execute \
--config=./tasks/build-image.yml \
--privileged \
-i repo=. \
-o image=/tmp/build-image \
-v context=repo/images/{{context}} \
-v dockerfile={{dockerfile}} \
-v target={{image_target}} \
{{args}}
make-pipeline file:
jinja2 --strict --outfile="{{file}}" pipelines/build-and-push.yml.j2 pipelines/build-and-push.json
fly -t {{target}} validate-pipeline \
--strict \
--config "{{file}}" \
-v registry_url={{registry_url}}
set-pipeline: (make-pipeline pipeline_file)
fly -t {{target}} set-pipeline \
--pipeline {{pipeline_name}} \
--config "{{pipeline_file}}" \
-v registry_url={{registry_url}} \
-v repo_url={{repo_url}}
validate:
docker run --rm -v ./:/usr/src/app renovate/renovate renovate-config-validator --strict
renovate *args='':
docker run --rm -t \
-v ./:/usr/src/app \
-e LOG_FORMAT=pretty \
-e LOG_LEVEL=debug \
renovate/renovate \
--platform=local \
--github-token-warn=false \
{{args}} \
|& bat