did/.drone2.yml

51 lines
1.4 KiB
YAML
Raw Normal View History

2021-01-25 02:42:33 +00:00
kind: pipeline
type: docker
name: default
workspace:
path: /did
steps:
- name: build
image: maven
commands:
2021-02-07 14:11:59 +00:00
- mvn clean install -DskipTests -e -U
- cp ./did-server/target/did-server*.jar ./docker
- echo -n "$(date -d @${DRONE_BUILD_CREATED} '+%Y%m%d_%H%M%S')_${DRONE_BUILD_NUMBER}, $(grep '<version>.*</version>' pom.xml | head -1 | awk -F '[>,<]' '{print $3}'), latest" > .tags
2021-01-25 02:42:33 +00:00
- name: docker
image: plugins/docker
settings:
repo: docker.ehlxr.me/ehlxr/did-server
dockerfile: ./docker/Dockerfile
registry: docker.ehlxr.me
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- SERVER_NAME=did-server
# - name: deploy
# image: appleboy/drone-ssh
# settings:
# host: xxx.xxxx.xx.xxx
# username: xxxx
# password:
# from_secret: ssh_password
# port: 22
# script:
# - docker swarm init
# - docker service create --replicas 2 -p 4000:4000 --name blog ehlxr/blog:$(date -d @${DRONE_BUILD_CREATED} "+%Y%m%d_%H%M%S")_${DRONE_BUILD_NUMBER}
# - docker service update --image ehlxr/blog:$(date -d @${DRONE_BUILD_CREATED} "+%Y%m%d_%H%M%S")_${DRONE_BUILD_NUMBER} blog
- name: notification
image: lddsb/drone-dingtalk-message
settings:
token:
from_secret: dingtalk_token
type: markdown
when:
status:
2021-02-07 14:11:59 +00:00
- failure
- success