Add the support to build container image for kn (#152)

This commit is contained in:
Vincent 2019-06-06 20:30:40 -04:00 committed by Knative Prow Robot
parent 0800d7c4d3
commit 5d2a7aa912
2 changed files with 18 additions and 1 deletions

15
config/release.yaml Normal file
View File

@ -0,0 +1,15 @@
# Copyright 2019 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
image: github.com/knative/client/cmd/kn

View File

@ -32,7 +32,9 @@ function build_release() {
GOOS=darwin GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/...
echo "🚧 🎠 Building for Windows"
GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/...
ARTIFACTS_TO_PUBLISH="kn-darwin-amd64 kn-linux-amd64 kn-windows-amd64.exe"
echo "🚧 🐳 Building the container image"
ko resolve ${KO_FLAGS} -f config/ > kn-image-location.yaml
ARTIFACTS_TO_PUBLISH="kn-darwin-amd64 kn-linux-amd64 kn-windows-amd64.exe kn-image-location.yaml"
if type sha256sum >/dev/null 2>&1; then
echo "🧮 Checksum:"
sha256sum ${ARTIFACTS_TO_PUBLISH}