Skip to content

Commit

Permalink
WW-5405 Updates to use the main branch instead of master
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Dec 10, 2024
1 parent 5f35af0 commit 9bd8911
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
10 changes: 9 additions & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ notifications:
github:
del_branch_on_merge: true
protected_branches:
master:
main:
# contexts are the names of checks that must pass.
contexts:
- build
required_pull_request_reviews:
# it does not work because our github teams are private/secret, see INFRA-25666
require_code_owner_reviews: false
required_approving_review_count: 0
release/*:
# contexts are the names of checks that must pass.
contexts:
- build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ name: "CodeQL"
on:
push:
branches:
- master
- release/struts-7-0-x
- 'main'
- 'release/*'
pull_request:

permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ on:
pull_request:
push:
branches:
- master
- release/struts-7-0-x
- 'main'
- 'release/*'

permissions: read-all

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
- cron: "30 1 * * 6" # Weekly on Saturdays
push:
branches:
- master
- "main"

permissions: read-all

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ on:
pull_request:
push:
branches:
- master
- release/struts-7-0-x
- 'main'

permissions: read-all

Expand All @@ -45,5 +44,6 @@ jobs:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
if: ${{ github.ref == 'master' || github.base_ref == 'master' }}
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.branch.name=master -Pcoverage -DskipAssembly
MAIN_BRANCH: ${{ github.ref || github.base_ref || github.ref || github.base_ref }}
if: ${{ github.ref == 'main' || github.base_ref == 'main' }}
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.branch.name=${{ envs.MAIN_BRANCH }} -Pcoverage -DskipAssembly
38 changes: 15 additions & 23 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pipeline {
stages {
stage('Test') {
steps {
sh './mvnw -B -DskipAssembly verify --no-transfer-progress'
sh './mvnw -B -DskipAssembly verify'
}
post {
always {
Expand All @@ -64,12 +64,17 @@ pipeline {
maven 'maven_3_latest'
}
environment {
MAVEN_OPTS = "-Xmx1024m"
MAVEN_OPTS = "-Xmx2048m"
}
stages {
stage('Test & Coverage') {
stage('Install') {
steps {
sh './mvnw -B verify -Pcoverage -DskipAssembly --no-transfer-progress'
sh './mvnw -B install -DskipTests -DskipAssembly'
}
}
stage('Test') {
steps {
sh './mvnw -B verify -Pcoverage -DskipAssembly'
}
post {
always {
Expand All @@ -78,52 +83,39 @@ pipeline {
}
}
}
stage('Code Quality') {
when {
anyOf {
branch 'master'; branch 'release/struts-7-0-x'
}
}
steps {
withCredentials([string(credentialsId: 'asf-struts-sonarcloud', variable: 'SONARCLOUD_TOKEN')]) {
sh './mvnw -B -Pcoverage -DskipAssembly -Dsonar.login=${SONARCLOUD_TOKEN} verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --no-transfer-progress'
}
}
}
stage('Build Source & JavaDoc') {
when {
anyOf {
branch 'master'; branch 'release/struts-7-0-x'
branch 'main'
}
}
steps {
dir("local-snapshots-dir/") {
deleteDir()
}
sh './mvnw -B source:jar javadoc:jar -DskipTests -DskipAssembly --no-transfer-progress'
sh './mvnw -B source:jar javadoc:jar -DskipTests -DskipAssembly'
}
}
stage('Deploy Snapshot') {
when {
anyOf {
branch 'master'; branch 'release/struts-7-0-x'
branch 'main'
}
}
steps {
withCredentials([file(credentialsId: 'lukaszlenart-repository-access-token', variable: 'CUSTOM_SETTINGS')]) {
sh './mvnw -s \${CUSTOM_SETTINGS} deploy -DskipTests -DskipAssembly --no-transfer-progress'
sh './mvnw -s \${CUSTOM_SETTINGS} deploy -DskipTests -DskipAssembly'
}
}
}
stage('Upload nightlies') {
when {
anyOf {
branch 'master'
branch 'release/struts-7-0-x'
branch 'main'
}
}
steps {
sh './mvnw -B package -DskipTests --no-transfer-progress'
sh './mvnw -B package -DskipTests'
sshPublisher(publishers: [
sshPublisherDesc(
configName: 'Nightlies',
Expand Down

0 comments on commit 9bd8911

Please sign in to comment.