Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x <- Full revision of Jenkins Pipelines, to make them work again #807

Merged
merged 38 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1fbeb39
Modification to detect that java 17 is not installed.
May 17, 2022
ec3ce26
Update gradle-repositories.template
angelmp01 May 18, 2022
730affe
jdk 17 has no package for centos 7.
May 18, 2022
6ae9424
Removes jcenter repositories, deprecated.
May 18, 2022
123a923
Merge branch 'task/upgrade-atlassian-stack' of https://github.com/ope…
May 18, 2022
25e6fcf
Enable switch jdk version. In ubi image they might work.
May 19, 2022
091a13b
javac is not there always.
May 19, 2022
e9eae09
Fixes some problems with javac and jdk 17.
May 19, 2022
06c4602
Fixes checking java and javac versions.
May 19, 2022
7ecc78a
Improve error msgs in scripts that change jdk version to use.
May 19, 2022
d100049
changelog
May 19, 2022
95aef97
Solves bug use-j17 does not work in centos 7.
May 20, 2022
bd2e31f
epel problem with ca-certificates.
May 20, 2022
6a72dfc
Upgrade before installing epel.
May 20, 2022
9121ed6
typo
May 20, 2022
83725b7
Error searching for ubi rh packages.
May 20, 2022
1cb0ecb
Use --nobest to avoid problem downloading pkgs.
May 20, 2022
1492525
--skip-broken
May 20, 2022
b00b168
Removes problematic pkgs operations.
May 20, 2022
b7518a3
--nobest is not available for yum
May 20, 2022
21df775
java-11-openjdk-jmods is no more available.
May 20, 2022
d087b24
java-11-openjdk-jmods is no more available for ubi8.
May 20, 2022
ab7fe58
fixes use-j17 not working in ubi8: removes it
May 20, 2022
d17c128
Do not fail if epel repos is not available.
May 20, 2022
d9d16d1
Correct way to have epel repos in ubi8 img.
May 20, 2022
8d96180
Should fix install pkgs bison, readline-devel.
May 20, 2022
cfeee5a
yum-config-manager is not available in ubi8
May 23, 2022
95a52fc
Allow jenkins agent to add new certificates.
May 25, 2022
9b2a043
Should recover jdk 17 capability.
May 30, 2022
0e74019
fixes typos found during revision.
May 30, 2022
857f754
gpg keys needed for centos repos.
May 30, 2022
d829bcc
git checkout feature/ods-devenv -- be-java-springboot/Jenkinsfile com…
May 31, 2022
4e78815
Scripts use-j@@ need to be run by user root.
May 31, 2022
4a0b2eb
Fixes JAVA_HOME environment variable value.
Jun 1, 2022
03b1dc2
changelog.
Jun 1, 2022
50f259f
changelog
Jun 2, 2022
54dc51f
Some dependencies are no more available in rh repos.
Jun 2, 2022
4e40fc5
Forgot to remove workaround.
Jun 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion be-java-springboot/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ odsQuickstarterPipeline(
-d dependencies='web,data-rest,restdocs,data-jpa,h2,security,devtools' \
-d bootVersion=${springBootVersion} \
-d packaging=jar \
-d javaVersion=17 \
-d javaVersion=11 \
-d groupId=${context.projectId} \
-d artifactId=${context.componentId} \
-d name=${context.componentId} \
Expand Down
2 changes: 0 additions & 2 deletions be-java-springboot/templates/gradle-repositories.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
url repoUrl
}
}
nexusMaven("${nexus_url}/repository/jcenter/")
nexusMaven("${nexus_url}/repository/maven-public/")
nexusMaven("${nexus_url}/repository/atlassian_public/")
} else {
mavenCentral()
jcenter()
}
5 changes: 4 additions & 1 deletion common/jenkins-agents/maven/docker/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ ENV JAVA_TOOL_OPTIONS="-XX:+UnlockExperimentalVMOptions -Dsun.zip.disableMemoryM
# Copy use java scripts.
COPY use-j*.sh /home/jenkins/

RUN cat /etc/yum.repos.d/* && \
sed -i 's@http://cbs.centos.org/@https://cbs.centos.org/@g' /etc/yum.repos.d/*

# Install Maven & java 11 and java 17
# Note: use java scripts are executed to test the scripts but also use-j11.sh in called 2nd place to set is as default version
RUN yum install -y epel-release && yum repolist && yum install -y java-17-openjdk-devel java-17-openjdk-jmods java-11-openjdk-devel java-11-openjdk-jmods && \
sh -c "yum list installed | grep -i '\(java\|jdk\)'" \
yum clean all -y && rm -rf /var/cache/yum && \
chmod ug+x /home/jenkins/use-j17.sh && \
chmod ug+x /home/jenkins/use-j11.sh && \
/home/jenkins/use-j17.sh && \
/home/jenkins/use-j11.sh && \
echo $JAVA_HOME

Expand Down
4 changes: 4 additions & 0 deletions common/jenkins-agents/maven/docker/use-j11.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash

echo "Switching to java 11:"
exactVersion=$(ls -lah /usr/lib/jvm | grep "java-11-openjdk-11.*\.x86_64" | awk '{print $NF}' | head -1) && \
alternatives --set java /usr/lib/jvm/${exactVersion}/bin/java && \
alternatives --set javac /usr/lib/jvm/${exactVersion}/bin/javac && \
java -version
javac -version

echo "JAVA_HOME: $JAVA_HOME"
17 changes: 12 additions & 5 deletions common/jenkins-agents/maven/docker/use-j17.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash

echo "JDK 17 does not work in centos 7. Sorry!!"
exit 0

echo "Switching to java 17:"
exactVersion=$(ls -lah /usr/lib/jvm | grep "java-17-openjdk-17.*\.x86_64" | awk '{print $NF}' | head -1) && \
alternatives --set java /usr/lib/jvm/${exactVersion}/bin/java && \
alternatives --set javac /usr/lib/jvm/${exactVersion}/bin/javac && \
java -version
javac -version
exactVersion=$(ls -lah /usr/lib/jvm | grep "java-17-openjdk-17.*\.x86_64" | awk '{print $NF}' | head -1)
alternatives --set java /usr/lib/jvm/${exactVersion}/bin/java || exit 1
alternatives --set javac /usr/lib/jvm/${exactVersion}/bin/javac || exit 1
java -version | grep -q 17 || exit 1
javac -version | grep -q 17 || exit 1

echo "JAVA_HOME: $JAVA_HOME"
11 changes: 1 addition & 10 deletions e2e-spock-geb/files/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,10 @@ plugins {

repositories {
if (no_nexus) {
println("using repositories 'jcenter' and 'mavenCentral', because property no_nexus=$no_nexus")
jcenter()
println("using repository 'mavenCentral', because property no_nexus=$no_nexus")
mavenCentral()
} else {
println("using nexus repositories")
maven() {
url "${nexus_url}/repository/jcenter/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}

maven() {
url "${nexus_url}/repository/maven-public/"
credentials {
Expand Down