From 98832f88c025b446f704d06a222f2f1677ec8daf Mon Sep 17 00:00:00 2001 From: ketikai Date: Sat, 23 Nov 2024 07:14:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?ci(assemble):=20=E4=BC=98=E5=8C=96=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=9D=A1=E4=BB=B6=EF=BC=8C=E9=9D=9E=E4=B8=BB=E5=88=86?= =?UTF-8?q?=E6=94=AF=E4=B8=8D=E8=BF=90=E8=A1=8C=E6=9E=84=E5=BB=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] Signed-off-by: ketikai --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab7c7d6..15ca69a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,6 +24,8 @@ check: assemble: stage: build + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH script: ./gradlew --no-daemon --build-cache assemble cache: key: "$CI_COMMIT_REF_NAME" -- GitLab From b41452b97eec4585c2dcfc689c7d625de3767311 Mon Sep 17 00:00:00 2001 From: ketikai Date: Sat, 23 Nov 2024 07:36:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?ci(test):=20=E6=B7=BB=E5=8A=A0=20SAST=20?= =?UTF-8?q?=E9=9D=99=E6=80=81=E6=89=AB=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ketikai --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15ca69a..cdf0803 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,10 @@ stages: - build - deploy +# noinspection ComposeMissingKeys +include: + - template: "Security/SAST.gitlab-ci.yml" + check: stage: test script: ./gradlew --no-daemon check -- GitLab From 89a84219dde908fddf743589b9f62afebaed09fc Mon Sep 17 00:00:00 2001 From: ketikai Date: Sat, 23 Nov 2024 07:44:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?ci(check&assemble):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=85=A8=E5=B1=80=20before=5Fscript=20=E5=AF=BC=E8=87=B4=20SAS?= =?UTF-8?q?T=20=E7=8E=AF=E5=A2=83=E5=BC=82=E5=B8=B8=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20check&assemble=20=E7=9A=84=E5=86=99=E6=B3=95?= =?UTF-8?q?=EF=BC=88=E6=94=B9=E7=94=A8=E7=BB=A7=E6=89=BF=20.gradlew?= =?UTF-8?q?=EF=BC=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] Signed-off-by: ketikai --- .gitlab-ci.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cdf0803..59d0a27 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,5 @@ image: azul/zulu-openjdk:21-latest -before_script: - - GRADLE_USER_HOME="$(pwd)/.gradle" - - export GRADLE_USER_HOME - - java -version - - ls -al - - chmod +x ./gradlew - stages: - test - build @@ -16,8 +9,17 @@ stages: include: - template: "Security/SAST.gitlab-ci.yml" +.gradlew: + before_script: + - GRADLE_USER_HOME="$(pwd)/.gradle" + - export GRADLE_USER_HOME + - java -version + - ls -al + - chmod +x ./gradlew + check: stage: test + extends: .gradlew script: ./gradlew --no-daemon check cache: key: "$CI_COMMIT_REF_NAME" @@ -28,6 +30,7 @@ check: assemble: stage: build + extends: .gradlew rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH script: ./gradlew --no-daemon --build-cache assemble -- GitLab From 22cc8133ff2cc53a0462e80ec43e05d032f6e3f7 Mon Sep 17 00:00:00 2001 From: ketikai Date: Sun, 24 Nov 2024 12:19:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?ci(=E5=B7=A5=E4=BD=9C=E6=B5=81):=20?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=BA=E5=BC=95=E7=94=A8=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=86=85=E5=85=AC=E5=BC=80=E7=9A=84=20CI/CD=20=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E5=86=85=E7=9A=84=20gradlew.gitlab-ci.yml=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] Signed-off-by: ketikai --- .gitlab-ci.yml | 62 ++------------------------------------------------ 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59d0a27..cde48ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,62 +1,4 @@ -image: azul/zulu-openjdk:21-latest - -stages: - - test - - build - - deploy - # noinspection ComposeMissingKeys include: - - template: "Security/SAST.gitlab-ci.yml" - -.gradlew: - before_script: - - GRADLE_USER_HOME="$(pwd)/.gradle" - - export GRADLE_USER_HOME - - java -version - - ls -al - - chmod +x ./gradlew - -check: - stage: test - extends: .gradlew - script: ./gradlew --no-daemon check - cache: - key: "$CI_COMMIT_REF_NAME" - policy: push - paths: - - build - - .gradle - -assemble: - stage: build - extends: .gradlew - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - script: ./gradlew --no-daemon --build-cache assemble - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull-push - paths: - - build - - .gradle - -pages: - stage: deploy - environment: - name: production - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - script: - - rm -rf public - - mkdir -p public/$CI_PROJECT_NAME - - cp -r ./build/docs/* public/$CI_PROJECT_NAME - - cp -r ./build/reports/tests/* public/$CI_PROJECT_NAME - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull - paths: - - build - artifacts: - paths: - - public + - project: "ideal-state/CICD" + file: "gradle/gradlew.gitlab-ci.yml" -- GitLab