diff --git a/.gitignore b/.gitignore index 3de91f0..9ef35e6 100644 --- a/.gitignore +++ b/.gitignore @@ -22,5 +22,7 @@ target/ *.rar *.tgz +Chart.lock + # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* diff --git a/.tiltignore b/.tiltignore new file mode 100644 index 0000000..1d1ebbc --- /dev/null +++ b/.tiltignore @@ -0,0 +1,3 @@ +*.tgz +tilt/oneplusbot-dev/tmpcharts/ +tilt/oneplusbot-dev/charts/*.tgz \ No newline at end of file diff --git a/Tiltfile b/Tiltfile index a67b32e..8005ab6 100644 --- a/Tiltfile +++ b/Tiltfile @@ -18,7 +18,7 @@ local_resource( docker_build_with_restart( registry + 'oneplus-bot-image', './application/executable/target/jar', - entrypoint=['java', '-noverify', '-cp', '.:./lib/*', 'dev.sheldan.oneplus.bot.executable.Application'], + entrypoint=['java', '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005', '-cp', '.:./lib/*', 'dev.sheldan.oneplus.bot.executable.Application'], dockerfile='./application/executable/Dockerfile', live_update=[ sync('./application/executable/target/jar/BOOT-INF/lib', '/app/lib'), @@ -33,7 +33,8 @@ docker_build(registry + 'oneplus-bot-template-data', 'deployment/image-packaging docker_build(registry + 'oneplus-bot-private-rest-api', 'deployment/image-packaging/src/main/docker/private-rest-api/', build_args={'REGISTRY_PREFIX': abstracto_registry}) -k8s_yaml(helm('deployment/helm/oneplus-bot', values= +local('cd tilt/oneplusbot-dev && helm dep up') +k8s_yaml(helm('tilt/oneplusbot-dev', values= ['./../OnePlusBot-environments/argocd/apps/oneplus-bot/values/local/values.yaml', 'secrets://./../OnePlusBot-environments/argocd/apps/oneplus-bot/values/local/values.secrets.yaml'] )) diff --git a/application/executable/src/main/resources/application.properties b/application/executable/src/main/resources/application.properties index c27871c..50578bc 100644 --- a/application/executable/src/main/resources/application.properties +++ b/application/executable/src/main/resources/application.properties @@ -2,8 +2,8 @@ spring.datasource.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME} spring.datasource.username= ${DB_USER} spring.datasource.password= ${DB_PASS} spring.datasource.hikari.maximum-pool-size=${hikariPoolSize} -spring.jpa.hibernate.default_schema=abstracto -spring.jpa.properties.hibernate.default_schema=abstracto +spring.jpa.hibernate.default_schema=${DB_SCHEMA} +spring.jpa.properties.hibernate.default_schema=${DB_SCHEMA} spring.quartz.jdbc.initialize-schema=never management.metrics.tags.application=OnePlusBot management.endpoint.health.probes.enabled=true diff --git a/deployment/helm/oneplus-bot/templates/db-config-deployment-job.yaml b/deployment/helm/oneplus-bot/templates/db-config-deployment-job.yaml index ca963da..55a013d 100644 --- a/deployment/helm/oneplus-bot/templates/db-config-deployment-job.yaml +++ b/deployment/helm/oneplus-bot/templates/db-config-deployment-job.yaml @@ -48,7 +48,7 @@ spec: name: db-credentials key: dbName - name: DB_SCHEME - value: "abstracto" + value: {{ .Values.dbCredentials.schema }} volumeMounts: - mountPath: "/var/db-config/" name: database-config-mount diff --git a/deployment/helm/oneplus-bot/templates/deployment.yaml b/deployment/helm/oneplus-bot/templates/deployment.yaml index 4b4f000..acd2258 100644 --- a/deployment/helm/oneplus-bot/templates/deployment.yaml +++ b/deployment/helm/oneplus-bot/templates/deployment.yaml @@ -57,6 +57,8 @@ spec: secretKeyRef: name: db-credentials key: dbName + - name: DB_SCHEMA + value: {{ .Values.dbCredentials.schema }} - name: NEWS_FORUM_POST_NOTIFICATION_SERVER_ID value: "{{ .Values.bot.config.newsForumPostNotificationServerId }}" - name: TOKEN diff --git a/deployment/helm/oneplus-bot/templates/template-deployment-job.yaml b/deployment/helm/oneplus-bot/templates/template-deployment-job.yaml index 79d66e3..68f796e 100644 --- a/deployment/helm/oneplus-bot/templates/template-deployment-job.yaml +++ b/deployment/helm/oneplus-bot/templates/template-deployment-job.yaml @@ -48,7 +48,7 @@ spec: name: db-credentials key: dbName - name: DB_SCHEME - value: "abstracto." + value: "{{ .Values.dbCredentials.schema }}." volumeMounts: - mountPath: "/var/template-config/" name: template-config-mount diff --git a/deployment/helm/oneplus-bot/values.yaml b/deployment/helm/oneplus-bot/values.yaml index 13fb3f2..3fcc9ba 100644 --- a/deployment/helm/oneplus-bot/values.yaml +++ b/deployment/helm/oneplus-bot/values.yaml @@ -44,6 +44,7 @@ dbCredentials: userName: null password: null name: null + schema: abstracto privateRestApi: enabled: true repository: harbor.sheldan.dev/oneplus-bot diff --git a/tilt/oneplusbot-dev/Chart.yaml b/tilt/oneplusbot-dev/Chart.yaml new file mode 100644 index 0000000..f5fe0e2 --- /dev/null +++ b/tilt/oneplusbot-dev/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v2 +description: oneplusbot dev chart +name: oneplusbot-dev +version: 1.0.0 +dependencies: + - name: oneplus-bot + repository: file://../../deployment/helm/oneplus-bot + version: ">= 0.0.1" + - name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 12.12.10 # 13.x.x uses postgresql 16.x