Skip to content

Commit 5b57b46

Browse files
committed
add skipBuild for non-Node/Python images
1 parent 949e450 commit 5b57b46

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,14 @@ func main() {
103103
case "build":
104104
if len(services.Functions) > 0 {
105105
for k, function := range services.Functions {
106-
function.Name = k
107-
// fmt.Println(k, function)
108-
fmt.Printf("Building: %s.\n", function.Name)
109-
buildImage(function.Image, function.Handler, function.Name, function.Language, nocache)
106+
if function.SkipBuild {
107+
fmt.Printf("Skipping build of: %s.\n", function.Name)
108+
} else {
109+
function.Name = k
110+
// fmt.Println(k, function)
111+
fmt.Printf("Building: %s.\n", function.Name)
112+
buildImage(function.Image, function.Handler, function.Name, function.Language, nocache)
113+
}
110114
}
111115
} else {
112116
if len(image) == 0 {

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
docker build -t faas-cli . && \
3+
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t faas-cli . && \
44
docker create --name faas-cli faas-cli && \
55
docker cp faas-cli:/root/faas-cli . && \
66
docker rm -f faas-cli

schema.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type Function struct {
2222
FProcess string `yaml:"fprocess"`
2323

2424
Environment map[string]string `yaml:"environment"`
25+
26+
SkipBuild bool `yaml:"skipBuild"`
2527
}
2628

2729
// Services root level YAML file to define FaaS function-set

0 commit comments

Comments
 (0)