Skip to content

Commit 1333ec4

Browse files
committed
Merge branch 'main' into develop-v2
# Conflicts: # imagetool/pom.xml # installer/pom.xml # pom.xml # tests/pom.xml
2 parents b85d47a + 4fd86a0 commit 1333ec4

File tree

16 files changed

+170
-92
lines changed

16 files changed

+170
-92
lines changed

Jenkinsfile

Lines changed: 104 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pipeline {
44
}
55
agent any
66
tools {
7-
maven 'maven-3.6.0'
7+
maven 'maven-3.8.7'
88
jdk 'jdk11'
99
}
1010

@@ -15,10 +15,9 @@ pipeline {
1515

1616
environment {
1717
// variables for SystemTest stages (integration tests)
18-
STAGING_DIR = "/scratch/artifacts/imagetool"
19-
DB_IMAGE = "phx.ocir.io/weblogick8s/database/enterprise:12.2.0.1-slim"
20-
GITHUB_API_TOKEN = credentials('encj_github_token')
21-
GH_TOOL = tool name: 'github-cli', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool'
18+
STAGING_DIR = "${WORKSPACE}/wit-system-test-files"
19+
DB_IMAGE = "${WKT_OCIR_HOST}/${WKT_TENANCY}/database/enterprise:12.2.0.1-slim"
20+
JRE_IMAGE = "${WKT_OCIR_HOST}/${WKT_TENANCY}/java/serverjre:8"
2221
}
2322

2423
stages {
@@ -33,39 +32,59 @@ pipeline {
3332
}
3433
stage ('Build') {
3534
steps {
36-
sh 'mvn -B -DskipTests -DskipITs clean install'
35+
withMaven(globalMavenSettingsConfig: 'wkt-maven-settings-xml', publisherStrategy: 'EXPLICIT') {
36+
sh 'mvn -B -DskipTests -DskipITs clean install'
37+
}
3738
}
3839
}
3940
stage ('Unit Tests') {
4041
when {
4142
not { changelog '\\[skip-ci\\].*' }
4243
}
4344
steps {
44-
sh 'mvn test'
45+
withMaven(globalMavenSettingsConfig: 'wkt-maven-settings-xml', publisherStrategy: 'EXPLICIT') {
46+
sh 'mvn -B test'
47+
}
4548
}
4649
post {
4750
always {
4851
junit 'imagetool/target/surefire-reports/*.xml'
4952
}
5053
}
5154
}
52-
stage ('Sonar Analysis') {
55+
// stage ('Sonar Analysis') {
56+
// when {
57+
// anyOf {
58+
// changeRequest()
59+
// branch "main"
60+
// }
61+
// }
62+
// tools {
63+
// maven 'maven-3.8.7'
64+
// jdk 'jdk11'
65+
// }
66+
// steps {
67+
// withSonarQubeEnv('SonarCloud') {
68+
// withCredentials([string(credentialsId: 'encj_github_token', variable: 'GITHUB_TOKEN')]) {
69+
// runSonarScanner()
70+
// }
71+
// }
72+
// }
73+
// }
74+
stage ('Download System Test Files') {
5375
when {
5476
anyOf {
55-
changeRequest()
56-
branch "main"
77+
changeRequest target: 'main'
78+
triggeredBy 'TimerTrigger'
79+
changelog '\\[full-mats\\].*'
5780
}
5881
}
59-
tools {
60-
maven 'maven-3.6.0'
61-
jdk 'jdk11'
62-
}
6382
steps {
64-
withSonarQubeEnv('SonarCloud') {
65-
withCredentials([string(credentialsId: 'encj_github_token', variable: 'GITHUB_TOKEN')]) {
66-
runSonarScanner()
67-
}
68-
}
83+
sh '''
84+
rm -rf ${STAGING_DIR}
85+
mkdir ${STAGING_DIR}
86+
oci os object bulk-download --namespace devweblogic --bucket-name wit-system-test-files --config-file=/dev/null --auth=instance_principal --download-dir ${STAGING_DIR}
87+
'''
6988
}
7089
}
7190
stage ('SystemTest Gate') {
@@ -77,17 +96,22 @@ pipeline {
7796
}
7897
}
7998
steps {
80-
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'otn-cred', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
81-
sh '''
82-
cd tests
83-
mvn clean verify -Dtest.staging.dir=${STAGING_DIR} -Dtest.groups=gate -DskipITs=false
84-
'''
99+
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'wkt-otn-credential', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
100+
withMaven(globalMavenSettingsConfig: 'wkt-maven-settings-xml', publisherStrategy: 'EXPLICIT') {
101+
sh '''
102+
cd tests
103+
mvn -B clean verify -Dtest.groups=gate -DskipITs=false
104+
'''
105+
}
85106
}
86107
}
87108
post {
88109
always {
89110
junit 'tests/target/failsafe-reports/*.xml'
90111
}
112+
failure {
113+
archiveArtifacts artifacts: 'tests/target/logs/*.*', onlyIfSuccessful: 'false'
114+
}
91115
}
92116
}
93117
stage ('SystemTest Full') {
@@ -100,38 +124,55 @@ pipeline {
100124
steps {
101125
script {
102126
docker.image("${env.DB_IMAGE}").pull()
127+
docker.image("${env.JRE_IMAGE}").pull()
103128
}
104-
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'otn-cred', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
105-
sh '''
106-
cd tests
107-
mvn clean verify -Dtest.staging.dir=${STAGING_DIR} -Dtest.groups=gate,nightly -DskipITs=false
108-
'''
129+
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'wkt-otn-credential', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
130+
withMaven(globalMavenSettingsConfig: 'wkt-maven-settings-xml', publisherStrategy: 'EXPLICIT') {
131+
sh '''
132+
cd tests
133+
mvn -B clean verify -Dtest.groups=gate,nightly -DskipITs=false
134+
'''
135+
}
109136
}
110137
}
111138
post {
112139
always {
113140
junit 'tests/target/failsafe-reports/*.xml'
114141
}
115142
failure {
116-
mail to: "${env.WIT_BUILD_NOTIFICATION_EMAIL_TO}", from: '[email protected]',
117-
subject: "WebLogic Image Tool: ${env.JOB_NAME} - Failed",
118-
body: "Job Failed - \"${env.JOB_NAME}\" build: ${env.BUILD_NUMBER}\n\nView the log at:\n ${env.BUILD_URL}\n"
143+
// save logs for debugging test failures
144+
archiveArtifacts artifacts: 'tests/target/logs/*.*', onlyIfSuccessful: 'false'
145+
// notify staff when nightly builds fail
146+
slackSend channel: '#wkt-build-failure-notifications', botUser: false, color: 'danger',
147+
message: "Build failed. WebLogic Image Tool: <${env.BUILD_URL}|${env.JOB_NAME}:${env.BUILD_NUMBER}>"
119148
}
120149
}
121150
}
122151
stage ('Save Nightly Installer') {
123152
when {
124-
allOf {
125-
triggeredBy 'TimerTrigger'
126-
branch "main"
127-
}
153+
triggeredBy 'TimerTrigger'
154+
branch "main"
128155
}
129156
steps {
130157
sh '''
131-
oci os object put --namespace=weblogick8s --bucket-name=wko-system-test-files --config-file=/dev/null --auth=instance_principal --force --file=installer/target/imagetool.zip --name=imagetool-main.zip
158+
oci os object put --namespace=${WKT_TENANCY} --bucket-name=wko-system-test-files --config-file=/dev/null --auth=instance_principal --force --file=installer/target/imagetool.zip --name=imagetool-main.zip
132159
'''
133160
}
134161
}
162+
stage ('Sync') {
163+
when {
164+
branch 'main'
165+
anyOf {
166+
not { triggeredBy 'TimerTrigger' }
167+
tag 'release-*'
168+
}
169+
}
170+
steps {
171+
build job: "wkt-sync",
172+
parameters: [ string(name: 'REPOSITORY', value: 'weblogic-image-tool') ],
173+
wait: true
174+
}
175+
}
135176
stage ('Create Draft Release') {
136177
when {
137178
tag 'release-*'
@@ -140,36 +181,39 @@ pipeline {
140181
script {
141182
env.TAG_VERSION_NUMBER = env.TAG_NAME.replaceAll('release-','').trim()
142183
}
143-
144-
sh """
145-
echo '${env.GITHUB_API_TOKEN}' | ${GH_TOOL}/bin/gh auth login --with-token
146-
${GH_TOOL}/bin/gh release create ${TAG_NAME} \
184+
withCredentials([string(credentialsId: 'wkt-github-token', variable: 'GITHUB_API_TOKEN')]) {
185+
sh """
186+
mkdir gh-cli
187+
curl -sL https://github.com/cli/cli/releases/download/v2.28.0/gh_2.28.0_linux_amd64.tar.gz | tar xvzf - --strip-components=1 -C ./gh-cli
188+
echo '${GITHUB_API_TOKEN}' | ./gh-cli/bin/gh auth login --with-token
189+
./gh-cli/bin/gh release create ${TAG_NAME} \
147190
--draft \
148191
--generate-notes \
149192
--title 'WebLogic Image Tool ${TAG_VERSION_NUMBER}' \
150193
--repo https://github.com/oracle/weblogic-image-tool \
151194
installer/target/imagetool.zip
152-
"""
195+
"""
196+
}
153197
}
154198
}
155199
}
156200
}
157201

158-
void runSonarScanner() {
159-
def changeUrl = env.GIT_URL.split("/")
160-
def org = changeUrl[3]
161-
def repo = changeUrl[4].substring(0, changeUrl[4].length() - 4)
162-
if (env.CHANGE_ID != null) {
163-
sh "mvn -B sonar:sonar \
164-
-Dsonar.projectKey=${org}_${repo} \
165-
-Dsonar.pullrequest.provider=GitHub \
166-
-Dsonar.pullrequest.github.repository=${org}/${repo} \
167-
-Dsonar.pullrequest.key=${env.CHANGE_ID} \
168-
-Dsonar.pullrequest.branch=${env.CHANGE_BRANCH} \
169-
-Dsonar.pullrequest.base=${env.CHANGE_TARGET}"
170-
} else {
171-
sh "mvn -B sonar:sonar \
172-
-Dsonar.projectKey=${org}_${repo} \
173-
-Dsonar.branch.name=${env.BRANCH_NAME}"
174-
}
175-
}
202+
//void runSonarScanner() {
203+
// def changeUrl = env.GIT_URL.split("/")
204+
// def org = changeUrl[3]
205+
// def repo = changeUrl[4].substring(0, changeUrl[4].length() - 4)
206+
// if (env.CHANGE_ID != null) {
207+
// sh "mvn -B sonar:sonar \
208+
// -Dsonar.projectKey=${org}_${repo} \
209+
// -Dsonar.pullrequest.provider=GitHub \
210+
// -Dsonar.pullrequest.github.repository=${org}/${repo} \
211+
// -Dsonar.pullrequest.key=${env.CHANGE_ID} \
212+
// -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH} \
213+
// -Dsonar.pullrequest.base=${env.CHANGE_TARGET}"
214+
// } else {
215+
// sh "mvn -B sonar:sonar \
216+
// -Dsonar.projectKey=${org}_${repo} \
217+
// -Dsonar.branch.name=${env.BRANCH_NAME}"
218+
// }
219+
//}

documentation/1.11/content/userguide/tools/create-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Usage: imagetool create [OPTIONS]
4646
| `--skipcleanup` | Do not delete the build context folder, intermediate images, and failed build containers. For debugging purposes. | |
4747
| `--strictPatchOrdering` | Instruct OPatch to apply patches one at a time (uses `apply` instead of `napply`). | |
4848
| `--target` | Select the target environment in which the created image will be used. Supported values: `Default` (Docker/Kubernetes), `OpenShift`. See [Additional information](#--target). | `Default` |
49-
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `OSB`, `OUD_WLS`, `SOA_OSB`, `SOA_OSB_B2B`, `MFT`, `WCP`, `OAM`, `OIG`, `OUD`, `OID`, `SOA`, `WCC`, `WCS`, `WCP` | `WLS` |
49+
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `OSB`, `OUD_WLS`, `SOA_OSB`, `SOA_OSB_B2B`, `MFT`, `WCP`, `OAM`, `OIG`, `OUD`, `OID`, `ODI`, `SOA`, `WCC`, `WCS`, `WCP` | `WLS` |
5050
| `--user` | Oracle support email ID. When supplying `user`, you must supply the password either as an environment variable using `--passwordEnv`, or as a file using `--passwordFile`, or interactively, on the command line with `--password`. | |
5151
| `--version` | Installer version. | `12.2.1.3.0` |
5252
| `--wdtArchive` | A WDT archive ZIP file or comma-separated list of files. | |

documentation/1.11/content/userguide/tools/rebase-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Usage: imagetool rebase [OPTIONS]
4545
| `--strictPatchOrdering` | Instruct OPatch to apply patches one at a time (uses `apply` instead of `napply`). | |
4646
| `--target` | Select the target environment in which the created image will be used. Supported values: `Default` (Docker/Kubernetes), `OpenShift`. See [Additional information](#--target). | `Default` |
4747
| `--targetImage` | Container image to extend for the domain's new image. | |
48-
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `OSB`, `OUD_WLS`, `SOA_OSB`, `SOA_OSB_B2B`, `MFT`, `WCP`, `OAM`, `OIG`, `OUD`, `OID`, `SOA`, `WCC`, `WCS`, `WCP` | `WLS` |
48+
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `OSB`, `OUD_WLS`, `SOA_OSB`, `SOA_OSB_B2B`, `MFT`, `WCP`, `OAM`, `OIG`, `OUD`, `OID`, `ODI`, `SOA`, `WCC`, `WCS`, `WCP` | `WLS` |
4949
| `--user` | Your Oracle support email ID. When supplying `user`, you must supply the password either as an environment variable using `--passwordEnv`, or as a file using `--passwordFile`, or interactively, on the command line with `--password`. | |
5050
| `--version` | Installer version. | `12.2.1.3.0` |
5151

documentation/1.11/content/userguide/tools/update-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Update WebLogic Docker image with selected patches
4747
| `--skipcleanup` | Do not delete the build context folder, intermediate images, and failed build containers. For debugging purposes. | |
4848
| `--strictPatchOrdering` | Instruct OPatch to apply patches one at a time (uses `apply` instead of `napply`). | |
4949
| `--target` | Select the target environment in which the created image will be used. Supported values: `Default` (Docker/Kubernetes), `OpenShift`. See [Additional information](#--target). | `Default` |
50-
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `OSB`, `OUD_WLS`, `SOA_OSB`, `SOA_OSB_B2B`, `MFT`, `WCP`, `OAM`, `OIG`, `OUD`, `OID`, `SOA`, `WCC`, `WCS`, `WCP` | Installer used in `fromImage` |
50+
| `--type` | Installer type. Supported values: `WLS`, `WLSDEV`, `WLSSLIM`, `FMW`, `IDM`, `OSB`, `OUD_WLS`, `SOA_OSB`, `SOA_OSB_B2B`, `MFT`, `WCP`, `OAM`, `OIG`, `OUD`, `OID`, `ODI`, `SOA`, `WCC`, `WCS`, `WCP` | Installer used in `fromImage` |
5151
| `--user` | Oracle support email ID. When supplying `user`, you must supply the password either as an environment variable using `--passwordEnv`, or as a file using `--passwordFile`, or interactively, on the command line with `--password`. | |
5252
| `--wdtArchive` | A WDT archive ZIP file or comma-separated list of files. | |
5353
| `--wdtDomainHome` | Path to the `-domain_home` for WDT. | `/u01/domains/base_domain` |

imagetool/src/main/java/com/oracle/weblogic/imagetool/aru/AruProduct.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.aru;
@@ -28,7 +28,8 @@ public enum AruProduct {
2828
OPSS("16606", "Oracle Platform Security Service"),
2929
OWSM("12787", "Oracle Webservices Manager"),
3030
JDBC("9512", "Oracle JDBC for Fusion Middleware"),
31-
FIT("33256", "Fusion Internal Tools")
31+
FIT("33256", "Middleware Common Libraries and Tools"),
32+
ODI("13724", "Oracle Data Integrator")
3233
;
3334

3435
private final String productId;

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ public void copyOptionsFromImage() throws IOException, InterruptedException {
223223

224224
PackageManagerType pkgMgr = PackageManagerType.valueOf(pkgMgrProp);
225225
logger.fine("fromImage package manager {0}", pkgMgr);
226+
if (pkgMgr == PackageManagerType.MICRODNF && os.version() != null && os.version().startsWith("8")) {
227+
logger.fine("Using older style format for microdnf for linux 8. ver={0}", os.version());
228+
pkgMgr = PackageManagerType.MICRODNF_8;
229+
}
226230
if (packageManager != PackageManagerType.OS_DEFAULT && pkgMgr != packageManager) {
227231
// If the user is overriding the detected package manager, use the provided value
228232
logger.info("IMG-0079", pkgMgr, packageManager);

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/PackageManagerType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public enum PackageManagerType {
99
YUM,
1010
DNF,
1111
MICRODNF,
12+
MICRODNF_8,
1213
APTGET,
1314
APK,
1415
ZYPPER

imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/DefaultResponseFile.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2019, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.installer;
@@ -34,6 +34,7 @@ public class DefaultResponseFile implements ResponseFile {
3434
private static final String R_WCC = "WebCenter Content";
3535
private static final String R_WCP = "WebCenter Portal";
3636
private static final String R_WCS = "WebCenter Sites";
37+
private static final String R_ODI = "Oracle Data Integrator";
3738

3839
private final String installTypeResponse;
3940
private final String filename;
@@ -94,6 +95,9 @@ private static String getInstallTypeResponse(InstallerType installerType, FmwIns
9495
case WCS:
9596
response = R_WCS;
9697
break;
98+
case ODI:
99+
response = R_ODI;
100+
break;
97101
case WLS:
98102
default:
99103
response = R_WLS;

imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/FmwInstallerType.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2019, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.installer;
@@ -80,7 +80,9 @@ public enum FmwInstallerType {
8080
WCS(Utils.toSet(FMW.products, AruProduct.WCS),
8181
InstallerType.FMW, InstallerType.WCS),
8282
OHS(Collections.singleton(AruProduct.OHS),
83-
InstallerType.OHS)
83+
InstallerType.OHS),
84+
ODI(Collections.singleton(AruProduct.ODI),
85+
InstallerType.ODI)
8486
;
8587

8688
private final InstallerType[] installers;

imagetool/src/main/java/com/oracle/weblogic/imagetool/installer/InstallerType.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2019, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package com.oracle.weblogic.imagetool.installer;
@@ -26,7 +26,8 @@ public enum InstallerType {
2626
WCP("wcp"),
2727
WCS("wcs"),
2828
JDK("jdk"),
29-
WDT("wdt");
29+
WDT("wdt"),
30+
ODI("odi");
3031

3132
private final String value;
3233

0 commit comments

Comments
 (0)