update
This commit is contained in:
+28
-9
@@ -6,18 +6,37 @@ type: docker
|
|||||||
name: (admin Panel) build form and push to artifactory
|
name: (admin Panel) build form and push to artifactory
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: tag
|
- name: build node app
|
||||||
image: alpine/git:2.40.1
|
image: docker-mirror.ravanertebat.ir/hub/node:14
|
||||||
environment:
|
environment:
|
||||||
GOOS: linux
|
NPM_CONFIG_REGISTRY: https://mirror.ravanertebat.ir/repository/npm-proxy/
|
||||||
GOARCH: amd64
|
#NPM_CONFIG_STRICT_SSL: false
|
||||||
CGO_ENABLED: 0
|
#NPM_CONFIG_AUDIT: false
|
||||||
settings:
|
|
||||||
debug: true
|
|
||||||
commands:
|
commands:
|
||||||
- APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
|
- |
|
||||||
|
set -e
|
||||||
|
case "$DRONE_BRANCH" in
|
||||||
|
xvision) echo prod;;
|
||||||
|
uat_xvision) echo uat;;
|
||||||
|
test_xvision) echo test;;
|
||||||
|
*) echo dev;;
|
||||||
|
esac > .environment
|
||||||
|
- echo "Branch ${DRONE_BRANCH}, Environment $(cat .environment)"
|
||||||
|
- APP_VERSION=$(cat .environment)-${DRONE_BUILD_NUMBER}
|
||||||
- echo "APP Version tags $APP_VERSION"
|
- echo "APP Version tags $APP_VERSION"
|
||||||
- echo -n "$APP_VERSION" >> .tags
|
|
||||||
|
- mkdir -p ./artifacts/node
|
||||||
|
- rm -rf .git
|
||||||
|
- npx npm config list
|
||||||
|
- npx npm install --loglevel=verbose
|
||||||
|
- rm -rf dist
|
||||||
|
- npm ci
|
||||||
|
- npm run test:e2e
|
||||||
|
- npm run build
|
||||||
|
- cp .next/standalone ./artifacts/node/standalone
|
||||||
|
- cp .next/static ./artifacts/node/static
|
||||||
|
- cp ./public ./artifacts/node/public
|
||||||
|
- ls -ltrh ./artifacts/node
|
||||||
|
|
||||||
- name: build panel
|
- name: build panel
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
|
|||||||
+1
-14
@@ -1,15 +1,4 @@
|
|||||||
FROM node:22.19.0-alpine AS builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
#---
|
|
||||||
|
|
||||||
FROM node:22.19.0-alpine AS runner
|
FROM node:22.19.0-alpine AS runner
|
||||||
|
|
||||||
@@ -17,9 +6,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
COPY --from=builder /app/.next/standalone ./
|
COPY ./artifacts/node/ ./
|
||||||
COPY --from=builder /app/.next/static ./.next/static
|
|
||||||
COPY --from=builder /app/public ./public
|
|
||||||
|
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
Reference in New Issue
Block a user