2021-01-21 03:27:13 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
path: /did
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
|
|
|
image: maven
|
2021-01-21 04:00:51 +00:00
|
|
|
volumes:
|
|
|
|
- name: m2_cache # The Volume's name
|
|
|
|
path: /root/.m2 # The path in the container
|
2021-01-21 03:27:13 +00:00
|
|
|
commands:
|
|
|
|
- mvn clean install -DskipTests -e -U
|
|
|
|
- cp ./did-server/target/did-server*.jar ./docker
|
2021-01-21 03:46:51 +00:00
|
|
|
- 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-21 03:27:13 +00:00
|
|
|
|
|
|
|
- name: docker
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: docker.ehlxr.me/ehlxr/did-server
|
2021-01-21 04:00:51 +00:00
|
|
|
dockerfile: ./docker/Dockerfile
|
2021-01-21 03:27:13 +00:00
|
|
|
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:
|
2021-01-25 02:42:33 +00:00
|
|
|
# host: xxx.xxx.xxx.xxx
|
|
|
|
# username: xxx
|
2021-01-21 03:27:13 +00:00
|
|
|
# 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:
|
|
|
|
- failure
|
|
|
|
- success
|
2021-01-21 04:00:51 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: m2_cache # The name use in this pipeline,
|
|
|
|
host:
|
|
|
|
path: /m2_cache # The path be used in the host.
|