62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: vue-admin
|
|
|
|
trigger:
|
|
branch: ci
|
|
|
|
steps:
|
|
|
|
# - name: build-docker-image
|
|
# image: plugins/docker
|
|
# settings:
|
|
# username:
|
|
# from_secret: docker_reg_username
|
|
# password:
|
|
# from_secret: docker_reg_password
|
|
# repo: docker.zcj.plus/drone-ci/fe
|
|
# tags: latest
|
|
# registry: https://docker.zcj.plus
|
|
|
|
# - name: login-docker
|
|
# image: appleboy/drone-ssh
|
|
# settings:
|
|
# envs:
|
|
# - docker_reg_username
|
|
# - docker_reg_password
|
|
# host:
|
|
# from_secret: ssh_host
|
|
# username:
|
|
# from_secret: ssh_username
|
|
# password:
|
|
# from_secret: ssh_password
|
|
# port:
|
|
# from_secret: ssh_port
|
|
# script:
|
|
# - docker login -u ${DOCKER_REG_USERNAME} -p ${DOCKER_REG_PASSWORD} https://docker.zcj.plus
|
|
# - docker pull docker.zcj.plus/drone-ci/fe
|
|
|
|
- name: deploy
|
|
image: docker/compose
|
|
privileged: true
|
|
environment:
|
|
DOCKER_REG_USERNAME:
|
|
from_secret: docker_reg_username
|
|
DOCKER_REG_PASSWORD:
|
|
from_secret: docker_reg_password
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run/docker.sock
|
|
commands:
|
|
- ls -l
|
|
- cat frpc.ini
|
|
- pwd
|
|
- docker login -u $DOCKER_REG_USERNAME -p $DOCKER_REG_PASSWORD https://docker.zcj.plus
|
|
- docker-compose up -d -f $(pwd)/docker-compose.yml
|
|
- docker-compose logs -f
|
|
|
|
|
|
volumes:
|
|
- name: dockersock
|
|
host:
|
|
path: /var/run/docker.sock |