forest/.onedev-buildspec.yml

111 lines
3.2 KiB
YAML
Raw Normal View History

2022-09-24 23:22:14 +08:00
version: 18
jobs:
- name: maven ci
steps:
- !CheckoutStep
name: checkout
cloneCredential: !DefaultCredential {}
withLfs: false
withSubmodules: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: detect build version
runInContainer: true
image: '@script:builtin:maven:determine-docker-image@'
interpreter: !DefaultInterpreter
commands:
- echo "Detecting project version (may require some time while downloading maven
dependencies)..."
- echo $(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version
-q -DforceStdout) > buildVersion
useTTY: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetBuildVersionStep
name: set build version
buildVersion: '@file:buildVersion@'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: run unit tests
runInContainer: true
image: '@script:builtin:maven:determine-docker-image@'
interpreter: !DefaultInterpreter
commands:
2022-09-25 08:20:23 +08:00
- mvn clean test -P dev
2022-09-24 23:22:14 +08:00
useTTY: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers:
- !BranchUpdateTrigger {}
retryCondition: never
maxRetries: 3
retryDelay: 30
cpuRequirement: 250
memoryRequirement: 256
caches:
- key: maven-cache
path: /root/.m2/repository
timeout: 3600
2022-10-01 00:03:21 +08:00
- name: package
jobExecutor: internal
2022-09-30 14:51:13 +08:00
steps:
- !CheckoutStep
name: Checkout Code
cloneCredential: !DefaultCredential {}
withLfs: false
withSubmodules: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: delete build version
runInContainer: true
image: '@script:builtin:maven:determine-docker-image@'
interpreter: !DefaultInterpreter
commands:
- echo "Detecting project version (may require some time while downloading maven
dependencies)..."
- echo $(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version
-q -DforceStdout) > buildVersion
useTTY: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !SetBuildVersionStep
name: Set Build Version
buildVersion: '@file:buildVersion@'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: run maven package
runInContainer: true
image: '@script:builtin:maven:determine-docker-image@'
interpreter: !DefaultInterpreter
commands:
2022-09-30 23:05:51 +08:00
- mvn package
2022-09-30 14:51:13 +08:00
useTTY: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
2022-10-01 00:03:21 +08:00
- !PublishArtifactStep
name: Publish Artifacts
2022-10-01 00:25:29 +08:00
artifacts: '**'
2022-10-01 00:03:21 +08:00
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
retryCondition: never
maxRetries: 3
retryDelay: 30
cpuRequirement: 250
memoryRequirement: 256
caches:
- key: maven-cache
path: /root/.m2/repository
timeout: 3600
- name: Build Docker Image
steps:
2022-09-30 14:51:13 +08:00
- !BuildImageStep
name: Build Docker Image
2022-10-01 00:30:03 +08:00
tags: rymcu/forest:0.0.1
2022-09-30 14:51:13 +08:00
publish: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
2022-10-01 00:03:21 +08:00
jobDependencies:
- jobName: package
requireSuccessful: true
artifacts: forest*
2022-09-30 14:51:13 +08:00
retryCondition: never
maxRetries: 3
retryDelay: 30
cpuRequirement: 250
memoryRequirement: 256
timeout: 3600