Skip to content

Instantly share code, notes, and snippets.

@warroyo
Created March 28, 2023 14:14
Show Gist options
  • Save warroyo/cba46954105353613d6e029486d87262 to your computer and use it in GitHub Desktop.
Save warroyo/cba46954105353613d6e029486d87262 to your computer and use it in GitHub Desktop.
SOURCE_IMAGE = 'dev.registry.pivotal.io/warroyo/iterate/sme-fe-code'
LOCAL_PATH = os.getenv("LOCAL_PATH", default='.')
NAMESPACE = os.getenv("NAMESPACE", default='default')
k8s_custom_deploy(
'sme-frontend-code',
apply_cmd="tanzu apps workload apply -f config/workload.yaml" +
" --local-path " + LOCAL_PATH +
" --source-image " + SOURCE_IMAGE +
" --namespace " + NAMESPACE +
" --build-env BP_DISABLE_SBOM=true" +
" --build-env NODE_ENV=development" +
" --env DANGEROUSLY_DISABLE_HOST_CHECK=true" +
" --yes >/dev/null " +
"&& kubectl get workload sme-frontend-code --namespace " + NAMESPACE + " -o yaml",
delete_cmd="tanzu apps workload delete -f config/workload.yaml --namespace " + NAMESPACE + " --yes",
deps=["."],
container_selector='workload',
live_update=[
# when package.json changes, we need to do a full build
fall_back_on(['package.json', 'package-lock.json']),
sync('./', '/workspace'),
]
)
k8s_resource('sme-frontend-code', port_forwards=["8080:8080"],
extra_pod_selectors=[{'serving.knative.dev/service': 'sme-frontend-code'}])
allow_k8s_contexts(['eks.eks-warroyo2.us-west-2.tap-iterate','arn:aws:eks:us-west-2:074754820263:cluster/tap-full'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment