# 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. # v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions') # v1alpha1.extension(name='kubefwd:config', repo_name='default', repo_path='kubefwd') # 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')] 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', # ) # 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') # ] # ) # k8s_yaml(helm( # './charts/nitter', # values=['./charts/nitter/values.yaml'], # )) 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') # cmd_button('postgres:seed', # argv=['sh', './scripts/postgres-seed.sh'], # resource='postgres', # icon_name='dataset', # text='seed db with schema', # ) cmd_button('postgres:restore', argv=['sh', './scripts/postgres-restore.sh'], resource='postgres', icon_name='cloud_download', text='restore db from backup', ) cmd_button('postgres:drop', argv=['sh', './scripts/postgres-drop.sh'], resource='postgres', icon_name='delete', text='delete the database' ) cmd_button('postgres:backup', argv=['sh', './scripts/postgres-backup.sh'], resource='postgres', icon_name='download', text='backup the database' ) ## 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={ 'NEXT_PUBLIC_STRAPI_URL': 'https://strapi.piko.sbtp.xyz' }, live_update=[ sync('./packages/next', '/app') ] ) docker_build( 'fp/scout', '.', only=['./pnpm-lock.yaml', './package.json', './packages/scout', './packages/pg-pubsub', './packages/common'], 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'] # ) k8s_resource( workload='postgres', port_forwards=['5432'] ) # k8s_resource( # workload='pgadmin', # port_forwards=['5050'] # ) # k8s_resource( # workload='nitter', # port_forwards=['6060:10606'], # )