chore: Update pipeline configuration for Docker image build and deployment
Some checks reported errors
continuous-integration/drone Build was killed
Some checks reported errors
continuous-integration/drone Build was killed
This commit is contained in:
parent
ef7472011d
commit
d7f482e95a
73
.drone.yml
Normal file
73
.drone.yml
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build-and-push
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: git.tunpok.com/ching/calendar-widget-api
|
||||||
|
registry: git.tunpok.com
|
||||||
|
tags: latest
|
||||||
|
|
||||||
|
# - name: notify
|
||||||
|
# image: plugins/webhook
|
||||||
|
# settings:
|
||||||
|
# urls: http://bark.tunpok.com/UZ6zC82bKRjQaXiVkosVWh/
|
||||||
|
# content_type: application/json
|
||||||
|
# template: |
|
||||||
|
# {
|
||||||
|
# "title": "{{#success build.status}}🟢{{else}}🔴{{/success}} Drone Build #{{ build.number }} {{ build.status }} {{#success build.status}}🟢{{else}}🔴{{/success}}",
|
||||||
|
# "body": "Project: {{ repo.name }}\nBranch: {{ build.branch }}\nCommit: {{ truncate build.commit 8 }}",
|
||||||
|
# "group": "drone",
|
||||||
|
# "url": "{{ build.link }}",
|
||||||
|
# "icon": "https://static-00.iconduck.com/assets.00/drone-icon-2048x2048-6zua2vkz.png"
|
||||||
|
# }
|
||||||
|
# when:
|
||||||
|
# status: [success, failure]
|
||||||
|
# https://discord.com/api/webhooks/1213409068559900683/szl0AICZwA1V82dg8Vrc_xqOCl1WwnxktlQdf4cdILswR-xZBI5-JOdqGSD8dVUNcUlH
|
||||||
|
- name: deploy
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host:
|
||||||
|
- 206.237.26.184
|
||||||
|
username: ching
|
||||||
|
key:
|
||||||
|
from_secret: ssh_key
|
||||||
|
passphrase:
|
||||||
|
from_secret: ssh_passphrase
|
||||||
|
port: 33740
|
||||||
|
command_timeout: 2m
|
||||||
|
script:
|
||||||
|
- echo "Pull new image"
|
||||||
|
- docker pull git.tunpok.com/ching/calendar-widget-api:latest
|
||||||
|
- echo "Go to the project directory"
|
||||||
|
- cd /home/ching/dev/calendar-widget
|
||||||
|
- echo "Restart the container"
|
||||||
|
- docker compose down && docker compose up -d
|
||||||
|
|
||||||
|
- name: discord notification
|
||||||
|
image: appleboy/drone-discord
|
||||||
|
settings:
|
||||||
|
webhook_id:
|
||||||
|
from_secret: discord_webhook_id
|
||||||
|
webhook_token:
|
||||||
|
from_secret: discord_webhook_token
|
||||||
|
# message: |
|
||||||
|
# Drone Build #${DRONE_BUILD_NUMBER} ${DRONE_BUILD_STATUS}
|
||||||
|
# Project: ${DRONE_REPO_NAME}
|
||||||
|
# Branch: ${DRONE_BRANCH}
|
||||||
|
# Commit: ${DRONE_COMMIT_SHA:0:8}
|
||||||
|
# [Build Log](${DRONE_BUILD_LINK})
|
||||||
|
when:
|
||||||
|
status: [success, failure]
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
host:
|
||||||
|
path: /var/run/docker.sock
|
||||||
Loading…
x
Reference in New Issue
Block a user