demo/.woodpecker1/deploy.yaml

47 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 第 97 次部署
matrix:
include:
- NODE_NAME: "集群节点A"
DEPLOY_USER_SECRET: "136_ssh_user"
DEPLOY_PASS_SECRET: "136_ssh_password"
# - NODE_NAME: "集群节点B"
# DEPLOY_USER_SECRET: "B_user"
# DEPLOY_PASS_SECRET: "B_password"
steps:
- name: 远程终端集群部署
image: appleboy/drone-ssh:latest
environment:
NEXUS_DOCKER_USERNAME:
from_secret: NEXUS_DOCKER_USERNAME
NEXUS_DOCKER_PASSWORD:
from_secret: NEXUS_DOCKER_PASSWORD
settings:
host: 43.143.243.136
username:
from_secret: ${DEPLOY_USER_SECRET}
password:
from_secret: ${DEPLOY_PASS_SECRET}
port: 22
secrets: [ NEXUS_DOCKER_USERNAME, NEXUS_DOCKER_PASSWORD ]
envs:
- NEXUS_DOCKER_USERNAME
- NEXUS_DOCKER_PASSWORD
script:
- echo "========================================="
- echo "🚀 开始部署节点43.143.243.136"
- echo "========================================="
- echo "NEXUS_DOCKER_USERNAME:${NEXUS_DOCKER_USERNAME}"
- docker login --username "${NEXUS_DOCKER_USERNAME}" --password "${NEXUS_DOCKER_PASSWORD}" push.lovestory.cyou
- docker stop demo-container || true
- docker rm demo-container || true
- docker pull push.lovestory.cyou/abhors/demo:latest
- docker run -d --name demo-container -p 8080:8080 --restart always push.lovestory.cyou/abhors/demo:latest
when:
event: [push, pull_request, manual]
branch: master
depends_on:
- build