Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sample-jee9-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Bruno
sample-jee9-1
Commits
5134e4c4
Commit
5134e4c4
authored
3 years ago
by
Emmanuel Bruno
Browse files
Options
Downloads
Patches
Plain Diff
adds sonar.
parent
9fd19905
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.github/ci-settings.xml
+37
-0
37 additions, 0 deletions
.github/ci-settings.xml
.github/workflows/docker-image.yml
+12
-2
12 additions, 2 deletions
.github/workflows/docker-image.yml
docker-compose.yml
+1
-1
1 addition, 1 deletion
docker-compose.yml
mvn.sh
+17
-0
17 additions, 0 deletions
mvn.sh
with
67 additions
and
3 deletions
.github/ci-settings.xml
0 → 100644
+
37
−
0
View file @
5134e4c4
<!-- A MAVEN SETTINGS FILE TO BE USED IN CI -->
<settings
xmlns=
"http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd"
>
<servers>
<server>
<id>
github
</id>
<username>
${env.GITHUBLOGIN}
</username>
<password>
${env.GITHUBPASSWORD}
</password>
</server>
<server>
<id>
dockerhub
</id>
<username>
${env.DOCKER_USERNAME}
</username>
<password>
${env.DOCKER_PASSWORD}
</password>
</server>
<server>
<id>
github.pages
</id>
<username>
git
</username>
<configuration>
<scmVersionType>
branch
</scmVersionType>
<scmVersion>
gh-pages
</scmVersion>
</configuration>
</server>
</servers>
<profiles>
<profile>
<id>
sonar
</id>
<properties>
<sonar.host.url>
http://compute-lsis-2:9000
</sonar.host.url>
<sonar.login>
${env.SONAR_TOKEN}
</sonar.login>
</properties>
</profile>
</profiles>
</settings>
This diff is collapsed.
Click to expand it.
.github/workflows/docker-image.yml
+
12
−
2
View file @
5134e4c4
...
@@ -14,5 +14,15 @@ jobs:
...
@@ -14,5 +14,15 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Build the Docker image
-
name
:
Build the Docker image for branch ${GITHUB_REF##*/}
run
:
DOCKER_BUILDKIT=1 docker build . --file ./docker/Dockerfile --tag my-image-name:$(date +%s)
run
:
DOCKER_BUILDKIT=1 docker build . --file ./docker/Dockerfile --tag brunoe/samplejee91::${GITHUB_REF##*/}
maven-sonar
:
runs-on
:
[
self-hosted
,
Linux
]
needs
:
maven-build
# Develop branch only
# if: github.ref == 'refs/heads/develop'
steps
:
-
name
:
Launch a sonar analysis
run
:
./mvn.sh -D sonar.branch.name=${GITHUB_REF#refs/heads/} --activate-profiles sonar sonar:sonar && mvn --activate-profiles sonar -pl . sonar-quality-gate:check
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
−
1
View file @
5134e4c4
...
@@ -4,7 +4,7 @@ services:
...
@@ -4,7 +4,7 @@ services:
build
:
build
:
context
:
.
context
:
.
dockerfile
:
docker/Dockerfile
dockerfile
:
docker/Dockerfile
image
:
brunoe/samplejee91
restapp
image
:
brunoe/samplejee91
environment
:
environment
:
-
ADMIN_PASSWORD=admin
-
ADMIN_PASSWORD=admin
ports
:
ports
:
...
...
This diff is collapsed.
Click to expand it.
mvn.sh
0 → 100755
+
17
−
0
View file @
5134e4c4
#!/bin/bash
docker run
\
--env
GITHUBLOGIN
=
"
$GITHUBLOGIN
"
\
--env
GITHUBPASSWORD
=
"
$GITHUBPASSWORD
"
\
--env
SONAR_TOKEN
=
"
$SONAR_TOKEN
"
\
--volume
~/.m2:/var/maven/.m2
\
--volume
~/.sonar:/var/maven/.sonar
\
--volume
~/.config:/var/maven/.config
\
--volume
~/.ssh:/home/user/.ssh
\
--volume
~/.gitconfig:/home/user/.gitconfig
\
--volume
"
$(
pwd
)
"
:/usr/src/mymaven
\
--workdir
/usr/src/mymaven
\
--rm
\
--env
PUID
=
"
$(
id
-u
)
"
-e
PGID
=
"
$(
id
-g
)
"
\
--env
MAVEN_CONFIG
=
/var/maven/.m2
\
brunoe/maven:3.8.1-jdk-16
\
runuser
--user
user
--group
user
--
mvn
-B
-e
-T
1C
-Duser
.home
=
/var/maven
--settings
/usr/src/mymaven/.github/ci-settings.xml
"
$@
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment