Skip to content

Commit

Permalink
build functions with simple go commands
Browse files Browse the repository at this point in the history
  • Loading branch information
gcheadle-vmware committed Mar 3, 2022
1 parent 0096f6d commit 47eff27
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions site/hack/build-ytt-playground.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e -x -u

cd carvel-ytt
#go mod init ytt-submodule-playground
#go fmt $(go list ./... | grep -v yaml.v2)
go mod vendor
go mod tidy
export GOOS=linux GOARCH=amd64
ls
cd cmd/ytt && go build -o ../../../netlify/functions/ytt && cd -
cd cmd/ytt-lambda-website && go build -o ../../../netlify/functions/main && cd -
cd ..
ls
chmod +x netlify/functions/ytt netlify/functions/main

4 changes: 2 additions & 2 deletions site/netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
publish = "public"
command = "go build -o ./netlify/functions/ytt ./cmd/ytt/... && go build -o ./netlify/functions/main ./cmd/ytt-lambda-website/... && hugo --gc --minify"
command = "./hack/build-ytt-playground.sh && hugo --gc --minify"

[context.production.environment]
HUGO_VERSION = "0.78.0"
Expand All @@ -15,7 +15,7 @@ HUGO_VERSION = "0.78.0"
HUGO_ENV = "production"

[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
command = "./hack/build-ytt-playground.sh && hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"

[context.deploy-preview.environment]
HUGO_VERSION = "0.78.0"
Expand Down

0 comments on commit 47eff27

Please sign in to comment.