Skip to content
Snippets Groups Projects
Commit 591ad4b5 authored by Sébastien Heurtematte's avatar Sébastien Heurtematte :speech_balloon:
Browse files

feat: add dock repo.eclipse.org maven integration


Signed-off-by: Sébastien Heurtematte's avatarsebastien.heurtematte <sebastien.heurtematte@eclipse-foundation.org>
parent 2e8f8017
No related branches found
No related tags found
1 merge request!17Add example repo.eclipse.org publishing
Pipeline #42887 passed with warnings with stages
in 4 minutes and 30 seconds
......@@ -27,7 +27,7 @@ And push to the GitLab repository.
NOTE: You must first activate `CI/CD` feature in your project.
`Settings` -> `General`, select section `Visibility, project features, permissions`, Check `CI/CD`, and Save.
## Job lists
## Template job lists
| Job | Description |
|-------------|--------------|
......@@ -40,7 +40,7 @@ NOTE: You must first activate `CI/CD` feature in your project.
| `git` | Configure git client in a `before_script` section |
| `project-storage` | Push artifacts to `download.eclipse.org` just override `script` section |
### Want to use a specific job for your pipeline
### How to include a template job in your pipeline
```yaml
include:
......@@ -262,4 +262,71 @@ container_scanning:
- export CS_REGISTRY_USER=$CI_REGISTRY_USER
- export CS_REGISTRY_PASSWORD=$CI_REGISTRY_PASSWORD
- export CS_IMAGE="$CI_REGISTRY_IMAGE${CONTAINER_NAME:+"/$CONTAINER_NAME"}":"$IMAGE_TAG"
```
## Other use cases
### Maven integration with `repo.eclipse.org`
Configure `distributionManagement` in the `pom.xml`.
```xml
...
<distributionManagement>
<repository>
<id>repo.eclipse.org</id>
<name>Project Repository - Releases</name>
<url>https://repo.eclipse.org/content/repositories/project-releases/</url>
</repository>
<snapshotRepository>
<id>repo.eclipse.org</id>
<name>Project Repository - Snapshots</name>
<url>https://repo.eclipse.org/content/repositories/project-snapshots/</url>
</snapshotRepository>
</distributionManagement>
....
```
Create `settings.xml` file in your project with this configuration.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<interactiveMode>false</interactiveMode>
<servers>
<server>
<id>repo.eclipse.org</id>
<username>${env.REPO_USERNAME}</username>
<password>${env.REPO_PASSWORD}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>eclipse.maven.central.mirror</id>
<name>Eclipse Central Proxy</name>
<url>https://repo.eclipse.org/content/repositories/maven_central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
```
Job example to deploy to `repo.eclipse.org`:
```yaml
repo.eclipse.org:
stage: deploy
image: maven:3.9.6-eclipse-temurin-21
secrets:
REPO_USERNAME:
vault: <project_id>/repo.eclipse.org/username@cbi
file: false
REPO_PASSWORD:
vault: <project_id>/repo.eclipse.org/password@cbi
file: false
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
script:
- mvn $MAVEN_CLI_OPTS deploy -s settings.xml
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment