You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.6 KiB
72 lines
1.6 KiB
kind: pipeline
|
|
type: docker
|
|
name: build-and-deploy
|
|
|
|
steps:
|
|
- name: deploy
|
|
image: appleboy/drone-scp
|
|
settings:
|
|
host: 192.168.0.129
|
|
username:
|
|
from_secret: username_deploy
|
|
password:
|
|
from_secret: password_deploy
|
|
port: 22
|
|
target: /root/docker/trash-api/
|
|
source: .
|
|
|
|
- name: build-docker-image
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host: 192.168.0.129
|
|
username:
|
|
from_secret: username_deploy
|
|
password:
|
|
from_secret: password_deploy
|
|
port: 22
|
|
script:
|
|
- cd /root/docker/trash-api
|
|
- docker build -f Dockerfile-api -t trash-api .
|
|
|
|
- name: build-docker-image
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host: 192.168.0.129
|
|
username:
|
|
from_secret: username_deploy
|
|
password:
|
|
from_secret: password_deploy
|
|
port: 22
|
|
script:
|
|
- docker stop trash-api || true
|
|
- docker rm trash-api || true
|
|
- docker run -d -p 1778:1778 --name trash-api trash-api
|
|
|
|
- name: telegram notification
|
|
image: appleboy/drone-telegram
|
|
settings:
|
|
token:
|
|
from_secret: telegram_token
|
|
to:
|
|
from_secret: telegram_to
|
|
format: markdown
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
message: >
|
|
{{#success build.status}}
|
|
✅ Build #{{build.number}} of `{{repo.name}}` succeeded.
|
|
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
|
|
```
|
|
{{commit.message}}
|
|
```
|
|
🌐 {{ build.link }}
|
|
{{else}}
|
|
❌ Build #{{build.number}} of `{{repo.name}}` failed.
|
|
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
|
|
```
|
|
{{commit.message}}
|
|
```
|
|
🌐 {{ build.link }}
|
|
{{/success}} |