Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*DO NOT MERGE* Playground integration Test - submodule with command build #383

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "site/carvel-ytt"]
path = site/carvel-ytt
url = https://github.com/vmware-tanzu/carvel-ytt
3 changes: 3 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/resources/_gen/
/public
.DS_Store

# Local Netlify folder
.netlify
1 change: 1 addition & 0 deletions site/carvel-ytt
Submodule carvel-ytt added at bc76fa
2 changes: 1 addition & 1 deletion site/content/ytt/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function NewExamples(parentEl, templates, exampleLocation, blocker) {
var exampleSets = JSON.parse(data);

exampleSets.forEach(exampleSet => {

$(".button-container").append(
'<p>' +
'<button type="button" class="button example-set-button" name="' + exampleSet.id + '">' +
Expand Down
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

10 changes: 8 additions & 2 deletions site/netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[build]
publish = "public"
command = "hugo --gc --minify"
command = "cd carvel-ytt && ./hack/build-netlify-function.sh && cd .. && hugo --gc --minify"

[context.development.environment]
HUGO_VERSION = "0.78.0"
HUGO_ENV = "development"
GO_VERSION = "1.17.3"

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

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

[context.deploy-preview.environment]
HUGO_VERSION = "0.78.0"
GO_VERSION = "1.17.3"

[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
Expand Down