Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
project-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭燕飞
project-template
Commits
fbbff685
Commit
fbbff685
authored
Oct 29, 2020
by
郭燕飞
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接入jib
parent
2cd0f34d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
84 additions
and
14 deletions
+84
-14
.gitlab-ci.yml
service-template/.gitlab-ci.yml
+23
-6
Dockerfile
service-template/Dockerfile
+10
-0
build.gradle
service-template/bizModule/build.gradle
+1
-0
build.gradle
service-template/build.gradle
+2
-1
gradle.properties
service-template/gradle.properties
+1
-0
gradleConfig
service-template/gradleConfig
+5
-0
.gitlab-ci.yml
web-template/.gitlab-ci.yml
+23
-6
Dockerfile
web-template/Dockerfile
+10
-0
build.gradle
web-template/build.gradle
+3
-1
gradle.properties
web-template/gradle.properties
+1
-0
gradleConfig
web-template/gradleConfig
+5
-0
No files found.
service-template/.gitlab-ci.yml
View file @
fbbff685
before_script
:
-
gradleVersionFun(){
if [ ! -f "gradleConfig" ]; then
echo "gradleConfig is
null
";
gradle=gradle;
else
source ./gradleConfig;
echo "gradleVersion"+$gradleVersion;
echo "gradleBuildType"+$gradleBuildType;
if [ $gradleVersion==6 ]; then
gradle=/opt/app/gradle-6.6.1/bin/gradle;
else
gradle=gradle;
fi
fi
};
sonarqube_feature_preview
:
sonarqube_feature_preview
:
script
:
script
:
-
git config --global user.email "sonar@duiba"
-
git config --global user.email "sonar@duiba"
-
git config --global user.name "sonar"
-
git config --global user.name "sonar"
-
gradle clean
-
$
gradle clean
-
export
-
export
-
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
-
$
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
stage
:
test
stage
:
test
only
:
only
:
-
/^feature.*$/
-
/^feature.*$/
...
@@ -15,9 +32,9 @@ sonarqube_hotfix_preview:
...
@@ -15,9 +32,9 @@ sonarqube_hotfix_preview:
script
:
script
:
-
git config --global user.email "sonar@duiba"
-
git config --global user.email "sonar@duiba"
-
git config --global user.name "sonar"
-
git config --global user.name "sonar"
-
gradle clean
-
$
gradle clean
-
export
-
export
-
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
-
$
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
stage
:
test
stage
:
test
only
:
only
:
-
/^(hotfix|release).*$/
-
/^(hotfix|release).*$/
...
@@ -29,8 +46,8 @@ sonarqube_develop_preview:
...
@@ -29,8 +46,8 @@ sonarqube_develop_preview:
-
git config --global user.email "sonar@duiba"
-
git config --global user.email "sonar@duiba"
-
git config --global user.name "sonar"
-
git config --global user.name "sonar"
-
git checkout origin/develop
-
git checkout origin/develop
-
gradle clean
-
$
gradle clean
-
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.login=reporter -Dsonar.password=duiba123456 -x test
-
$
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.login=reporter -Dsonar.password=duiba123456 -x test
only
:
only
:
-
develop
-
develop
tags
:
tags
:
...
...
service-template/Dockerfile
0 → 100644
View file @
fbbff685
FROM
registry.cn-hangzhou.aliyuncs.com/duiba/duiba-jdk8
MAINTAINER
op@duiba.com.cn
ARG
appname
ARG
environment
ENV
LANG en_US.utf8
RUN
mkdir
/root/duiba-deploy/
COPY
./duiba-deploy /root/duiba-deploy/
COPY
./scripts /root/scripts
#define entry point which will be run first when the container starts up
ENTRYPOINT
java $JAVA_OPS -jar /root/duiba-deploy/$appname.jar --spring.profiles.active=$SPRING_ENV --spring.cloud.config.uri=$CONFIG_SERVER
service-template/bizModule/build.gradle
View file @
fbbff685
apply
plugin:
"org.springframework.boot"
apply
plugin:
"org.springframework.boot"
apply
plugin:
"com.google.cloud.tools.jib"
bootJar
{
bootJar
{
archiveName
=
"{artifactId}.jar"
archiveName
=
"{artifactId}.jar"
...
...
service-template/build.gradle
View file @
fbbff685
...
@@ -18,9 +18,10 @@ buildscript {
...
@@ -18,9 +18,10 @@ buildscript {
dependencies
{
dependencies
{
classpath
"io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE"
classpath
"io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE"
classpath
"org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:
2.5
"
//sonarqube
classpath
"org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:
3.0
"
//sonarqube
classpath
"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath
"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath
"org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath
"org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath
"gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:2.5.0"
classpath
"cn.com.duiba:duiba-gradle-plugin:0.1.9"
classpath
"cn.com.duiba:duiba-gradle-plugin:0.1.9"
}
}
}
}
...
...
service-template/gradle.properties
0 → 100644
View file @
fbbff685
org.gradle.jvmargs
=
-Xmx2048m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8
\ No newline at end of file
service-template/gradleConfig
0 → 100644
View file @
fbbff685
gradleVersion=6
gradleBuildType=jib
jibFromImage=registry.cn-hangzhou.aliyuncs.com/duiba/duiba-jdk8
jibContainerMainClass={groupId}.{artifactIdPackage}.Application
\ No newline at end of file
web-template/.gitlab-ci.yml
View file @
fbbff685
before_script
:
-
gradleVersionFun(){
if [ ! -f "gradleConfig" ]; then
echo "gradleConfig is
null
";
gradle=gradle;
else
source ./gradleConfig;
echo "gradleVersion"+$gradleVersion;
echo "gradleBuildType"+$gradleBuildType;
if [ $gradleVersion==6 ]; then
gradle=/opt/app/gradle-6.6.1/bin/gradle;
else
gradle=gradle;
fi
fi
};
sonarqube_feature_preview
:
sonarqube_feature_preview
:
script
:
script
:
-
git config --global user.email "sonar@duiba"
-
git config --global user.email "sonar@duiba"
-
git config --global user.name "sonar"
-
git config --global user.name "sonar"
-
gradle clean
-
$
gradle clean
-
export
-
export
-
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
-
$
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
stage
:
test
stage
:
test
only
:
only
:
-
/^feature.*$/
-
/^feature.*$/
...
@@ -15,9 +32,9 @@ sonarqube_hotfix_preview:
...
@@ -15,9 +32,9 @@ sonarqube_hotfix_preview:
script
:
script
:
-
git config --global user.email "sonar@duiba"
-
git config --global user.email "sonar@duiba"
-
git config --global user.name "sonar"
-
git config --global user.name "sonar"
-
gradle clean
-
$
gradle clean
-
export
-
export
-
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
-
$
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.branch=dummy -Dsonar.login=reporter -Dsonar.password=duiba123456 -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -x test
stage
:
test
stage
:
test
only
:
only
:
-
/^(hotfix|release).*$/
-
/^(hotfix|release).*$/
...
@@ -29,8 +46,8 @@ sonarqube_develop_preview:
...
@@ -29,8 +46,8 @@ sonarqube_develop_preview:
-
git config --global user.email "sonar@duiba"
-
git config --global user.email "sonar@duiba"
-
git config --global user.name "sonar"
-
git config --global user.name "sonar"
-
git checkout origin/develop
-
git checkout origin/develop
-
gradle clean
-
$
gradle clean
-
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.login=reporter -Dsonar.password=duiba123456 -x test
-
$
gradle sonarqube -Dsonar.host.url=http://sonar.dui88.com -Dsonar.login=reporter -Dsonar.password=duiba123456 -x test
only
:
only
:
-
develop
-
develop
tags
:
tags
:
...
...
web-template/Dockerfile
0 → 100644
View file @
fbbff685
FROM
registry.cn-hangzhou.aliyuncs.com/duiba/duiba-jdk8
MAINTAINER
op@duiba.com.cn
ARG
appname
ARG
environment
ENV
LANG en_US.utf8
RUN
mkdir
/root/duiba-deploy/
COPY
./duiba-deploy /root/duiba-deploy/
COPY
./scripts /root/scripts
#define entry point which will be run first when the container starts up
ENTRYPOINT
java $JAVA_OPS -jar /root/duiba-deploy/$appname.jar --spring.profiles.active=$SPRING_ENV --spring.cloud.config.uri=$CONFIG_SERVER
web-template/build.gradle
View file @
fbbff685
...
@@ -18,9 +18,10 @@ buildscript {
...
@@ -18,9 +18,10 @@ buildscript {
dependencies
{
dependencies
{
classpath
"io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE"
classpath
"io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE"
classpath
"org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:
2.5
"
//sonarqube
classpath
"org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:
3.0
"
//sonarqube
classpath
"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath
"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath
"org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath
"org.springframework.build.gradle:propdeps-plugin:0.0.7"
classpath
"gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:2.5.0"
classpath
"cn.com.duiba:duiba-gradle-plugin:0.1.9"
classpath
"cn.com.duiba:duiba-gradle-plugin:0.1.9"
}
}
}
}
...
@@ -35,6 +36,7 @@ sonarqube {
...
@@ -35,6 +36,7 @@ sonarqube {
}
}
}
}
apply
plugin:
"com.google.cloud.tools.jib"
apply
plugin:
"duiba.gradle.plugin"
apply
plugin:
"duiba.gradle.plugin"
apply
plugin:
"maven"
apply
plugin:
"maven"
apply
plugin:
"java"
apply
plugin:
"java"
...
...
web-template/gradle.properties
0 → 100644
View file @
fbbff685
org.gradle.jvmargs
=
-Xmx2048m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8
\ No newline at end of file
web-template/gradleConfig
0 → 100644
View file @
fbbff685
gradleVersion=6
gradleBuildType=jib
jibFromImage=registry.cn-hangzhou.aliyuncs.com/duiba/duiba-jdk8
jibContainerMainClass={groupId}.{artifactIdPackage}.Application
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment