Compare commits

..
2 Commits
Author SHA1 Message Date
s.alikhani d2676d65d1 fix(ci): allow buildx writes and publish latest
Mount only the registry login file so Buildx can write temporary state. Build and deploy the latest image tag.
2026-11-22 15:02:19 +03:30
s.alikhani 6e56d0fa2e ci(deployment): build the maintenance api on parspack
Compile NestJS on Parspack and deploy the commit-tagged image from the existing API directory.
2026-11-22 14:43:23 +03:30
5 changed files with 54 additions and 8 deletions
+32
View File
@@ -0,0 +1,32 @@
when:
- event: push
branch: main
- event: manual
branch: main
labels:
hostname: build-parspack
steps:
build:
image: docker.arvancloud.ir/docker:24-cli
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/opsadmin/.docker/config.json:/root/.docker/config.json:ro
commands:
- export YARA_IMAGE="registry.ittalie.com/yara724-maintenance-api:latest"
- docker build -t "$YARA_IMAGE" .
- docker push "$YARA_IMAGE"
notify-failure:
image: docker.arvancloud.ir/alpine:3.20
environment:
ROCKETCHAT_WEBHOOK:
from_secret: rocketchat_webhook
when:
- status: failure
commands:
- apk add --no-cache curl jq > /dev/null
- |
jq -n --arg text "Yara724 api build failed. $CI_PIPELINE_URL" '{text: $text}' |
curl -fsS -H 'Content-Type: application/json' --data-binary @- "$ROCKETCHAT_WEBHOOK"
+12 -6
View File
@@ -1,11 +1,11 @@
# yara724/api — development deployment (Deploy-Develop)
# Manual tasks: see ci-cd/TASK.md
# Requires: repo marked Trusted in Woodpecker (host volume mounts)
when:
- event: push
branch: main
- event: manual
branch: main
depends_on:
- build
labels:
hostname: build-node-01
@@ -40,7 +40,10 @@ steps:
- git config --global --add safe.directory /workspace
- mkdir -p /tmp && ssh-keyscan -H git.ittalie.com >> /tmp/known_hosts
- cd /workspace
- git pull origin main
- git fetch origin main
- test "$(git rev-parse FETCH_HEAD)" = "$CI_COMMIT_SHA"
- git merge --ff-only FETCH_HEAD
- test "$(git rev-parse HEAD)" = "$CI_COMMIT_SHA"
- date +%s > /workspace/.wp-deploy-start
deploy:
@@ -49,10 +52,13 @@ steps:
<<: *pipeline_env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/talieh/.docker:/root/.docker:ro
- *workspace_volume
commands:
- cd /workspace
- docker compose -f docker-compose.yml up -d --build
- export YARA_IMAGE="registry.ittalie.com/yara724-maintenance-api:latest"
- docker compose -f docker-compose.yml pull
- docker compose -f docker-compose.yml up -d --no-build
notify-success:
image: docker.arvancloud.ir/alpine:3.20
+3 -1
View File
@@ -17,8 +17,10 @@ RUN npm i --force --verbose --no-scripts
COPY . .
RUN npm run build && test -f dist/src/main.js
# Expose the port on which your NestJS application will run
EXPOSE 3002
# Start the NestJS application
CMD ["npm", "start"]
CMD ["node", "dist/src/main.js"]
+6
View File
@@ -0,0 +1,6 @@
.git
node_modules
dist
.env
.env.*
*.env
+1 -1
View File
@@ -6,7 +6,7 @@ services:
context: .
dockerfile: Dockerfile
container_name: yara724-main-api-dev
image: yara724-main-api:dev
image: ${YARA_IMAGE:-yara724-main-api:dev}
restart: unless-stopped
volumes:
- yara724-main-api-dev-files:/app/files/:rw