2022-01-21 18:24:20 +00:00
|
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
# SPDX-FileCopyrightText: 2022 Collabora, Ltd. and the Monado contributors
|
|
|
|
#
|
|
|
|
# To generate all the templated files, run this from the root of the repo:
|
|
|
|
# make -f .gitlab-ci/ci-scripts.mk
|
|
|
|
|
2022-05-18 16:10:12 +00:00
|
|
|
# These also all have their template named the same with a .jinja suffix.
|
2022-01-21 18:24:20 +00:00
|
|
|
FILES_IN_SUBDIR := \
|
|
|
|
.gitlab-ci/distributions \
|
|
|
|
.gitlab-ci/reprepro.sh \
|
|
|
|
|
|
|
|
CONFIG_FILE := .gitlab-ci/config.yml
|
2022-05-18 16:10:12 +00:00
|
|
|
OUTPUTS := .gitlab-ci.yml \
|
|
|
|
$(FILES_IN_SUBDIR)
|
|
|
|
|
|
|
|
all: $(OUTPUTS)
|
|
|
|
chmod +x .gitlab-ci/*.sh
|
2022-01-21 18:24:20 +00:00
|
|
|
.PHONY: all
|
|
|
|
|
|
|
|
clean:
|
2022-05-18 16:10:12 +00:00
|
|
|
rm -f $(OUTPUTS)
|
2022-01-21 18:24:20 +00:00
|
|
|
.PHONY: clean
|
|
|
|
|
2022-05-18 16:10:12 +00:00
|
|
|
CI_FAIRY := ci-fairy generate-template --config=$(CONFIG_FILE)
|
|
|
|
|
2022-01-21 18:24:20 +00:00
|
|
|
# As the default thing for ci-fairy to template, this is special cased
|
2022-05-18 16:10:12 +00:00
|
|
|
.gitlab-ci.yml: .gitlab-ci/ci.template .gitlab-ci/win_containers.yml $(CONFIG_FILE)
|
|
|
|
$(CI_FAIRY) $< > $@
|
2022-01-21 18:24:20 +00:00
|
|
|
|
|
|
|
# Everything else is structured alike
|
|
|
|
$(FILES_IN_SUBDIR): %: %.jinja $(CONFIG_FILE)
|
2022-05-18 16:10:12 +00:00
|
|
|
$(CI_FAIRY) $< > $@
|