Skip to content
Permalink
Browse files

Use git 2.9 for centos 6 docker images and git 2.18 for centos 7 dock…

…er images
  • Loading branch information
marques-work committed Sep 18, 2019
1 parent 7739d53 commit 4c54c9b5fcc0fe0f47f014b062d7644eac6b1b32
@@ -42,7 +42,7 @@ enum Distro implements DistroBehavior {
}

@Override
List<String> getInstallPrerequisitesCommands() {
List<String> getInstallPrerequisitesCommands(DistroVersion distroVersion) {
return [
'apk --no-cache upgrade',
// procps is needed for tanuki wrapper shell script
@@ -94,21 +94,24 @@ enum Distro implements DistroBehavior {

centos{
@Override
List<String> getInstallPrerequisitesCommands() {
List<String> getInstallPrerequisitesCommands(DistroVersion distroVersion) {
String git = "6" == distroVersion.version ? 'rh-git29' : 'rh-git218'

return [
'yum update -y',
"yum install --assumeyes centos-release-scl",
'yum install --assumeyes rh-git218 mercurial subversion openssh-clients bash unzip curl procps sysvinit-tools coreutils',
"cp /opt/rh/rh-git218/enable /etc/profile.d/rh-git218.sh",
"yum install --assumeyes ${git} mercurial subversion openssh-clients bash unzip curl procps sysvinit-tools coreutils",
"cp /opt/rh/${git}/enable /etc/profile.d/${git}.sh",
"yum clean all"
]
}

@Override
Map<String, String> getEnvironmentVariables() {
return super.getEnvironmentVariables() + [
BASH_ENV: '/opt/rh/rh-git218/enable',
ENV : '/opt/rh/rh-git218/enable'
Map<String, String> getEnvironmentVariables(DistroVersion distroVersion) {
String git = "6" == distroVersion.version ? 'rh-git29' : 'rh-git218'
return super.getEnvironmentVariables(distroVersion) + [
BASH_ENV: "/opt/rh/${git}/enable",
ENV : "/opt/rh/${git}/enable"
]
}

@@ -123,7 +126,7 @@ enum Distro implements DistroBehavior {

fedora{
@Override
List<String> getInstallPrerequisitesCommands() {
List<String> getInstallPrerequisitesCommands(DistroVersion distroVersion) {
return [
'yum update -y',
'yum install -y git mercurial subversion openssh-clients bash unzip curl procps-ng coreutils',
@@ -144,7 +147,7 @@ enum Distro implements DistroBehavior {

debian{
@Override
List<String> getInstallPrerequisitesCommands() {
List<String> getInstallPrerequisitesCommands(DistroVersion distroVersion) {
return [
'apt-get update',
'apt-get install -y git subversion mercurial openssh-client bash unzip curl locales procps sysvinit-utils coreutils',
@@ -166,8 +169,8 @@ enum Distro implements DistroBehavior {

ubuntu{
@Override
List<String> getInstallPrerequisitesCommands() {
return debian.getInstallPrerequisitesCommands()
List<String> getInstallPrerequisitesCommands(DistroVersion distroVersion) {
return debian.getInstallPrerequisitesCommands(distroVersion)
}

@Override
@@ -198,8 +201,8 @@ enum Distro implements DistroBehavior {
}

@Override
List<String> getInstallPrerequisitesCommands() {
return alpine.getInstallPrerequisitesCommands()
List<String> getInstallPrerequisitesCommands(DistroVersion distroVersion) {
return alpine.getInstallPrerequisitesCommands(distroVersion)
}


@@ -209,8 +212,8 @@ enum Distro implements DistroBehavior {
}

@Override
Map<String, String> getEnvironmentVariables() {
return alpine.getEnvironmentVariables()
Map<String, String> getEnvironmentVariables(DistroVersion distroVersion) {
return alpine.getEnvironmentVariables(distroVersion)
}
}

@@ -37,7 +37,7 @@ trait DistroBehavior {
]
}

List<String> getInstallPrerequisitesCommands() {
List<String> getInstallPrerequisitesCommands(DistroVersion distroVersion) {
throw new RuntimeException("Subclasses must implement!")
}

@@ -57,7 +57,7 @@ trait DistroBehavior {
]
}

Map<String, String> getEnvironmentVariables() {
Map<String, String> getEnvironmentVariables(DistroVersion distroVersion) {
return [GO_JAVA_HOME: '/gocd-jre']
}

@@ -51,7 +51,7 @@ ADD ${fileDescriptor.url} ${filePath}
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
<#list distro.environmentVariables as key, value>
<#list distro.environmentVariables(distroVersion) as key, value>
ENV ${key}="${value}"
</#list>

@@ -75,7 +75,7 @@ RUN \
<#list distroVersion.installPrerequisitesCommands as command>
${command} && \
</#list>
<#list distro.installPrerequisitesCommands as command>
<#list distro.installPrerequisitesCommands(distroVersion) as command>
${command} && \
</#list>
<#list distro.getInstallJavaCommands(project) as command>
@@ -51,7 +51,7 @@ ADD ${fileDescriptor.url} ${filePath}
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
<#list distro.environmentVariables as key, value>
<#list distro.environmentVariables(distroVersion) as key, value>
ENV ${key}="${value}"
</#list>

@@ -74,7 +74,7 @@ RUN \
<#list distroVersion.installPrerequisitesCommands as command>
${command} && \
</#list>
<#list distro.installPrerequisitesCommands as command>
<#list distro.installPrerequisitesCommands(distroVersion) as command>
${command} && \
</#list>
<#list distro.getInstallJavaCommands(project) as command>

0 comments on commit 4c54c9b

Please sign in to comment.
You can’t perform that action at this time.