From 8a755b8e826db77d32baa09e942f2fb2e848a11e Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 30 Sep 2022 06:51:13 +0000 Subject: [PATCH 1/2] Edit .onedev-buildspec.yml --- .onedev-buildspec.yml | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index 138289e..e39df2c 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -44,3 +44,49 @@ jobs: - key: maven-cache path: /root/.m2/repository timeout: 3600 +- name: Build Docker Image + 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: + - ll + - mvn package -P dev + - ll + useTTY: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: Build Docker Image + tags: rymcu/@project_name@:@build_version@ + publish: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + retryCondition: never + maxRetries: 3 + retryDelay: 30 + cpuRequirement: 250 + memoryRequirement: 256 + timeout: 3600 From f7ef0d846b1c7b82db22525bb74aaa86838fbf78 Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 30 Sep 2022 07:15:15 +0000 Subject: [PATCH 2/2] Edit .onedev-buildspec.yml --- .onedev-buildspec.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index e39df2c..438a56f 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -74,9 +74,7 @@ jobs: image: '@script:builtin:maven:determine-docker-image@' interpreter: !DefaultInterpreter commands: - - ll - mvn package -P dev - - ll useTTY: false condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - !BuildImageStep