From 50c66fee7d816b12ae712587fe8d99ca7d678040 Mon Sep 17 00:00:00 2001 From: Tim Schrodi Date: Tue, 11 May 2021 14:45:07 +0200 Subject: [PATCH] add git as source (#193) --- .ci/component_descriptor | 5 ++++- .landscaper/sources.yaml | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .landscaper/sources.yaml diff --git a/.ci/component_descriptor b/.ci/component_descriptor index 277626ab4..07f0042ab 100755 --- a/.ci/component_descriptor +++ b/.ci/component_descriptor @@ -10,8 +10,9 @@ set -o pipefail SOURCE_PATH="$(dirname $0)/.." VERSION="$(${SOURCE_PATH}/hack/get-version.sh)" +COMMIT_SHA="$(git --git-dir ${SOURCE_PATH}/.git rev-parse HEAD)" -printf "> Building components with version ${VERSION}\n" +printf "> Building components with version ${VERSION} - ${COMMIT_SHA}\n" REPO_CTX="${CURRENT_COMPONENT_REPOSITORY}" @@ -27,7 +28,9 @@ function buildComponentArchive() { --component-name=github.com/gardener/landscaper/${COMPONENT_NAME} \ --component-version=${VERSION} \ --repo-ctx=${REPO_CTX} \ + -s ${SOURCE_PATH}/.landscaper/sources.yaml \ -r ${SOURCE_PATH}/.landscaper/${COMPONENT_NAME}/resources.yaml \ + COMMIT_SHA=${COMMIT_SHA} \ VERSION=${VERSION} } diff --git a/.landscaper/sources.yaml b/.landscaper/sources.yaml new file mode 100644 index 000000000..a13ecb810 --- /dev/null +++ b/.landscaper/sources.yaml @@ -0,0 +1,14 @@ +--- +name: github_com_gardener_landscaper +type: git +version: ${VERSION} +labels: +- name: cloud.gardener/cicd/source + value: + repository-classification: main +access: + type: github + commit: ${COMMIT_SHA} + ref: refs/tags/${VERSION} + repoUrl: github.com/gardener/landscaper +---