forked from vmware-archive/kubeless
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinary-controller
More file actions
executable file
·55 lines (45 loc) · 1.35 KB
/
Copy pathbinary-controller
File metadata and controls
executable file
·55 lines (45 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# Copyright (c) 2016-2017 Bitnami
#
# 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
#
# http://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.
set -e
if [ -z "$1" ]; then
# TODO: Skip windows at this moment
OS_PLATFORM_ARG=(-os="linux")
else
OS_PLATFORM_ARG=($1)
fi
if [ -z "$2" ]; then
OS_ARCH_ARG=(-arch="amd64")
else
OS_ARCH_ARG=($2)
fi
if [ -z "$3" ]; then
TARGET="kubeless-function-controller"
else
TARGET=($3)
fi
if [ -z "$4" ]; then
PKG="github.com/kubeless/kubeless/cmd/function-controller"
else
PKG=($4)
fi
GIT_COMMIT=$(git describe --tags --dirty)
BUILD_FLAGS=(-ldflags="-w -X github.com/kubeless/kubeless/pkg/version.Version=${GIT_COMMIT}")
# Get rid of existing binaries
rm -rf bundles/kubeless*
# Build kubeless-controller
gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" \
-output="bundles/kubeless_{{.OS}}-{{.Arch}}/$TARGET" \
"${BUILD_FLAGS[@]}" \
"$PKG"