Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change sample version for sonar #19481

Merged
merged 4 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ runs:
echo "SPRING_JPA_SHOW_SQL=false" >> $GITHUB_ENV
echo "NG_CLI_ANALYTICS=ci" >> $GITHUB_ENV

JHI_PROJECT_VERSION=$JHI_VERSION
if [[ "true" != "{{ startsWith(github.ref, 'refs/tags/v') }}" ]]; then
JHI_PROJECT_VERSION="$JHI_VERSION-git"
fi
echo "JHI_PROJECT_VERSION=$JHI_PROJECT_VERSION" >> $GITHUB_ENV

if [[ "${{inputs.jhipster-bom-branch}}" != "release" && "${{inputs.jhipster-bom-branch}}" != "ignore" ]]; then
echo "JHI_BOM_VERSION=0.0.0-CICD" >> $GITHUB_ENV
fi
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/angular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,22 @@ jobs:
uses: jwalton/gh-docker-logs@v2
- name: 'ANALYSIS: Sonar analysis'
if: >-
github.event_name == 'push' &&
github.repository == 'jhipster/generator-jhipster' &&
matrix.sonar-analyse == 'true' &&
steps.compare.outputs.equals != 'true' &&
matrix.sonar-analyse != 'false' &&
matrix.workspaces != 'true' &&
matrix.skip-frontend-tests != 1 &&
needs.build-matrix.outputs.client != 'false' &&
matrix.skip-backend-tests != 1 &&
needs.build-matrix.outputs.server != 'false'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
run: |
./mvnw -ntp --batch-mode initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.projectKey=jhipster-sample-application \
-Dsonar.organization=jhipster \
-Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
check-angular:
permissions:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/devserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ jobs:
with:
name: screenshots-${{ matrix.app-sample }}
path: ${{ steps.setup.outputs.application-path }}/*/cypress/screenshots
- name: 'ANALYSIS: Sonar analysis'
if: steps.compare.outputs.equals != 'true' && matrix.sonar-analyse == 'true'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
check-dev-server:
permissions:
contents: none
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/generator-database-changelog-liquibase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,3 @@ jobs:
with:
name: screenshots-${{ matrix.app-type }}
path: ${{ steps.setup.outputs.application-path }}/*/cypress/screenshots
- name: 'ANALYSIS: Sonar analysis'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
13 changes: 0 additions & 13 deletions .github/workflows/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,6 @@ jobs:
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
- name: 'ANALYSIS: Sonar analysis'
if: >-
steps.compare.outputs.equals != 'true' &&
matrix.sonar-analyse != 'false' &&
matrix.workspaces != 'true' &&
matrix.skip-frontend-tests != 1 &&
needs.build-matrix.outputs.client != 'false' &&
matrix.skip-backend-tests != 1 &&
needs.build-matrix.outputs.server != 'false'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
check-react:
permissions:
contents: none
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,6 @@ jobs:
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
- name: 'ANALYSIS: Sonar analysis'
if: >-
steps.compare.outputs.equals != 'true' &&
matrix.sonar-analyse != 'false' &&
matrix.workspaces != 'true' &&
matrix.skip-frontend-tests != 1 &&
needs.build-matrix.outputs.client != 'false' &&
matrix.skip-backend-tests != 1 &&
needs.build-matrix.outputs.server != 'false'
run: $JHI_SCRIPTS/25-sonar-analyze.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
check-vue:
permissions:
contents: none
Expand Down
1 change: 0 additions & 1 deletion generators/common/templates/sonar-project.properties.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
sonar.projectKey=<%= baseName %>
sonar.projectName=<%= baseName %> generated by jhipster
sonar.projectVersion=1.0

sonar.sources=<%= MAIN_DIR %>
sonar.host.url=http://localhost:9001
Expand Down
1 change: 1 addition & 0 deletions generators/generator-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2917,6 +2917,7 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
loadAppConfig(config = _.defaults({}, this.jhipsterConfig, this.jhipsterDefaults), dest = this) {
dest.jhipsterVersion = config.jhipsterVersion;
dest.baseName = config.baseName;
dest.projectVersion = process.env.JHI_PROJECT_VERSION || '0.0.1-SNAPSHOT';
dest.applicationType = config.applicationType;
dest.reactive = config.reactive;
dest.jhiPrefix = config.jhiPrefix;
Expand Down
2 changes: 1 addition & 1 deletion generators/server/templates/pom.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<groupId><%= packageName %></groupId>
<artifactId><%= dasherizedBaseName %></artifactId>
<version>0.0.1-SNAPSHOT</version>
<version><%= projectVersion %></version>
<packaging>jar</packaging>
<name><%= humanizedBaseName %></name>
<description><%= projectDescription %></description>
Expand Down
3 changes: 3 additions & 0 deletions test-integration/scripts/00-init-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,6 @@ JHI_NODE_VERSION=$(grep -o "NODE_VERSION = '[^']*'" $JHI_HOME/generators/generat

# npm version
JHI_NPM_VERSION=$(grep -o '"npm": "[^"]*"' $JHI_HOME/generators/common/templates/package.json | cut -f4 -d '"')

# generator-jhipster version
JHI_VERSION=$(grep -o '"version": "[^"]*"' $JHI_HOME/package.json | cut -f4 -d '"')
6 changes: 3 additions & 3 deletions test-integration/workflow-samples/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
{
"name": "ngx-default",
"app-sample": "ngx-default",
"entity": "sqlfull"
"entity": "sqlfull",
"sonar-analyse": "true"
},
{
"name": "ngx-default-additional",
"entity": "none",
"app-sample": "ngx-default",
"jdl-entity": "*",
"sonar-analyse": "false"
"jdl-entity": "*"
},
{
"name": "ngx-mysql-es-noi18n-mapsid",
Expand Down