add skipBuild for non-Node/Python images

This commit is contained in:
Alex Ellis
2017-05-23 14:52:02 +01:00
parent 949e450776
commit 5b57b46bb1
3 changed files with 11 additions and 5 deletions

12
app.go
View File

@@ -103,10 +103,14 @@ func main() {
case "build":
if len(services.Functions) > 0 {
for k, function := range services.Functions {
function.Name = k
// fmt.Println(k, function)
fmt.Printf("Building: %s.\n", function.Name)
buildImage(function.Image, function.Handler, function.Name, function.Language, nocache)
if function.SkipBuild {
fmt.Printf("Skipping build of: %s.\n", function.Name)
} else {
function.Name = k
// fmt.Println(k, function)
fmt.Printf("Building: %s.\n", function.Name)
buildImage(function.Image, function.Handler, function.Name, function.Language, nocache)
}
}
} else {
if len(image) == 0 {

View File

@@ -1,6 +1,6 @@
#!/bin/sh
docker build -t faas-cli . && \
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t faas-cli . && \
docker create --name faas-cli faas-cli && \
docker cp faas-cli:/root/faas-cli . && \
docker rm -f faas-cli

View File

@@ -22,6 +22,8 @@ type Function struct {
FProcess string `yaml:"fprocess"`
Environment map[string]string `yaml:"environment"`
SkipBuild bool `yaml:"skipBuild"`
}
// Services root level YAML file to define FaaS function-set