fp/t.wip.tiltfile

219 lines
5.0 KiB
Plaintext
Raw Normal View History

2024-05-27 22:20:58 +00:00
# Tiltfile for working with Next and Strapi locally
# load('ext://cert_manager', 'deploy_cert_manager')
# deploy_cert_manager()
load('ext://dotenv', 'dotenv')
dotenv(fn='.env')
# kubefwd all namespaces Tilt deploys to.
2024-05-29 23:43:47 +00:00
# v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions')
# v1alpha1.extension(name='kubefwd:config', repo_name='default', repo_path='kubefwd')
2024-05-27 22:20:58 +00:00
# v1alpha1.extension_repo(
# name='default',
# url='https://github.com/tilt-dev/tilt-extensions'
# )
# v1alpha1.extension(
# name='ngrok:config',
# repo_name='default',
# repo_path='ngrok',
# )
# args=['--default_config_file=%s' % os.getenv('TILT_NGROK_DEFAULT_CONFIG_FILE')]
2024-06-04 23:06:47 +00:00
load('ext://helm_remote', 'helm_remote')
# helm_remote(
# 'redis',
# repo_name='redis',
# repo_url='https://charts.bitnami.com/bitnami',
# namespace='futureporn',
# version='19.5.0',
# values=['./charts/nitter/redis.values.yaml']
# )
# helm_remote(
# 'nitter',
# repo_name='truecharts',
# repo_url='https://charts.truecharts.org',
# namespace='futureporn',
# version='7.1.4',
# )
2024-05-27 22:20:58 +00:00
# helm_remote(
# 'frp-operator',
# repo_name='frp-operator',
# repo_url='https://zufardhiyaulhaq.com/frp-operator/charts/releases/',
# namespace='futureporn',
# version='1.0.0'
# )
# helm_remote(
# 'kubernetes-ingress-controller',
# repo_name='kubernetes-ingress-controller',
# repo_url='https://ngrok.github.io/kubernetes-ingress-controller',
# namespace='futureporn',
# create_namespace='false',
# set=[
# 'credentials.apiKey=%s' % os.getenv('NGROK_API_KEY'),
# 'credentials.authtoken=%s' % os.getenv('NGROK_AUTHTOKEN')
# ]
# )
2024-05-29 23:43:47 +00:00
2024-06-04 23:06:47 +00:00
# k8s_yaml(helm(
# './charts/nitter',
# values=['./charts/nitter/values.yaml'],
# ))
2024-05-27 22:20:58 +00:00
k8s_yaml(helm(
'./charts/fp',
values=['./charts/fp/values-dev.yaml'],
))
# docker_build('fp/link2cid', './packages/link2cid')
docker_build(
'fp/strapi',
'.',
build_args={
'NODE_ENV': 'development',
},
only=['./packages/strapi'],
dockerfile='./d.strapi.dockerfile',
live_update=[
sync('./packages/strapi', '/app')
]
)
# docker_build(
# 'fp/strapi-app',
# '.',
# only=["./packages/strapi-app"],
# dockerfile='d.strapi-app.dockerfile',
# live_update=[
# sync('./packages/strapi-app', '/app')
# ]
# )
load('ext://uibutton', 'cmd_button')
2024-05-29 23:43:47 +00:00
# cmd_button('postgres:seed',
# argv=['sh', './scripts/postgres-seed.sh'],
# resource='postgres',
# icon_name='dataset',
# text='seed db with schema',
# )
2024-05-27 22:20:58 +00:00
cmd_button('postgres:restore',
argv=['sh', './scripts/postgres-restore.sh'],
resource='postgres',
2024-05-29 23:43:47 +00:00
icon_name='cloud_download',
2024-05-27 22:20:58 +00:00
text='restore db from backup',
)
cmd_button('postgres:drop',
argv=['sh', './scripts/postgres-drop.sh'],
resource='postgres',
icon_name='delete',
text='delete the database'
)
2024-05-29 23:43:47 +00:00
cmd_button('postgres:backup',
argv=['sh', './scripts/postgres-backup.sh'],
resource='postgres',
icon_name='download',
text='backup the database'
)
2024-05-27 22:20:58 +00:00
## Uncomment the following for fp/next in dev mode
## this is useful for changing the UI and seeing results
docker_build(
'fp/next',
'.',
only=['./pnpm-lock.yaml', './package.json', './packages/next'],
dockerfile='d.next.dockerfile',
target='dev',
build_args={
2024-05-29 23:43:47 +00:00
'NEXT_PUBLIC_STRAPI_URL': 'https://strapi.piko.sbtp.xyz'
2024-05-27 22:20:58 +00:00
},
live_update=[
sync('./packages/next', '/app')
]
)
docker_build(
'fp/scout',
'.',
2024-06-01 02:43:44 +00:00
only=['./pnpm-lock.yaml', './package.json', './packages/scout', './packages/pg-pubsub', './packages/common'],
2024-05-27 22:20:58 +00:00
dockerfile='d.scout.dockerfile',
target='scout',
live_update=[
sync('./packages/scout', '/app')
]
)
# k8s_resource(
# workload='kubernetes-ingress-controller-manager',
# links=[
# link(os.getenv('NGROK_URL'), 'Endpoint')
# ],
# labels='ngrok'
# )
# k8s_resource(
# workload='frp-operator-controller-manager',
# labels='tunnel'
# )
# k8s_resource(
# workload='echo-deployment',
# port_forwards=['8080'],
# links=[
# link('https://echo.piko.sbtp.xyz'),
# link('http://echo.futureporn.svc.cluster.local:8080')
# ],
# labels='debug'
# )
# k8s_resource(
# workload='snake',
# port_forwards=['8080'],
# labels='debug'
# )
# k8s_resource(
# workload='game-2048',
# port_forwards=['8081:8080'],
# labels='debug'
# )
k8s_resource(
workload='next',
port_forwards=['3000'],
links=[
link('https://next.piko.sbtp.xyz'),
]
)
k8s_resource(
workload='strapi',
port_forwards=['1339'],
links=[
link('http://localhost:1339/admin'),
link('https://strapi.piko.sbtp.xyz'),
]
)
# k8s_resource(
# workload='strapi-app',
# port_forwards=['1338']
# )
2024-06-01 02:43:44 +00:00
2024-05-27 22:20:58 +00:00
k8s_resource(
workload='postgres',
port_forwards=['5432']
)
2024-06-04 23:06:47 +00:00
# k8s_resource(
# workload='pgadmin',
# port_forwards=['5050']
# )
2024-05-29 23:43:47 +00:00
2024-06-04 23:06:47 +00:00
# k8s_resource(
# workload='nitter',
# port_forwards=['6060:10606'],
# )