Skip to content

Commit

Permalink
pass env var for QA to FE build
Browse files Browse the repository at this point in the history
  • Loading branch information
mongodben committed Jul 27, 2023
1 parent fe63e55 commit 03a7199
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,15 @@ steps:
# Builds and publishes Docker image for qa
- name: publish-qa-chat-server
image: plugins/kaniko-ecr
environment:
ENVIRONMENT: qa
settings:
dockerfile: chat-server.dockerfile
create_repository: true
registry: 795250896452.dkr.ecr.us-east-1.amazonaws.com
repo: docs/${DRONE_REPO_NAME}-chat-server
build_args:
- ENVIRONMENT
tags:
- git-${DRONE_COMMIT_SHA:0:7}-qa
- latest-qa
Expand Down
3 changes: 3 additions & 0 deletions chat-server.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Build stage
FROM node:18-alpine as builder

ARG ENVIRONMENT
ENV ENVIRONMENT=${ENVIRONMENT}
RUN echo "ENVIRONMENT: ${ENVIRONMENT}"
# Install all dependencies && set up project
WORKDIR /app
COPY . ./
Expand Down
1 change: 1 addition & 0 deletions chat-ui/.env.qa
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_SERVER_BASE_URL=https://chat-qa.docs.staging.corp.mongodb.com/api/v1
4 changes: 3 additions & 1 deletion chat-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
"build:component": "tsc && vite build --config vite.config.component.js",
"build:static-site:dev": "tsc && vite build --config vite.config.static-site.js --mode development",
"build:static-site:staging": "tsc && vite build --config vite.config.static-site.js --mode staging",
"build": "npm run build:static-site:staging",
"build:static-site:qa": "tsc && vite build --config vite.config.static-site.js --mode qa",
"preview:static-site:dev": "npm run build:static-site:dev && vite preview --base ./ --config vite.config.static-site.js",
"preview:static-site:staging": "npm run build:static-site:staging && vite preview --base ./ --config vite.config.static-site.js",
"preview:static-site:qa": "npm run build:static-site:qa && vite preview --base ./ --config vite.config.static-site.js",
"build": "if [[ \"$ENVIRONMENT\" == \"qa\" ]]; then npm run build:static-site:qa && echo \"qa\"; else npm run build:static-site:staging; fi",
"format": "prettier ./src --write",
"format:check": "prettier ./src --check",
"lint": "eslint ./src --ext js,jsx,ts,tsx --report-unused-disable-directives --max-warnings 0",
Expand Down

0 comments on commit 03a7199

Please sign in to comment.