Skip to content

Commit

Permalink
ci(env): dont use env for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
anteqkois committed May 20, 2024
1 parent d82cf44 commit 957fb68
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
20 changes: 10 additions & 10 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ WORKDIR /app/builder
# COPY .env.${ENVIRONMENT} ./.env
# COPY /app/builder/apps/web/.env.prod-build /app/builder/apps/web/.env
# RUN echo "NEXT_PUBLIC_API_HOST=${NEXT_PUBLIC_API_HOST}" >> /app/builder/apps/web/.env
RUN echo "NEXT_PUBLIC_API_HOST=https://api.linkerry.com" >> /app/builder/apps/web/.env
RUN echo "NEXT_TELEMETRY_DISABLED=true" >> /app/builder/apps/web/.env
RUN echo "TEST=true" >> /app/builder/apps/web/.env
RUN echo "NEXT_PUBLIC_API_HOST=https://api.linkerry.com" >> /app/builder/apps/web/.env.production
RUN echo "NEXT_TELEMETRY_DISABLED=true" >> /app/builder/apps/web/.env.production
RUN echo "TEST=true" >> /app/builder/apps/web/.env.production
RUN cat /app/builder/apps/web/.env
RUN ls -a /app/builder/apps/web
# RUN echo "NEXT_PUBLIC_API_HOST=https://api.linkerry.com" >> /app/builder/apps/web/.env
# RUN echo "NEXT_TELEMETRY_DISABLED=true" >> /app/builder/apps/web/.env
# RUN echo "TEST=true" >> /app/builder/apps/web/.env
# RUN echo "NEXT_PUBLIC_API_HOST=https://api.linkerry.com" >> /app/builder/apps/web/.env.production
# RUN echo "NEXT_TELEMETRY_DISABLED=true" >> /app/builder/apps/web/.env.production
# RUN echo "TEST=true" >> /app/builder/apps/web/.env.production
# RUN cat /app/builder/apps/web/.env
# RUN ls -a /app/builder/apps/web

RUN npx nx run web:build || echo "nx run web:build failed"
# RUN grep -rn --include="*.js" "process.env.NEXT_PUBLIC_API_HOST" /app/builder/apps/web/.next/standalone
# RUN grep -rn --include="*.js" "https://api.linkerry.com" /app/builder/apps/web/.next/standalone
RUN find /app/builder/apps/web/.next/standalone -name "*.js" -exec grep -n "process.env.NEXT_PUBLIC_API_HOST" {} + || true
RUN find /app/builder/apps/web/.next/standalone -name "*.js" -exec grep -n "https://api.linkerry.com" {} + || true
# RUN find /app/builder/apps/web/.next/standalone -name "*.js" -exec grep -n "process.env.NEXT_PUBLIC_API_HOST" {} + || true
# RUN find /app/builder/apps/web/.next/standalone -name "*.js" -exec grep -n "https://api.linkerry.com" {} + || true

FROM node:lts-alpine AS runner

Expand Down
3 changes: 2 additions & 1 deletion apps/web/libs/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { redirect } from 'next/navigation'
// import { store } from '../../features/common/store';
// import fingerprint from '../../utils/fingerprint'

export const API_URL = process.env.NEXT_PUBLIC_API_HOST
// export const API_URL = process.env.NEXT_PUBLIC_API_HOST
export const API_URL = 'https://api.linkerry.com'

const apiClient = axios.create({
withCredentials: true,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/libs/api-server-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { redirect } from 'next/navigation'
// import { store } from '../../features/common/store';
// import fingerprint from '../../utils/fingerprint'

export const API_URL = process.env.NEXT_PUBLIC_API_HOST
export const API_URL = 'https://api.linkerry.com'

const apiServerClient = axios.create({
withCredentials: true,
Expand Down
3 changes: 2 additions & 1 deletion apps/web/modules/editor/app-connections/OAuth2Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import dayjs from 'dayjs'
import { nanoid } from 'nanoid'
import { Dispatch, FormEvent, HTMLAttributes, SetStateAction, useCallback, useEffect, useState } from 'react'
import { useForm } from 'react-hook-form'
import { API_URL } from '../../../libs/api-client'
import { useClientQuery } from '../../../libs/react-query'
import { ErrorInfo } from '../../../shared/components/ErrorInfo'
import { MarkdownBase } from '../../../shared/components/Markdown/MarkdownBase'
Expand Down Expand Up @@ -56,7 +57,7 @@ export const OAuth2Auth = ({ onCreateAppConnection, auth, connector, setShowDial

setOAuth2Settings({
auth_url: auth.authUrl,
redirect_url: `${process.env.NEXT_PUBLIC_API_HOST}/api/v1/oauth2/redirect`,
redirect_url: `${API_URL}/api/v1/oauth2/redirect`,
scope: auth.scope.join(' '),
pkce: auth.pkce ?? false,
extraParams: auth.extra || {},
Expand Down

0 comments on commit 957fb68

Please sign in to comment.