Hi,
I am struggling to use app-vars :)
Here is my list of env vars:
REGION = ams3
BRANCH_NAME = dev
ACTIVE_PROFILE = dev
DO_SPACES_SECRET = MY_SPACES_SECRETS
DO_DB_PASSWORD = MY_DB_PASSWORD
Here is my config and properties files:
app.yaml:
name: project_1-admin
region: REGION
services:
- dockerfile_path: Dockerfile
github:
branch: BRANCH_NAME
deploy_on_push: true
repo: project_1/project_1
name: web
Dockerfile:
FROM gradle:7.5-jdk17-alpine AS _build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
ARG ACTIVE_PROFILE
ARG DO_SPACES_SECRET
ARG DO_DB_PASSWORD
RUN gradle web:build --no-daemon --debug
FROM openjdk:17-jdk-slim
EXPOSE 8080
RUN mkdir /project_1
COPY --from=_build_ /home/gradle/src/web/build/libs/web*SNAPSHOT.jar /project_1/web.jar
ARG ACTIVE_PROFILE
ARG DO_SPACES_SECRET
ARG DO_DB_PASSWORD
ENTRYPOINT ["java", "-jar", "/project_1/web.jar"]
application.properties:
spring.profiles.active=${ACTIVE_PROFILE}
application-dev.properties:
digital.ocean.spaces.secret=${DO_SPACES_SECRET}
spring.datasource.password=${DO_DB_PASSWORD}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
Have you tried to also define the environment variables in your deployment YAML file? For example:
For any sensitive env variables, you can se the scope to secret, eg:
Let me know how it goes!
Best,
Bobby