2021-06-02 10:00:25 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: vue-admin
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch: ci
|
|
|
|
|
|
|
|
steps:
|
2021-06-02 11:01:17 +00:00
|
|
|
|
2021-06-06 03:08:18 +00:00
|
|
|
# - 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
|
2021-06-05 14:26:15 +00:00
|
|
|
|
2021-06-06 03:12:54 +00:00
|
|
|
# - 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
|
2021-06-02 14:10:22 +00:00
|
|
|
|
2021-06-05 14:26:15 +00:00
|
|
|
- name: deploy
|
|
|
|
image: docker/compose
|
2021-06-06 03:36:33 +00:00
|
|
|
privileged: true
|
2021-06-06 03:17:35 +00:00
|
|
|
environment:
|
|
|
|
DOCKER_REG_USERNAME:
|
|
|
|
from_secret: docker_reg_username
|
|
|
|
DOCKER_REG_PASSWORD:
|
|
|
|
from_secret: docker_reg_password
|
2021-06-06 00:32:53 +00:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run/docker.sock
|
2021-06-05 14:26:15 +00:00
|
|
|
commands:
|
2021-06-06 03:33:21 +00:00
|
|
|
- ls -l
|
2021-06-06 03:47:58 +00:00
|
|
|
- cat frpc.ini
|
2021-06-06 03:48:48 +00:00
|
|
|
- pwd
|
2021-06-06 03:16:07 +00:00
|
|
|
- docker login -u $DOCKER_REG_USERNAME -p $DOCKER_REG_PASSWORD https://docker.zcj.plus
|
2021-06-06 04:13:22 +00:00
|
|
|
- docker-compose up -f $(pwd)/docker-compose.yml -d
|
2021-06-06 03:12:54 +00:00
|
|
|
- docker-compose logs -f
|
2021-06-06 00:32:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
host:
|
2021-06-06 00:49:59 +00:00
|
|
|
path: /var/run/docker.sock
|