Refactor pipeline script
This commit is contained in:
parent
2af2d81115
commit
5fabaa88e8
1 changed files with 98 additions and 101 deletions
|
|
@ -1,17 +1,14 @@
|
|||
---
|
||||
# kind: pipeline
|
||||
# type: docker
|
||||
# name: default
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
build:
|
||||
image: node:22
|
||||
commands:
|
||||
- npm ci
|
||||
- npm run build
|
||||
- echo "VERSION=$(cat version.txt)" > .env
|
||||
|
||||
- name: clear-from-host
|
||||
clear-from-host:
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -27,7 +24,7 @@ steps:
|
|||
- find . -maxdepth 1 -type f -delete
|
||||
- echo "Target directory cleared, resumes folder preserved"
|
||||
|
||||
- name: copy-to-host
|
||||
copy-to-host:
|
||||
image: appleboy/drone-scp
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -43,7 +40,7 @@ steps:
|
|||
- nginx.conf
|
||||
- version.txt
|
||||
|
||||
- name: deploy
|
||||
deploy:
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -73,7 +70,7 @@ steps:
|
|||
- docker tag nginx:alpine frontend:$VERSION
|
||||
- echo "Deployment completed"
|
||||
|
||||
- name: confirm-deployment
|
||||
confirm-deployment:
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -103,7 +100,7 @@ steps:
|
|||
- curl -I http://localhost:5173 || { echo "HTTP request failed"; exit 1; }
|
||||
- echo "Deployment confirmed successfully"
|
||||
|
||||
- name: cleanup
|
||||
cleanup:
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue