From f213f5d01f24343bce01dd7074cb836604964e79 Mon Sep 17 00:00:00 2001 From: johnbush Date: Wed, 5 Dec 2018 14:55:43 +0530 Subject: [PATCH 1/6] adding python3 & set alias --- installscripts/dockerfiles/jenkins-ce/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/installscripts/dockerfiles/jenkins-ce/Dockerfile b/installscripts/dockerfiles/jenkins-ce/Dockerfile index 117c933c..5d368967 100644 --- a/installscripts/dockerfiles/jenkins-ce/Dockerfile +++ b/installscripts/dockerfiles/jenkins-ce/Dockerfile @@ -5,9 +5,13 @@ MAINTAINER JazzOSS Team # Switching to root to configure the image with system packages USER root RUN apt-get update && apt-get install -y vim curl sudo libtool autoconf make unzip rsync gcc autogen shtool pkg-config lsb-release python python-dev python-pip python-setuptools groff less && \ -curl https://bootstrap.pypa.io/get-pip.py | python && pip install --upgrade awscli && apt-get clean && pip install virtualenv && /usr/bin/easy_install virtualenv +python3.6 python3-pip build-essential libssl-dev libffi-dev python3-dev && curl https://bootstrap.pypa.io/get-pip.py | python && curl https://bootstrap.pypa.io/get-pip.py | python3 && pip install --upgrade awscli && \ +pip3 install --upgrade awscli apt-get clean && pip install virtualenv && pip3 install virtualenv && /usr/bin/easy_install virtualenv RUN wget -O /opt/apache-maven-3.5.2-bin.tar.gz https://archive.apache.org/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz && tar xzvf /opt/apache-maven-3.5.2-bin.tar.gz -C /opt && export PATH=$PATH:/opt/apache-maven-3.5.2/bin >> /etc/profile.d/maven.sh && ln -sf /opt/apache-maven-3.5.2/bin/mvn /usr/bin/mvn RUN curl -sL https://deb.nodesource.com/setup_8.x | bash && apt-get install -y nodejs && npm install -global serverless@1.30.0 @angular/cli@1.7.3 jshint +#Setting alias for python2 and python3 +RUN alias python=/usr/bin/python +RUN alias python3=/usr/bin/python3 # Copying plugins list. Downlading and installing plugins from Jenkins PluginsManager COPY dockerfiles/jenkins-ce/plugins.txt /usr/share/jenkins/ref/plugins.txt RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt From 708e824a2d33b412394fefe9ae05284aee69d577 Mon Sep 17 00:00:00 2001 From: johnbush Date: Wed, 5 Dec 2018 17:02:05 +0530 Subject: [PATCH 2/6] purge unwanted --- installscripts/dockerfiles/jenkins-ce/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installscripts/dockerfiles/jenkins-ce/Dockerfile b/installscripts/dockerfiles/jenkins-ce/Dockerfile index 5d368967..fa36b7a7 100644 --- a/installscripts/dockerfiles/jenkins-ce/Dockerfile +++ b/installscripts/dockerfiles/jenkins-ce/Dockerfile @@ -6,7 +6,7 @@ MAINTAINER JazzOSS Team USER root RUN apt-get update && apt-get install -y vim curl sudo libtool autoconf make unzip rsync gcc autogen shtool pkg-config lsb-release python python-dev python-pip python-setuptools groff less && \ python3.6 python3-pip build-essential libssl-dev libffi-dev python3-dev && curl https://bootstrap.pypa.io/get-pip.py | python && curl https://bootstrap.pypa.io/get-pip.py | python3 && pip install --upgrade awscli && \ -pip3 install --upgrade awscli apt-get clean && pip install virtualenv && pip3 install virtualenv && /usr/bin/easy_install virtualenv +apt-get clean && pip install virtualenv && /usr/bin/easy_install virtualenv RUN wget -O /opt/apache-maven-3.5.2-bin.tar.gz https://archive.apache.org/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz && tar xzvf /opt/apache-maven-3.5.2-bin.tar.gz -C /opt && export PATH=$PATH:/opt/apache-maven-3.5.2/bin >> /etc/profile.d/maven.sh && ln -sf /opt/apache-maven-3.5.2/bin/mvn /usr/bin/mvn RUN curl -sL https://deb.nodesource.com/setup_8.x | bash && apt-get install -y nodejs && npm install -global serverless@1.30.0 @angular/cli@1.7.3 jshint #Setting alias for python2 and python3 From ed92f6609140a7dc8e0de7f6c4858f8af5ad5dea Mon Sep 17 00:00:00 2001 From: Rajeev Date: Thu, 13 Dec 2018 12:25:00 +0530 Subject: [PATCH 3/6] followup to remove jenkinsplugins --- installscripts/cookbooks/jenkins/attributes/default.rb | 1 + .../cookbooks/jenkins/recipes/configurejenkins.rb | 2 +- installscripts/cookbooks/jenkins/recipes/setupjenkins.rb | 2 +- .../jazz-terraform-unix-noinstances/chefProvisioner.tf | 6 +----- installscripts/jazz-terraform-unix-noinstances/variables.tf | 5 +---- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/installscripts/cookbooks/jenkins/attributes/default.rb b/installscripts/cookbooks/jenkins/attributes/default.rb index bba991fa..7f8ed677 100644 --- a/installscripts/cookbooks/jenkins/attributes/default.rb +++ b/installscripts/cookbooks/jenkins/attributes/default.rb @@ -13,6 +13,7 @@ default['scmpath'] = "#{node['scmelb']}/scm" default['region'] = 'us-east-1' default['git_branch'] = 'master' +default['git_plugin_branch'] = 'master' default['git_repo'] = 'https://github.com/tmobile/jazz.git' default['git_content_repo'] = 'https://github.com/tmobile/jazz-content/raw' default['git_content_plugins'] = 'jenkins/staticplugins/plugins.tar' diff --git a/installscripts/cookbooks/jenkins/recipes/configurejenkins.rb b/installscripts/cookbooks/jenkins/recipes/configurejenkins.rb index 83ba9ba1..4fe7f0e3 100644 --- a/installscripts/cookbooks/jenkins/recipes/configurejenkins.rb +++ b/installscripts/cookbooks/jenkins/recipes/configurejenkins.rb @@ -44,7 +44,7 @@ # Fetch the xmls.tar from our content repo execute 'copyXmlsTar' do - command "curl -sL #{node['git_content_repo']}/#{node['git_branch']}/#{node['git_content_xmls']} -o #{node['chef_root']}/xmls.tar; chmod 755 #{node['chef_root']}/xmls.tar" + command "curl -sL #{node['git_content_repo']}/#{node['git_plugin_branch']}/#{node['git_content_xmls']} -o #{node['chef_root']}/xmls.tar; chmod 755 #{node['chef_root']}/xmls.tar" end #ToDo ChefRemoval diff --git a/installscripts/cookbooks/jenkins/recipes/setupjenkins.rb b/installscripts/cookbooks/jenkins/recipes/setupjenkins.rb index 78830ea1..3e70931c 100644 --- a/installscripts/cookbooks/jenkins/recipes/setupjenkins.rb +++ b/installscripts/cookbooks/jenkins/recipes/setupjenkins.rb @@ -19,7 +19,7 @@ # plugin management # Fetch the plugins.tar from our content repo TODO replace this with a dynamic plugin install like the dockerized version execute 'copyPluginsTar' do - command "curl -sL #{node['git_content_repo']}/#{node['git_branch']}/#{node['git_content_repo']} -o #{node['chef_root']}/plugins.tar; chmod 755 #{node['chef_root']}/plugins.tar" + command "curl -sL #{node['git_content_repo']}/#{node['git_plugin_branch']}/#{node['git_content_plugins']} -o #{node['chef_root']}/plugins.tar; chmod 755 #{node['chef_root']}/plugins.tar" end execute 'extractJenkinsPlugins' do diff --git a/installscripts/jazz-terraform-unix-noinstances/chefProvisioner.tf b/installscripts/jazz-terraform-unix-noinstances/chefProvisioner.tf index 51042552..bf195010 100644 --- a/installscripts/jazz-terraform-unix-noinstances/chefProvisioner.tf +++ b/installscripts/jazz-terraform-unix-noinstances/chefProvisioner.tf @@ -80,11 +80,7 @@ resource "null_resource" "configureJenkinsInstance" { inline = "mkdir -p ${var.chefDestDir}" } - #Copy the chef playbooks and jenkins binary plugin blobs over to the remote Jenkins server - provisioner "file" { - source = "${var.jenkinsPluginsSourceDir}" - destination = "${var.chefDestDir}/" - } + #Copy the chef playbooks over to the remote Jenkins server provisioner "file" { source = "${var.cookbooksSourceDir}" diff --git a/installscripts/jazz-terraform-unix-noinstances/variables.tf b/installscripts/jazz-terraform-unix-noinstances/variables.tf index 980740d2..f2b36cfb 100755 --- a/installscripts/jazz-terraform-unix-noinstances/variables.tf +++ b/installscripts/jazz-terraform-unix-noinstances/variables.tf @@ -19,10 +19,7 @@ variable "cognito_pool_password" {type = "string" default = "cognito_pool_passwo # Copying these resources to TMP on remote machines, # since $HOME is not reliable for all of our scenarios. # -variable "jenkinsPluginsSourceDir" { - type = "string" - default = "../jenkinsplugins" -} + variable "cookbooksSourceDir" { type = "string" default = "../cookbooks" From 5abc7def343c3cb42ec3ae43b911b56adb03f4ed Mon Sep 17 00:00:00 2001 From: Johnbush Date: Tue, 1 Jan 2019 16:08:44 +0530 Subject: [PATCH 4/6] py3 on existing Jenkins --- installscripts/cookbooks/Policyfile.rb | 2 +- .../jenkins/recipes/installpython3.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 installscripts/cookbooks/jenkins/recipes/installpython3.rb diff --git a/installscripts/cookbooks/Policyfile.rb b/installscripts/cookbooks/Policyfile.rb index 78b0f9ba..fe21d053 100644 --- a/installscripts/cookbooks/Policyfile.rb +++ b/installscripts/cookbooks/Policyfile.rb @@ -4,4 +4,4 @@ cookbook 'nodejs', '~> 5.0.0' cookbook 'cloudcli', '~> 1.2.0' cookbook 'jenkins', path: './jenkins' -run_list 'jenkins::setupjenkins', 'jenkins::sonarqube-scanner', 'jenkins::configurejenkins', 'jenkins::installgolang' +run_list 'jenkins::setupjenkins', 'jenkins::sonarqube-scanner', 'jenkins::configurejenkins', 'jenkins::installgolang', 'jenkins::installpython3' diff --git a/installscripts/cookbooks/jenkins/recipes/installpython3.rb b/installscripts/cookbooks/jenkins/recipes/installpython3.rb new file mode 100644 index 00000000..f1ea4340 --- /dev/null +++ b/installscripts/cookbooks/jenkins/recipes/installpython3.rb @@ -0,0 +1,19 @@ +if node['dockerizedJenkins'] == false + # Install python3 runtime + bash 'install-python3' do + code <<-EOH + yum install -y https://centos7.iuscommunity.org/ius-release.rpm + yum update + yum install -y python36u python36u-libs python36u-devel python36u-pip + EOH + end + + #link python3 + link '/usr/bin/python3' do + to '/usr/bin/python3.6' + end + # link pip3 + link '/usr/bin/pip3' do + to '/usr/bin/pip3.6' + end +end \ No newline at end of file From c9dd88c7dbcbbe9e96f17f6d1fdf928dc211ea74 Mon Sep 17 00:00:00 2001 From: Rajeev Date: Tue, 8 Jan 2019 00:28:01 +0530 Subject: [PATCH 5/6] Fixed typo --- installscripts/dockerfiles/jenkins-ce/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/installscripts/dockerfiles/jenkins-ce/Dockerfile b/installscripts/dockerfiles/jenkins-ce/Dockerfile index da145cd0..968bbf3e 100644 --- a/installscripts/dockerfiles/jenkins-ce/Dockerfile +++ b/installscripts/dockerfiles/jenkins-ce/Dockerfile @@ -5,20 +5,20 @@ MAINTAINER JazzOSS Team ARG goVersion=1.10.3 # Switching to root to configure the image with system packages USER root -RUN apt-get update && apt-get install -y vim curl sudo libtool autoconf make unzip rsync gcc autogen shtool pkg-config lsb-release python python-dev python-pip python-setuptools groff less && \ -python3.6 python3-pip build-essential libssl-dev libffi-dev python3-dev && curl https://bootstrap.pypa.io/get-pip.py | python && curl https://bootstrap.pypa.io/get-pip.py | python3 && pip install --upgrade awscli && \ +RUN apt-get update && apt-get install -y vim curl sudo libtool autoconf make unzip rsync gcc autogen shtool pkg-config lsb-release python python-dev python-pip python-setuptools groff less \ +python3.5 python3-dev python3-pip build-essential libssl-dev libffi-dev && curl https://bootstrap.pypa.io/get-pip.py | python && curl https://bootstrap.pypa.io/get-pip.py | python3 && pip install --upgrade awscli && \ apt-get clean && pip install virtualenv && /usr/bin/easy_install virtualenv RUN wget -O /opt/apache-maven-3.5.2-bin.tar.gz https://archive.apache.org/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz && tar xzvf /opt/apache-maven-3.5.2-bin.tar.gz -C /opt && export PATH=$PATH:/opt/apache-maven-3.5.2/bin >> /etc/profile.d/maven.sh && ln -sf /opt/apache-maven-3.5.2/bin/mvn /usr/bin/mvn RUN curl -sL https://deb.nodesource.com/setup_8.x | bash && apt-get install -y nodejs && npm install -global serverless@1.30.0 @angular/cli@1.7.3 jshint # Setting alias for python2 and python3 RUN alias python=/usr/bin/python RUN alias python3=/usr/bin/python3 -# Install scripts for golang +# Install scripts for golang RUN curl -O https://storage.googleapis.com/golang/go${goVersion}.linux-amd64.tar.gz && tar -xvf go${goVersion}.linux-amd64.tar.gz && mv go /usr/local -ENV GOROOT /usr/local/go -ENV GOBIN /usr/local/go/bin -ENV GOPATH /usr/local/go/src -ENV PATH $GOROOT:$GOBIN:$GOPATH:$PATH +ENV GOROOT /usr/local/go +ENV GOBIN /usr/local/go/bin +ENV GOPATH /usr/local/go/src +ENV PATH $GOROOT:$GOBIN:$GOPATH:$PATH RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh # Copying plugins list. Downlading and installing plugins from Jenkins PluginsManager From 48cc6ab567e7bb0d4da60ab0122a522d41e1ed45 Mon Sep 17 00:00:00 2001 From: Rajeev Date: Tue, 8 Jan 2019 23:46:51 +0530 Subject: [PATCH 6/6] Updated python3.6 support --- installscripts/dockerfiles/jenkins-ce/Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/installscripts/dockerfiles/jenkins-ce/Dockerfile b/installscripts/dockerfiles/jenkins-ce/Dockerfile index 968bbf3e..c3da809f 100644 --- a/installscripts/dockerfiles/jenkins-ce/Dockerfile +++ b/installscripts/dockerfiles/jenkins-ce/Dockerfile @@ -5,14 +5,12 @@ MAINTAINER JazzOSS Team ARG goVersion=1.10.3 # Switching to root to configure the image with system packages USER root -RUN apt-get update && apt-get install -y vim curl sudo libtool autoconf make unzip rsync gcc autogen shtool pkg-config lsb-release python python-dev python-pip python-setuptools groff less \ -python3.5 python3-dev python3-pip build-essential libssl-dev libffi-dev && curl https://bootstrap.pypa.io/get-pip.py | python && curl https://bootstrap.pypa.io/get-pip.py | python3 && pip install --upgrade awscli && \ -apt-get clean && pip install virtualenv && /usr/bin/easy_install virtualenv +RUN echo "deb http://ftp.fr.debian.org/debian testing main" >> /etc/apt/sources.list && apt-get update && apt-get install -y vim curl sudo libtool autoconf make unzip rsync gcc autogen shtool pkg-config lsb-release python python-dev python-pip python-setuptools groff less \ +python3.6 python3-dev python3-pip python3.6-venv build-essential libssl-dev libffi-dev python-virtualenv && ln -sf /usr/bin/python2.7 /usr/bin/python && ln -sf /usr/bin/python3.6 /usr/bin/python3 && \ +curl https://bootstrap.pypa.io/get-pip.py | python && curl https://bootstrap.pypa.io/get-pip.py | python3 && pip install --upgrade awscli && apt-get clean RUN wget -O /opt/apache-maven-3.5.2-bin.tar.gz https://archive.apache.org/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz && tar xzvf /opt/apache-maven-3.5.2-bin.tar.gz -C /opt && export PATH=$PATH:/opt/apache-maven-3.5.2/bin >> /etc/profile.d/maven.sh && ln -sf /opt/apache-maven-3.5.2/bin/mvn /usr/bin/mvn RUN curl -sL https://deb.nodesource.com/setup_8.x | bash && apt-get install -y nodejs && npm install -global serverless@1.30.0 @angular/cli@1.7.3 jshint -# Setting alias for python2 and python3 -RUN alias python=/usr/bin/python -RUN alias python3=/usr/bin/python3 + # Install scripts for golang RUN curl -O https://storage.googleapis.com/golang/go${goVersion}.linux-amd64.tar.gz && tar -xvf go${goVersion}.linux-amd64.tar.gz && mv go /usr/local ENV GOROOT /usr/local/go