Update .drone.yml
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-06-15 09:58:01 +00:00
parent 82b6e1b3d3
commit 0af234b70b
+54 -26
View File
@@ -1,36 +1,64 @@
################################################################################
# web
################################################################################
kind: pipeline kind: pipeline
type: docker type: docker
name: (admin Panel) build form and push to artifactory name: build-and-push-panel
steps: steps:
- name: build node app - name: build node app
image: docker-mirror.ravanertebat.ir/base/node/node-cypress4:22.14 image: cypress/included:14.5.4
environment:
PNPM_CONFIG_REGISTRY: https://mirror.ravanertebat.ir/repository/npm-proxy/
#NPM_CONFIG_STRICT_SSL: false
#NPM_CONFIG_AUDIT: false
commands: commands:
- | - |
set -e set -e
case "$DRONE_BRANCH" in SHORT_SHA=$(echo "$DRONE_COMMIT_SHA" | cut -c1-8)
pro) echo prod;; IMG_TAG="${DRONE_BUILD_NUMBER}-${DRONE_BRANCH}"
uat) echo uat;; echo -n "$IMG_TAG,$SHORT_SHA" > .tags
test) echo test;; echo "Image tags -> $IMG_TAG , $SHORT_SHA"
*) echo dev;; - corepack enable
esac > .environment - corepack prepare pnpm@10.18.0 --activate
- echo "Branch ${DRONE_BRANCH}, Environment $(cat .environment)"
- APP_VERSION=$(cat .environment)-${DRONE_BUILD_NUMBER}
- echo "APP Version tags $APP_VERSION"
- mkdir -p ./artifacts/node - mkdir -p ./artifacts/node
- rm -rf .git - rm -rf .git dist
# - corepack enable
# - corepack prepare pnpm@10.18.0 --activate
# - pnpm config list
- rm -rf dist
- pnpm install --frozen-lockfile --reporter=append-only - pnpm install --frozen-lockfile --reporter=append-only
- pnpm run test:e2e - pnpm run build
- cp -R .next/standalone/. ./artifacts/node/
- ls -ltrha ./artifacts/node
- name: push panel
image: plugins/docker
settings:
registry: git.opplens.se
repo: git.opplens.se/mazyar/tm-panel
username:
from_secret: registry_username
password:
from_secret: registry_password
- name: deploy-uat
image: appleboy/drone-ssh
settings:
host: 10.0.0.3
username: mazyar
port: 22
key:
from_secret: ssh_deploy_key
envs:
- DRONE_BUILD_NUMBER
- DRONE_BRANCH
script:
- set -e
- cd /data/tm-uat
- NEW_TAG="${DRONE_BUILD_NUMBER}-${DRONE_BRANCH}"
- echo "Deploying panel tag $NEW_TAG"
- sed -i "s/^PANEL_IMG_TAG=.*/PANEL_IMG_TAG=$NEW_TAG/" .env
- docker compose pull panel
- docker compose up -d panel
- docker image prune -f
when:
branch:
- dev
trigger:
branch:
- main
- uat
- dev
event:
- push