diff --git a/.drone.yml b/.drone.yml index 853dfb0..5578537 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,19 +1,60 @@ kind: pipeline -type: exec -name: deployment - -platform: - os: linux - arch: amd64 - +type: docker +name: master steps: - - name: backend image build - commands: - - echo start build images... - - export MAJOR_VERSION=1.0.rtm. - - export BUILD_NUMBER=$DRONE_BUILD_NUMBER - - export WORKSPACE=`pwd` - - bash ./build.sh - when: - branch: - - master + - name: restore-cache + image: meltwater/drone-cache + settings: + backend: filesystem + restore: true + cache_key: "maven" + archive_format: gzip + filesystem_cache_root: "/var/lib/cache" + mount: + - "maven" + volumes: + - name: cache + path: "/var/lib/cache" + # Do stuff.. + - name: build + image: maven:3.8-openjdk-8 + commands: + - mkdir /root/.m2 + - cp /usr/share/maven/ref/settings-docker.xml /root/.m2/settings.xml + - sed -i 's/\\/usr\\/share\\/maven\\/ref\\/repository/\\/drone\\/src\\/maven/g' /root/.m2/settings.xml + - mvn package + - name: rebuild-cache + image: meltwater/drone-cache + settings: + backend: filesystem + rebuild: true + cache_key: "maven" + archive_format: gzip + filesystem_cache_root: "/var/lib/cache" + mount: + - "maven" + volumes: + - name: cache + path: "/var/lib/cache" + - name: docker + image: plugins/docker + settings: + dockerfile: "Dockerfile.drone" + repo: harbor.oa00.com/sws/project0512 + registry: harbor.oa00.com + username: + from_secret: docker_username + password: + from_secret: docker_password + tags: + - master +volumes: + - name: cache + host: + path: "/var/lib/cache" +trigger: + branch: + - master + event: + - push + - merge