kind: pipeline type: docker name: gitlab-notify steps: - name: create jar image: maven:3.8.6-eclipse-temurin-17 when: branch: - develop ref: - refs/tags/v.*.*.* volumes: - name: m2 path: /root/.m2/repository commands: - mvn -U clean package - name: docker publish develop image: upagge/docker-buildx:latest environment: DOCKER_REGISTRY_TOKEN: from_secret: DOCKER_REGISTRY_TOKEN DOCKER_IMAGE_NAME: from_secret: DOCKER_IMAGE_NAME DOCKER_REGISTRY_USER: from_secret: DOCKER_REGISTRY_USER when: branch: - develop volumes: - name: dockersock path: /var/run commands: - echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin - docker buildx create --use - docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:develop" . - name: docker publish release image: upagge/docker-buildx:latest environment: DOCKER_REGISTRY_TOKEN: from_secret: DOCKER_REGISTRY_TOKEN DOCKER_IMAGE_NAME: from_secret: DOCKER_IMAGE_NAME DOCKER_REGISTRY_USER: from_secret: DOCKER_REGISTRY_USER when: ref: - refs/tags/v.*.*.* volumes: - name: dockersock path: /var/run commands: - echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username $DOCKER_REGISTRY_USER --password-stdin - docker buildx create --use - docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$DOCKER_IMAGE_NAME:latest" -t "$DOCKER_IMAGE_NAME:$DRONE_TAG" . trigger: branch: - develop ref: - refs/tags/v.*.*.* services: - name: docker image: docker:20.10.22-dind-alpine3.17 privileged: true volumes: - name: dockersock path: /var/run volumes: - name: m2 host: path: /drone/volume/m2 - name: dockersock temp: {}