-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #325 from tmobile/v1.8.1
Release v1.9 Former-commit-id: 2f4a896
- Loading branch information
Showing
48 changed files
with
907 additions
and
642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ node_modules | |
*/target/ | ||
.nyc_output/ | ||
npm-debug.log | ||
*/package-lock.json | ||
*/package-lock.json | ||
.terraform/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
if node['dockerizedJenkins'] == false | ||
#prerequisites | ||
apt_update 'update' #force-update apt cache on Debian-derivatives to avoid pkg fetch errors | ||
package 'git' | ||
include_recipe 'maven::default' | ||
include_recipe 'nodejs' | ||
include_recipe 'cloudcli' | ||
|
||
npm_package 'serverless' do | ||
version '1.26.1' | ||
end | ||
|
||
npm_package '@angular/cli' do | ||
version '1.7.3' | ||
end | ||
|
||
npm_package 'jshint' | ||
|
||
#plugin management | ||
execute 'concatJenkinsPlugins' do | ||
command "cat #{node['chef_root']}/jenkinsplugins/plugins0* > #{node['chef_root']}/plugins.tar" | ||
end | ||
|
||
execute 'extractJenkinsPlugins' do | ||
command "tar -xf #{node['chef_root']}/plugins.tar -C #{node['jenkins']['home']}/" | ||
end | ||
|
||
# Clean up the plugin tar from previous step, it is rather large | ||
file "#{node['chef_root']}/plugins.tar" do | ||
action :delete | ||
end | ||
|
||
service 'jenkins' do | ||
action :restart | ||
end | ||
|
||
# Wait a bit, Java apps don't coldboot very quickly... | ||
execute 'waitForFirstJenkinsRestart' do | ||
command 'sleep 30' | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Base Image and maintainer info | ||
FROM jenkins/jenkins:lts | ||
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 | ||
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.26.1 @angular/cli@1.7.3 jshint | ||
# 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 | ||
|
||
# Copy the chef recipes, chefconfigs and bootstrap script | ||
COPY --chown=jenkins:jenkins cookbooks /tmp/jazz-chef/cookbooks | ||
COPY --chown=jenkins:jenkins dockerfiles/jenkins-ce/chefInstaller.sh /tmp/jazz-chef/chefInstaller.sh | ||
|
||
RUN chown -R jenkins:jenkins /tmp/jazz-chef | ||
# Creating node_path directory | ||
RUN mkdir /var/jenkins_home/node | ||
|
||
# Setting execute bit and executing the bootstrap script | ||
RUN chmod 777 /tmp/jazz-chef/chefInstaller.sh | ||
RUN bash /tmp/jazz-chef/chefInstaller.sh | ||
|
||
# Switching back to Jenkins user for safety | ||
USER jenkins | ||
|
||
# Expose the jenkins port | ||
EXPOSE 8081 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# Installing chefclient | ||
curl -o chefdk.deb https://packages.chef.io/files/stable/chefdk/3.0.36/ubuntu/16.04/chefdk_3.0.36-1_amd64.deb | ||
dpkg -i chefdk.deb | ||
|
||
# Installing pip | ||
# curl -sL -O https://bootstrap.pypa.io/get-pip.py && python get-pip.py | ||
# chmod -R o+w /usr/lib/python2.7/* /usr/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#Spin wheel for visual effects | ||
spin_wheel() | ||
{ | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
NC='\033[0m' | ||
|
||
pid=$1 # Process Id of the previous running command | ||
message=$2 | ||
spin='-\|/' | ||
printf "\r$message...." | ||
i=0 | ||
|
||
while ps -p $pid > /dev/null | ||
do | ||
#echo $pid $i | ||
i=$(( (i+1) %4 )) | ||
printf "\r${GREEN}$message....${spin:$i:1}" | ||
sleep .05 | ||
done | ||
|
||
wait "$pid" | ||
exitcode=$? | ||
if [ $exitcode -gt 0 ] | ||
then | ||
printf "\r${RED}$message....Failed${NC}\n" | ||
exit | ||
else | ||
printf "\r${GREEN}$message....Completed${NC}\n" | ||
|
||
fi | ||
} | ||
|
||
|
||
cd ~/jazz-installer/installscripts | ||
sudo docker cp cookbooks/. jenkins-server:/tmp/jazz-chef/cookbooks/ | ||
sudo docker cp jenkinsplugins jenkins-server:/tmp/jazz-chef/ | ||
# Running chef-client to execute cookbooks | ||
sudo docker exec -u root -i jenkins-server bash -c "chef install /tmp/jazz-chef/cookbooks/Policyfile.rb && chef export /tmp/jazz-chef/cookbooks/Policyfile.rb /tmp/jazz-chef/chef-export && cd /tmp/jazz-chef/chef-export && sudo chef-client -z" | ||
|
||
# Once the docker image is configured, we will commit the image. | ||
sudo docker commit -m "JazzOSS-Custom Jenkins container" jenkins-server jazzoss-jenkins-server | ||
sudo docker restart jenkins-server | ||
# The image jazzoss-jenkins-server is now ready to be shipped to and/or spinned in any docker hosts like ECS cluster/fargate etc. | ||
sleep 20 & | ||
spin_wheel $! "Initializing the Jenkins container" |
Oops, something went wrong.