From 738e35e0025e49c73196404a3e3ed93d18d7438b Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Fri, 20 Sep 2019 15:38:44 -0400 Subject: [PATCH] Add vendored-source logic to full release pipeline https://github.com/tektoncd/pipeline/pull/1338 added this logic to the nightly release pipeline. --- cmd/entrypoint/kodata/LICENSE | 1 + cmd/entrypoint/kodata/VENDOR-LICENSE | 1 + tekton/publish.yaml | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 120000 cmd/entrypoint/kodata/LICENSE create mode 120000 cmd/entrypoint/kodata/VENDOR-LICENSE diff --git a/cmd/entrypoint/kodata/LICENSE b/cmd/entrypoint/kodata/LICENSE new file mode 120000 index 00000000000..7a694c9699a --- /dev/null +++ b/cmd/entrypoint/kodata/LICENSE @@ -0,0 +1 @@ +LICENSE \ No newline at end of file diff --git a/cmd/entrypoint/kodata/VENDOR-LICENSE b/cmd/entrypoint/kodata/VENDOR-LICENSE new file mode 120000 index 00000000000..587bc4e4165 --- /dev/null +++ b/cmd/entrypoint/kodata/VENDOR-LICENSE @@ -0,0 +1 @@ +third_party/VENDOR-LICENSE \ No newline at end of file diff --git a/tekton/publish.yaml b/tekton/publish.yaml index 0a8c349d04e..20f303b4eec 100644 --- a/tekton/publish.yaml +++ b/tekton/publish.yaml @@ -130,6 +130,19 @@ spec: # Change to directory with our .ko.yaml cd /workspace/go/src/github.com/tektoncd/pipeline + # For each cmd/* directory, include a full gzipped tar of all source in + # vendor/. This is overkill. Some deps' licenses require the source to be + # included in the container image when they're used as a dependency. + # Rather than trying to determine which deps have this requirement (and + # probably get it wrong), we'll just targz up the whole vendor tree and + # include it. As of 9/20/2019, this amounts to about 11MB of additional + # data in each image. + TMPDIR=$(mktemp -d) + tar cvfz ${TMPDIR}/source.tar.gz vendor/ + for d in cmd/*; do + ln -s ${TMPDIR}/source.tar.gz ${d}/kodata/ + done + # Publish images and create release.yaml ko resolve --preserve-import-paths -f /workspace/go/src/github.com/tektoncd/pipeline/config/ > /workspace/output/bucket/latest/release.yaml volumeMounts: