ci: fix production env
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

pull/78/head 1.0.0-production.1
Supan Adit Pratama 2024-08-23 10:06:24 +07:00
parent c3950c7041
commit 4a13730231
2 changed files with 20 additions and 7 deletions

View File

@ -14,6 +14,22 @@ steps:
script: script:
- cd /home/eigen/PROJECT/POS/POS.DEV/BE - cd /home/eigen/PROJECT/POS/POS.DEV/BE
- sh build.sh - sh build.sh
when:
ref:
- refs/tags/devel_*
- refs/tags/*-alpha.*
- name: build-production
image: plugins/docker
settings:
registry: registry.eigen.co.id
repo: registry.eigen.co.id/eigen/${DRONE_REPO_NAME}
build_args:
- env_target=env.production
tags: ${DRONE_TAG}
custom_dns: 172.10.10.16
when:
ref:
- refs/tags/*-production.*
- name: send-message - name: send-message
image: plugins/webhook image: plugins/webhook
settings: settings:
@ -27,9 +43,6 @@ steps:
"message": "Build {{repo.name}} sudah selesai" "message": "Build {{repo.name}} sudah selesai"
} }
trigger: trigger:
ref:
- refs/tags/devel_*
- refs/tags/*-alpha.*
event: event:
exclude: exclude:
- promote - promote

View File

@ -5,11 +5,11 @@ COPY . .
RUN yarn install RUN yarn install
RUN yarn build RUN yarn build
FROM node:18.17-alpine FROM node:18.17-alpine
ARG env_target # ARG env_target
WORKDIR /app WORKDIR /app
RUN echo ${env_target} # RUN echo ${env_target}
COPY env/$env_target /app/.env # COPY env/$env_target /app/.env
COPY --from=builder /app/env/$env_target .env # COPY --from=builder /app/env/$env_target .env
COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist
COPY --from=builder /app/assets ./assets COPY --from=builder /app/assets ./assets