Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Foundation
Security
scripts
Merge requests
!5
Adding a script to build m2e project
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Adding a script to build m2e project
fcojperez/scripts:main
into
main
Overview
2
Commits
1
Changes
1
Closed
Francisco Perez
requested to merge
fcojperez/scripts:main
into
main
1 year ago
Overview
2
Commits
1
Changes
1
Expand
A script to build m2e project locally
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
4449d522
1 commit,
1 year ago
1 file
+
57
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
utils/build_m2e-core.sh
0 → 100644
+
57
−
0
Options
#!/bin/bash
### Firstly please beaware of having the right mvn version
### mvn minimum version 3.8.6
### Already cloned repo m2e-core as well as recommended to have a PR already pushed
### TIPs:
### 1. undoing all changes applied for this script. Please execute: mvn clean && git checkout master && git reset --hard origin/master
### 2. Ubuntu to configure mvn 3.8.6,
### sudo update-alternatives --install /usr/bin/mvn mvn /opt/maven/apache-maven-3.8.6/bin/mvn 120
### sudo update-alternatives --config mvn
get_pr_id
(){
local
PR_ARG
=
$1
OIFS
=
$IFS
IFS
=
'/'
ARR_PR_ARG_TMP
=(
${
PR_ARG
}
)
IFS
=
'-'
ARR_PR_ARG
=(
${
ARR_PR_ARG_TMP
}
)
echo
${
ARR_PR_ARG
[1]
}
}
main
(){
export
GIT_MERGE_AUTOEDIT
=
no
PULL_ID
=
$1
### Checking PR-ID format, for instance PR-1361 with ID 1361 (where SBOM was added)
re
=
"[0-9]{1,}"
[[
!
$PULL_ID
=
~
$re
]]
&&
echo
"ERROR!!! wrong PULL REQUEST ID format:
${
PULL_ID
}
. Only numbers are allowed"
&&
return
1
### Checking PWD is a m2e-core repo
result
=
$(
git remote
-v
2>/dev/null
)
re_repo
=
m2e-core
[[
!
$result
=
~
$re_repo
]]
&&
echo
"ERROR!!! current PWD:
${
PWD
}
is not repo:
${
re_repo
}
"
&&
return
1
### Fetching master and PULL_ID
git fetch
--no-tags
--force
--progress
--
https://github.com/eclipse-m2e/m2e-core.git +refs/pull/
${
PULL_ID
}
/head:refs/remotes/origin/PR-
${
PULL_ID
}
+refs/heads/master:refs/remotes/origin/master
### Loading trusted files from base branch master at ca3fbcd35e40eb7feabdddec81120f06f8bb734c
git merge ca3fbcd35e40eb7feabdddec81120f06f8bb734c
COMMIT_SHA
=
$(
git rev-parse HEAD^
{
commit
}
)
git checkout
-f
${
COMMIT_SHA
}
### Updating submodule
git submodule update
--init
--recursive
--remote
### Building locally
mvn clean verify
-Dtycho
.p2.baselineMode
=
failCommon
--batch-mode
-Pits
unset
GIT_MERGE_AUTOEDIT
}
main
"
$@
"
Loading