Skip to content

Commit a1224f4

Browse files
committed
Support update site management using p2.manager
1 parent 5580974 commit a1224f4

22 files changed

Lines changed: 301 additions & 76 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Maven
22
target/
33
.polyglot.META-INF
4+
build.log

Jenkinsfile

Lines changed: 154 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
pipeline {
2-
options {
3-
timeout(time: 2, unit: 'HOURS')
4-
buildDiscarder(logRotator(numToKeepStr:'10'))
5-
disableConcurrentBuilds(abortPrevious: true)
6-
}
2+
options {
3+
timeout(time: 2, unit: 'HOURS')
4+
buildDiscarder(logRotator(numToKeepStr:'10'))
5+
disableConcurrentBuilds(abortPrevious: true)
6+
}
7+
78
agent {
89
kubernetes {
910
inheritFrom 'wildwebdeveloper-buildtest-pod'
@@ -49,55 +50,152 @@ spec:
4950
"""
5051
}
5152
}
52-
environment {
53-
NPM_CONFIG_USERCONFIG = "$WORKSPACE/.npmrc"
54-
MAVEN_OPTS="-Xmx1024m"
55-
GITHUB_API_CREDENTIALS_ID = 'github-bot-token'
56-
}
57-
stages {
58-
stage('Prepare-environment') {
59-
steps {
60-
container('container') {
61-
sh 'java -version'
62-
sh 'mvn --version'
63-
sh 'node --version'
64-
sh 'npm --version'
65-
sh 'npm config set cache="$WORKSPACE/npm-cache"'
66-
}
67-
}
68-
}
69-
stage('Build') {
70-
steps {
71-
container('container') {
72-
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'), string(credentialsId: 'gpg-passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
73-
withCredentials([string(credentialsId: "${GITHUB_API_CREDENTIALS_ID}", variable: 'GITHUB_API_TOKEN')]) {
74-
wrap([$class: 'Xvnc', useXauthority: true]) {
75-
sh '''mvn clean verify -B -fae -Ddownload.cache.skip=true -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Psign -Dmaven.repo.local=$WORKSPACE/.m2/repository -Dgithub.api.token="${GITHUB_API_TOKEN}" -Dtycho.pgp.signer.bc.secretKeys="${KEYRING}" '''
76-
}
77-
}
78-
}
79-
}
80-
}
81-
post {
82-
always {
83-
junit '*/target/surefire-reports/TEST-*.xml'
84-
archiveArtifacts artifacts: 'repository/target/repository/**,*/target/work/configuration/*.log,*/target/work/data/.metadata/.log,*/target/work/data/languageServers-log/**,org.eclipse.wildwebdeveloper/target/chrome-debug-adapter/chromeDebugAdapter.zip'
85-
}
86-
}
87-
}
88-
stage('Deploy') {
89-
when {
90-
branch 'master'
91-
}
92-
steps {
93-
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
94-
sh '''
95-
ssh genie.wildwebdeveloper@projects-storage.eclipse.org rm -rf /home/data/httpd/download.eclipse.org/wildwebdeveloper/snapshots
96-
ssh genie.wildwebdeveloper@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/wildwebdeveloper/snapshots
97-
scp -r repository/target/repository/* genie.wildwebdeveloper@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/wildwebdeveloper/snapshots
98-
'''
99-
}
100-
}
101-
}
102-
}
53+
54+
environment {
55+
NPM_CONFIG_USERCONFIG = "$WORKSPACE/.npmrc"
56+
MAVEN_OPTS="-Xmx1024m"
57+
GITHUB_API_CREDENTIALS_ID = 'github-bot-token'
58+
MAIN_BRANCH = 'pr-p2.manager'
59+
GENIE = 'genie.orbit'
60+
TARGET_LOCATION = 'tools/orbit/archive/wildwebdeveloper'
61+
BUILD_TIMESTAMP = sh(returnStdout: true, script: 'date +%Y%m%d-%H%M').trim()
62+
}
63+
64+
parameters {
65+
choice(
66+
name: 'BUILD_TYPE',
67+
choices: ['nightly', 'milestone', 'release'],
68+
description: '''
69+
Choose the type of build.
70+
Note that a release build will not promote the build, but rather will promote the most recent milestone build.
71+
'''
72+
)
73+
74+
booleanParam(
75+
name: 'PROMOTE',
76+
defaultValue: true,
77+
description: 'Whether to promote the build to the download server.'
78+
)
79+
}
80+
81+
stages {
82+
stage('Display Parameters') {
83+
steps {
84+
script {
85+
env.BUILD_TYPE = params.BUILD_TYPE
86+
if (env.BRANCH_NAME == env.MAIN_BRANCH) {
87+
env.WITH_CREDENTIALS = true
88+
env.MAVEN_PROFILES = "-Psign"
89+
} else {
90+
env.WITH_CREDENTIALS = false
91+
env.MAVEN_PROFILES = ""
92+
}
93+
94+
def description = """
95+
BRANCH_NAME=${env.BRANCH_NAME}
96+
BUILD_TIMESTAMP=${env.BUILD_TIMESTAMP}
97+
BUILD_TYPE=${env.BUILD_TYPE}
98+
MAVEN_PROFILES=${env.MAVEN_PROFILES}
99+
WITH_CREDENTIALS=${env.WITH_CREDENTIALS}
100+
""".trim()
101+
echo description
102+
currentBuild.description = description.replace("\n", "<br/>")
103+
}
104+
}
105+
}
106+
107+
stage('Prepare-environment') {
108+
steps {
109+
container('container') {
110+
sh 'java -version'
111+
sh 'mvn --version'
112+
sh 'node --version'
113+
sh 'npm --version'
114+
sh 'npm config set cache="$WORKSPACE/npm-cache"'
115+
}
116+
}
117+
}
118+
stage('Build') {
119+
steps {
120+
container('container') {
121+
script {
122+
if (env.WITH_CREDENTIALS == 'true') {
123+
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'), string(credentialsId: 'gpg-passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
124+
withCredentials([string(credentialsId: "${GITHUB_API_CREDENTIALS_ID}", variable: 'GITHUB_API_TOKEN')]) {
125+
mvn()
126+
}
127+
}
128+
stash includes: '.mvn/**,pom.xml,**/pom.xml,repository/target/repository/**,org.eclipse.wildwebdeveloper.xml/**', name: 'container-stash'
129+
} else {
130+
mvn()
131+
}
132+
}
133+
}
134+
}
135+
post {
136+
always {
137+
junit '*/target/surefire-reports/TEST-*.xml'
138+
archiveArtifacts artifacts: 'repository/target/repository/**,*/target/work/configuration/*.log,*/target/work/data/.metadata/.log,*/target/work/data/languageServers-log/**,org.eclipse.wildwebdeveloper/target/chrome-debug-adapter/chromeDebugAdapter.zip'
139+
}
140+
}
141+
}
142+
143+
stage('Deploy') {
144+
when {
145+
environment name: 'PROMOTE', value: 'true'
146+
}
147+
agent {
148+
label 'ubuntu-latest'
149+
}
150+
tools {
151+
maven 'apache-maven-latest'
152+
jdk 'temurin-jdk21-latest'
153+
}
154+
options {
155+
skipDefaultCheckout true
156+
}
157+
steps {
158+
unstash 'container-stash'
159+
sshagent (['projects-storage.eclipse.org-bot-ssh']) {
160+
sh 'ls -sailR'
161+
promote();
162+
}
163+
}
164+
}
165+
}
166+
}
167+
168+
def void mvn() {
169+
wrap([$class: 'Xvnc', useXauthority: true]) {
170+
sh '''
171+
mvn \
172+
clean \
173+
verify \
174+
-B \
175+
-fae \
176+
-Dgpg-keyname=C1F58CF8 \
177+
$MAVEN_PROFILES \
178+
-Ddownload.cache.skip=true \
179+
-Dmaven.test.error.ignore=true \
180+
-Dmaven.test.failure.ignore=true \
181+
-Dmaven.repo.local=$WORKSPACE/.m2/repository \
182+
-Dgithub.api.token="${GITHUB_API_TOKEN}" \
183+
-Dtycho.pgp.signer.bc.secretKeys="${KEYRING}" \
184+
'''
185+
}
186+
}
187+
188+
def void promote() {
189+
sh '''
190+
mvn \
191+
verify \
192+
-B \
193+
-pl :promote \
194+
-Ppromote \
195+
-Dbuild.type=$BUILD_TYPE \
196+
-Dgit.commit=$GIT_COMMIT \
197+
-Dorg.eclipse.storage.user=$GENIE \
198+
-Dorg.eclipse.justj.p2.manager.build.url=$JOB_URL \
199+
-Dorg.eclipse.justj.p2.manager.target=$TARGET_LOCATION \
200+
'''
103201
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name=Node.js embedder from Wild Web Developer
1+
name=WWD Node.js Embedder
22
description=Includes node.js and some code to manage and consume it from other bundles
33
copyright=Copyright (c) 2020 Red Hat Inc. and others.\
44
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/

org.eclipse.wildwebdeveloper.embedder.node.feature/feature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
id="org.eclipse.wildwebdeveloper.embedder.node.feature"
44
label="%name"
55
version="1.2.6.qualifier"
6-
provider-name="Eclipse Wild Web Developer project"
6+
provider-name="Eclipse Wild Web Developer"
77
license-feature="org.eclipse.license"
88
license-feature-version="0.0.0">
99

org.eclipse.wildwebdeveloper.embedder.node.linux.aarch64/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
3-
Bundle-Name: Node.js for Linux AArch64
3+
Bundle-Name: WWD Node.js for Linux AArch64
44
Bundle-SymbolicName: org.eclipse.wildwebdeveloper.embedder.node.linux.aarch64
55
Bundle-Version: 1.1.9.qualifier
66
Bundle-License: EPL-2.0;link="http://www.eclipse.org/legal/epl-2.0"

org.eclipse.wildwebdeveloper.embedder.node.linux.x86_64/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
3-
Bundle-Name: Node.js for Linux x64
3+
Bundle-Name: WWD Node.js for Linux x64
44
Bundle-SymbolicName: org.eclipse.wildwebdeveloper.embedder.node.linux.x86_64
55
Bundle-Version: 1.1.9.qualifier
66
Bundle-License: EPL-2.0;link="http://www.eclipse.org/legal/epl-2.0"

org.eclipse.wildwebdeveloper.embedder.node.macos.aarch64/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
3-
Bundle-Name: Node.js for MacOS AArch64
3+
Bundle-Name: WWD Node.js for MacOS AArch64
44
Bundle-SymbolicName: org.eclipse.wildwebdeveloper.embedder.node.macos.aarch64
55
Bundle-Version: 1.1.9.qualifier
66
Bundle-License: EPL-2.0;link="http://www.eclipse.org/legal/epl-2.0"

org.eclipse.wildwebdeveloper.embedder.node.macos.x86_64/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
3-
Bundle-Name: Node.js for MacOS x64
3+
Bundle-Name: WWD Node.js for MacOS x64
44
Bundle-SymbolicName: org.eclipse.wildwebdeveloper.embedder.node.macos.x86_64
55
Bundle-Version: 1.1.9.qualifier
66
Bundle-License: EPL-2.0;link="http://www.eclipse.org/legal/epl-2.0"

org.eclipse.wildwebdeveloper.embedder.node.win32.aarch64/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
3-
Bundle-Name: Node.js for Windows AArch64
3+
Bundle-Name: WWD Node.js for Windows AArch64
44
Bundle-SymbolicName: org.eclipse.wildwebdeveloper.embedder.node.win32.aarch64
55
Bundle-Version: 1.0.5.qualifier
66
Bundle-License: EPL-2.0;link="http://www.eclipse.org/legal/epl-2.0"

org.eclipse.wildwebdeveloper.embedder.node.win32.x86_64/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
3-
Bundle-Name: Node.js for Windows x86_64
3+
Bundle-Name: WWD Node.js for Windows x64
44
Bundle-SymbolicName: org.eclipse.wildwebdeveloper.embedder.node.win32.x86_64
55
Bundle-Version: 1.1.9.qualifier
66
Bundle-License: EPL-2.0;link="http://www.eclipse.org/legal/epl-2.0"

0 commit comments

Comments
 (0)