2020-11-23 05:19:10 +08:00
|
|
|
# Template maven-build
|
|
|
|
|
|
|
|
# This template allows you to test and build your Java project with Maven.
|
|
|
|
# The workflow allows running tests, code checkstyle and security scans on the default branch.
|
|
|
|
|
|
|
|
# Prerequisites: pom.xml and appropriate project structure should exist in the repository.
|
|
|
|
|
|
|
|
image: maven:3.6.3
|
|
|
|
|
|
|
|
pipelines:
|
2022-01-24 07:54:57 +08:00
|
|
|
branches:
|
|
|
|
'{master,develop}':
|
|
|
|
- step:
|
|
|
|
name: Build and Test
|
|
|
|
caches:
|
|
|
|
- node
|
|
|
|
- maven
|
2022-01-24 08:28:16 +08:00
|
|
|
- docker
|
2022-01-24 07:54:57 +08:00
|
|
|
script:
|
|
|
|
# Compile sources ...
|
|
|
|
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
|
|
|
|
- . $HOME/.nvm/nvm.sh && nvm install node
|
|
|
|
- mvn -B verify --file pom.xml
|
2022-01-24 08:28:16 +08:00
|
|
|
# Publish to docker repo ...
|
|
|
|
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
|
2023-06-29 14:27:20 +08:00
|
|
|
- docker buildx create --use --platform=linux/arm64,linux/amd64 --name multi-platform-builder
|
|
|
|
- docker buildx inspect --bootstrap
|
|
|
|
- docker buildx build --platform=linux/amd64,linux/arm64 --push -t wisemapping/wisemapping:latest -f ./Dockerfile ../wise-webapp/target/
|
2022-01-24 07:54:57 +08:00
|
|
|
after-script:
|
|
|
|
# Collect checkstyle results, if any, and convert to Bitbucket Code Insights.
|
|
|
|
- pipe: atlassian/checkstyle-report:0.3.0
|
|
|
|
services:
|
|
|
|
- docker
|
2022-01-24 08:22:31 +08:00
|
|
|
- step:
|
|
|
|
name: Security Scan
|
|
|
|
script:
|
|
|
|
# Run a security scan for sensitive data.
|
|
|
|
# See more security tools at https://bitbucket.org/product/features/pipelines/integrations?&category=security
|
|
|
|
- pipe: atlassian/git-secrets-scan:0.5.1
|
2022-01-24 07:54:57 +08:00
|
|
|
|