1 Star 0 Fork 41

wison/clever-nashorn

forked from lizw-2015/clever-nashorn 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.drone.yml 3.71 KB
一键复制 编辑 原始数据 按行查看 历史
lizw 提交于 2019-12-03 14:01 . 环境迁移
# 跳过构建在Commit Message中添加 [CI SKIP]
# 172.18.1.1 必须是物理机网卡(可以是虚拟网卡)
kind: pipeline
name: 打包部署[Java-Maven]
clone:
disable: true
steps:
- name: 下载源代码[Git]
image: docker:git
commands:
- echo "### $DRONE_GIT_HTTP_URL -> $DRONE_BRANCH"
- git clone http://172.18.1.1:13000/lizw/clever-nashorn.git ./
# - git clone $DRONE_GIT_HTTP_URL ./
- git checkout $DRONE_BRANCH
- name: 编译源代码[Maven]
image: maven:3.6.0-jdk-8-alpine
volumes:
- name: package-java
path: /package-java
commands:
- mvn package -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -B -V -Pprod --settings /package-java/Maven/settings.xml
# - mvn deploy -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -B -V -Pdev --settings /package-java/Maven/settings.xml
# - cp -f clever-nashorn-server/target/clever-nashorn-server-*-SNAPSHOT.jar /package-java
- name: 构建镜像[Docker]
image: plugins/docker
volumes:
- name: docker-daemon
path: /etc/docker
settings:
registry: '172.18.1.1:15000'
repo: '172.18.1.1:15000/java-service/clever-nashorn-server'
username:
from_secret: harborUsername
password:
from_secret: harborPassword
# insecure: true
dockerfile: ./Dockerfile
target: prod
tags: ['0.0.1-SNAPSHOT']
force_tag: true
auto_tag: false
auto_tag_suffix: ''
- name: 启动Docker容器[SSH]
image: appleboy/drone-ssh
settings:
host: 172.18.1.1
port: 22
username:
from_secret: sshUsername
password:
from_secret: sshPassword
# secrets: [ ssh_username, ssh_password ]
command_timeout: 300s
script:
#- export PATH=$PATH:/Applications/Docker.app/Contents/Resources/bin
#- echo $PATH
- echo "------------------< 停止容器 >------------------"
- docker stop clever-nashorn-server
- echo "------------------< 删除容器 >------------------"
- docker rm -v clever-nashorn-server
- echo "------------------< 删除旧镜像 >------------------"
- docker rmi 172.18.1.1:15000/java-service/clever-nashorn-server:0.0.1-SNAPSHOT
- echo "------------------< 拉取新镜像 >------------------"
- docker pull 172.18.1.1:15000/java-service/clever-nashorn-server:0.0.1-SNAPSHOT
- echo "------------------< 运行新镜像 >------------------"
- docker run --name clever-nashorn-server -p 18081:9066 -v /home/lizw/Desktop/docker-opt/logs/java-service:/logs -d 172.18.1.1:15000/java-service/clever-nashorn-server:0.0.1-SNAPSHOT
- exit
- name: 发送通知[Email]
image: drillster/drone-email
# detach: true
commands:
- date
- cd /etc
- cp /share/localtime ./
- date
- cd /bin
- ./drone-email
volumes:
- name: share
path: /share
settings:
host: smtp.qq.com
port: 465
username:
from_secret: emailUsername
password:
from_secret: emailPassword
skip_verify: false
from:
from_secret: emailUsername
recipients: [ 'lzw1000000@163.com' ]
recipients_only: false
subject: '[#{{build.number}}-{{build.status}}] {{repo.name}}'
body: 'file:///drone/src/drone-email.html'
volumes:
# 共享文件
- name: share
host:
path: /home/lizw/Desktop/docker-opt/share
# Java打包目录
- name: package-java
host:
path: /home/lizw/Desktop/docker-opt/package/java
# docker-daemon 配置
- name: docker-daemon
host:
path: /etc/docker
# -------------------------------------------------------------------------------------------------------------
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/wurong19870715/clever-nashorn.git
git@gitee.com:wurong19870715/clever-nashorn.git
wurong19870715
clever-nashorn
clever-nashorn
master

搜索帮助