This commit is contained in:
46
.drone.yml
46
.drone.yml
@ -1,8 +1,46 @@
|
|||||||
kind: pipeline # 定义一个管道
|
kind: pipeline # 定义一个管道
|
||||||
type: docker # 当前管道的类型
|
type: docker # 当前管道的类型
|
||||||
name: test # 当前管道的名称
|
name: build-test1 # 当前管道的名称
|
||||||
|
|
||||||
steps: # 定义管道的执行步骤
|
steps: # 定义管道的执行步骤
|
||||||
- name: test # 步骤名称
|
- name: build-project # 步骤名称
|
||||||
image: node:latest # 当前步骤使用的镜像
|
image: node:18-bullseye # 当前步骤使用的镜像
|
||||||
|
volumes:
|
||||||
|
- name: node_modules
|
||||||
|
path: /drone/src/node_modules
|
||||||
commands: # 当前步骤执行的命令
|
commands: # 当前步骤执行的命令
|
||||||
- echo 测试drone执行111222
|
- pwd
|
||||||
|
- npm config set registry https://registry.npm.taobao.org
|
||||||
|
- npm i
|
||||||
|
|
||||||
|
- name: build-image
|
||||||
|
image: plugins/docker
|
||||||
|
depends_on: [build-project]
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_passwd
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
registry: https://git.hiiragi.club:8081
|
||||||
|
repo: git.hiiragi.club:8081/mol/test
|
||||||
|
# steps:
|
||||||
|
# - name: deploy-project
|
||||||
|
# image: appleboy/drone-ssh
|
||||||
|
# settings:
|
||||||
|
# host: www.hiiragi.club
|
||||||
|
# username:
|
||||||
|
# from_secret: deploy_username # 使用secrets
|
||||||
|
# password:
|
||||||
|
# from_secret: deploy_password
|
||||||
|
# port: 22
|
||||||
|
# command_timeout: 2m
|
||||||
|
# script:
|
||||||
|
# - echo ==-----==开始部署==-----==
|
||||||
|
# - docker pull soulweapon/test1:latest
|
||||||
|
# - docker-compose -p test1 down
|
||||||
|
# # - docker volume rm xxx # 有挂载卷轴的记得卸载
|
||||||
|
# - docker-compose -f /home/ubuntu/compose-file/test1.yml -p test1 up -d
|
||||||
|
# # 过滤出dockerImages的id, 删除none镜像
|
||||||
|
# - docker rmi $(docker images | grep test1 | grep none | awk '{print $3}')
|
||||||
|
# - echo ==-----==部署成功==-----==
|
||||||
|
Reference in New Issue
Block a user