forked from Yara724/api
ci(deployment): build the maintenance api on parspack
Compile NestJS on Parspack and deploy the commit-tagged image from the existing API directory.
This commit is contained in:
@@ -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:/root/.docker:ro
|
||||
commands:
|
||||
- export YARA_IMAGE="registry.ittalie.com/yara724-maintenance-api:$CI_COMMIT_SHA"
|
||||
- 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"
|
||||
Reference in New Issue
Block a user