Skip to content

Commit

Permalink
feat:providers add template provider
Browse files Browse the repository at this point in the history
Signed-off-by: jingyang <[email protected]>
  • Loading branch information
zjy365 committed Aug 10, 2023
1 parent 7bbf122 commit 25fb430
Show file tree
Hide file tree
Showing 124 changed files with 6,714 additions and 9,001 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
matrix:
module:
[
providers/template,
providers/adminer,
providers/applaunchpad,
providers/bytebase,
Expand Down Expand Up @@ -127,6 +128,7 @@ jobs:
matrix:
module:
[
providers/template,
providers/adminer,
providers/applaunchpad,
providers/bytebase,
Expand Down
17 changes: 10 additions & 7 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ARG name
# ARG path

FROM node:current-alpine AS runner
ARG name
ARG path
WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1
Expand All @@ -26,6 +28,10 @@ RUN sed -i 's/https/http/' /etc/apk/repositories
RUN apk add curl \
&& apk add ca-certificates \
&& update-ca-certificates
# Install Git and OpenSSH client if $name is equal to template
RUN if [ "$name" = "template" ]; then \
apk add --no-cache git openssh-client; \
fi
USER nextjs

EXPOSE 3000
Expand All @@ -52,8 +58,6 @@ COPY ./packages ./packages
RUN pnpm -r --offline --filter=./packages/* install \
&& pnpm -r --filter=./packages/* run build



# Rebuild the source code only when needed
FROM node:current-alpine AS builder

Expand All @@ -78,15 +82,14 @@ COPY . .
ARG name
ARG path

RUN \
[ -f $path/pnpm-lock.yaml ] && (pnpm --offline --filter=$name install && pnpm --filter=$name run build) || \
(echo "Lockfile not found." && exit 1)
RUN pnpm --offline --filter=$name install && pnpm --filter=$name run build

# Production image, copy all the files and run next
FROM runner

ARG name
ARG path

# You only need to copy next.config.js if you are NOT using the default configuration
# COPY --from=builder /app/desktop/next.config.js ./
COPY --from=builder /app/$path/public ./$path/public
Expand Down
3 changes: 2 additions & 1 deletion frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ buildTargets := \
providers/costcenter \
providers/dbprovider \
providers/applaunchpad \
providers/imagehub
providers/imagehub \
providers/template

buildTargets-all := $(addprefix image-build-,$(buildTargets))
pushTargets-all := $(addprefix image-push-,$(buildTargets))
Expand Down
13 changes: 7 additions & 6 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"scripts": {
"format": "prettier --config .prettierrc.js --write **/src/**/*.ts **/src/**/*.tsx **/src/**/*.scss **/tsconfig.*json **/*config.js **/*config.json",
"preinstall": "npx only-allow pnpm",
"dev-desktop": " pnpm -r --filter ./desktop run dev",
"dev-app": " pnpm -r --filter ./providers/applaunchpad run dev",
"dev-db": " pnpm -r --filter ./providers/dbprovider run dev",
"dev-cost": " pnpm -r --filter ./providers/costcenter run dev",
"dev-terminal": " pnpm -r --filter ./providers/terminal run dev"
"dev-desktop": "pnpm -r --filter ./desktop run dev",
"dev-app": "pnpm -r --filter ./providers/applaunchpad run dev",
"dev-db": "pnpm -r --filter ./providers/dbprovider run dev",
"dev-cost": "pnpm -r --filter ./providers/costcenter run dev",
"dev-terminal": "pnpm -r --filter ./providers/terminal run dev",
"dev-template": "pnpm -r --filter ./providers/template run dev"
},
"workspaces": [
"./packages/*",
Expand All @@ -23,4 +24,4 @@
"dependencies": {
"typescript": "^5.1.6"
}
}
}
Loading

0 comments on commit 25fb430

Please sign in to comment.