64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
################################################################################
|
|
# web
|
|
################################################################################
|
|
kind: pipeline
|
|
type: docker
|
|
name: (admin Panel) build form and push to artifactory
|
|
|
|
steps:
|
|
- name: build node app
|
|
image: docker-mirror.ravanertebat.ir/base/node/node-cypress4:22.14
|
|
|
|
environment:
|
|
PNPM_CONFIG_REGISTRY: https://mirror.ravanertebat.ir/repository/npm-proxy/
|
|
#NPM_CONFIG_STRICT_SSL: false
|
|
#NPM_CONFIG_AUDIT: false
|
|
commands:
|
|
- |
|
|
set -e
|
|
case "$DRONE_BRANCH" in
|
|
pro) echo prod;;
|
|
uat) echo uat;;
|
|
test) 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"
|
|
|
|
- mkdir -p ./artifacts/node
|
|
- rm -rf .git
|
|
# - corepack enable
|
|
# - corepack prepare pnpm@10.18.0 --activate
|
|
# - pnpm config list
|
|
- rm -rf dist
|
|
- pnpm install --frozen-lockfile --reporter=append-only
|
|
- pnpm run test:e2e
|
|
- pnpm run build
|
|
- cp -R .next/standalone/. ./artifacts/node/
|
|
- mkdir -p ./artifacts/node/.next
|
|
- cp -R .next/static ./artifacts/node/.next/static
|
|
- cp -R ./public ./artifacts/node/public
|
|
- ls -ltrh ./artifacts/node
|
|
|
|
- name: build panel
|
|
image: plugins/docker
|
|
settings:
|
|
# build_args:
|
|
# - BUILD_APP=scraper
|
|
username: cicd
|
|
password:
|
|
from_secret: REGISTRY_PASSWORD
|
|
# dockerfile: Dockerfile-drone
|
|
repo: artifactory.ravanertebat.ir/tm/admin_panel
|
|
registry: artifactory.ravanertebat.ir
|
|
|
|
node:
|
|
tag: aecde-docker-runner
|
|
trigger:
|
|
branch:
|
|
- main
|
|
- develop
|
|
event:
|
|
- custom
|