From ae2c3cc510c057123e7002245d088d293730045b Mon Sep 17 00:00:00 2001 From: Jooeun Date: Wed, 13 Sep 2023 14:23:35 +0900 Subject: [PATCH] add build args --- .circleci/config.yml | 9 +++++++++ Dockerfile | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ebd48ae0..200db3f1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,6 +39,9 @@ jobs: description: AWS region of ECR repository to push container image type: enum enum: ['us-east-1', 'us-west-2'] + extra_build_args: + description: extra build args to pass to docker build + type: string steps: - checkout - attach_workspace: @@ -55,6 +58,7 @@ jobs: repo: << parameters.repo >> role-arn: arn:aws:iam::314716043882:role/ci-ops tag: '$CIRCLE_TAG-<< parameters.architecture >>' + extra-build-args: << parameters.extra_build_args >> push_arch_integrated_manifest: executor: arm64 parameters: @@ -116,6 +120,11 @@ workflows: build_path: '.' aws_region: us-west-2 repo: aiwidget/app + extra_build_args: | + --build-arg VITE_CHAT_WIDGET_APP_ID=AE8F7EEA-4555-4F86-AD8B-5E0BD86BFE67 + --build-arg VITE_CHAT_WIDGET_BOT_ID=khan-academy-bot + --build-arg VITE_WEB_DEMO_APP_ID=6E1B01A5-517F-4F68-A74A-8427F3DE904C + --build-arg VITE_WIDGET_DEMO_APP_ID=58F00FA8-C48E-461D-975E-18D33C8778AB context: - circleci-dashboard-bot - push_arch_integrated_manifest: diff --git a/Dockerfile b/Dockerfile index 1fe6b000b..7cca8239c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,14 @@ FROM node:18.17.1-alpine AS builder WORKDIR /app COPY ./packages/url-webdemo ./ +ARG VITE_CHAT_WIDGET_APP_ID VITE_CHAT_WIDGET_BOT_ID \ + VITE_WEB_DEMO_APP_ID VITE_WIDGET_DEMO_APP_ID + +ENV VITE_CHAT_WIDGET_APP_ID=$VITE_CHAT_WIDGET_APP_ID +ENV VITE_CHAT_WIDGET_BOT_ID=$VITE_CHAT_WIDGET_BOT_ID +ENV VITE_WEB_DEMO_APP_ID=$VITE_WEB_DEMO_APP_ID +ENV VITE_WIDGET_DEMO_APP_ID=$VITE_WIDGET_DEMO_APP_ID + RUN npm install RUN npm run build