Skip to content

Commit

Permalink
added Python to the PipelineDemo, using the discover-flask-vagrant pr…
Browse files Browse the repository at this point in the history
…oject
  • Loading branch information
apolloclark committed Jun 3, 2016
1 parent 83cf0df commit 9e6c525
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 12 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pull down and use whatever the latest Jenkins Stable build is.
git clone https://github.com/apolloclark/vagrant-jenkins-pipeline
cd vagrant-jenkins-pipeline
vagrant up
# open a browser: http://127.0.0.1:8080/
# open a browser: http://127.0.0.1:8080/job/PipelineDemo/
```

## Run on Amazon
Expand All @@ -19,7 +19,7 @@ cd vagrant-jenkins-pipeline
cp aws-config-example.yml aws-config.yml
# update aws-config.yml with AWS credentials
vagrant up --provider=aws
# open a browser: http://127.0.0.1:8080/
# open a browser: http://<ec2_ip_addr>:8080/
```

## Jenkins Logs
Expand All @@ -37,3 +37,16 @@ Build projects.
## Links

https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin
https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow
https://documentation.cloudbees.com/docs/cookbook/pipeline-as-code.html
http://udaypal.com/jenkins-workflow-getting-started/
https://www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins

https://github.com/jenkinsci/pipeline-examples/tree/master/pipeline-examples
https://github.com/jenkinsci/workflow-aggregator-plugin/blob/master/demo/plugins.txt
https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md

https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

http://www.slideshare.net/cloudbees/pimp-your-continuous-delivery-pipeline-with-jenkins-workflow-wjax-14/20

9 changes: 7 additions & 2 deletions data/jenkins_plugins.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
ace-editor:1.0.1
branch-api:1.1
cloudbees-folder:5.8
credentials:1.25
durable-task:1.5
git-client:1.11.0
git:2.4.1
git-client:1.19.6
git-server:1.5
handlebars:1.1.1
jquery-detached:1.2.1
mailer:1.13
junit:1.2
mailer:1.16
matrix-project:1.6
momentjs:1.1
pipeline-build-step:2.0
pipeline-input-step:2.0
Expand All @@ -15,6 +19,7 @@ pipeline-stage-step:2.0
pipeline-stage-view:1.3
scm-api:1.1
script-security:1.16
ssh-credentials:1.11
structs:1.1
workflow-aggregator:2.1
workflow-api:2.0
Expand Down
1 change: 0 additions & 1 deletion data/jenkins_plugins_python.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
cobertura:1.9.8
git:2.4.4
github:1.19.1
github-api:1.75
matrix-project:1.7
performance:1.13
Expand Down
53 changes: 49 additions & 4 deletions data/jobs/PipelineDemo/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,55 @@
<properties/>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]">
<script>node {
stage &apos;Stage 1&apos;
echo &apos;Hello World 1&apos;
stage &apos;Stage 2&apos;
echo &apos;Hello World 2&apos;
stage &apos;Git Pull&apos;
checkout([
$class: &apos;GitSCM&apos;,
branches: [[name: &apos;*/master&apos;]],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[url: &apos;https://github.com/apolloclark/discover-flask-vagrant.git&apos;]]
])

stage &apos;Prepare Database&apos;
dir(&apos;./www&apos;) {
sh &apos;&apos;&apos;
python db_create_users.py
python db_create_posts.py
&apos;&apos;&apos;
}

stage &apos;Static Analysis&apos;
dir(&apos;./www&apos;) {
sh &apos;pylint --generate-rcfile &gt; .pylintrc&apos;
parallel pylint: {
sh &apos;pylint -f parseable project/ 2&gt;&amp;1 | cat &gt; pylint.out&apos;
}, nose:{
sh &apos;nosetests --with-xcoverage --with-xunit --all-modules --traverse-namespace --cover-package=project --cover-inclusive --cover-erase -x tests.py &gt; /dev/null&apos;
},
failFast: true
}

stage &apos;Deploy Servers&apos;
echo &apos;Deploying Testing Insfrastructure with Terrform and Ansible&apos;

stage &apos;Dynamic Analysis&apos;
echo &apos;Running Selenium tests&apos;
echo &apos;Running JMeter stress tests&apos;
echo &apos;Running Gauntlt security tests&apos;

stage &apos;Security Scan&apos;
echo &apos;Analysing UR cyberz!!!&apos;

stage &apos;Tear-down Servers&apos;
echo &apos;Removing Testing Infrastructure&apos;

stage &apos;Generate Reports&apos;
echo &apos;Generating Report Graphs and Charts&apos;
build(&apos;Python_Pipeline&apos;)

stage &apos;Have a Cocktail :)&apos;
echo &apos;Good on you! Have a cocktail. :)&apos;
}</script>
<sandbox>false</sandbox>
</definition>
Expand Down
2 changes: 1 addition & 1 deletion provision/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ wget -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | \
apt-key add -
sh -c 'echo "deb http://pkg.jenkins-ci.org/debian-stable binary/" > /etc/apt/sources.list.d/jenkins.list'
apt-get -y update
apt-get install -y openjdk-7-jre-headless daemon jenkins
apt-get install -y openjdk-7-jre-headless daemon git-core jenkins

# hackish way to install a specific version of Jenkins
# dpkg --install /vagrant/jenkins_1.642_all.deb
Expand Down
4 changes: 2 additions & 2 deletions provision/bootstrap_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pip install --upgrade pip > /dev/null 2>&1
# Install code quality tools
pip install -qqq pylint > /dev/null
pip install --quiet mock coverage nose nosexcover clonedigger ndg-httpsclient \
pyasn1
pyasn1 2>&1

# Install Flask requirements
pip install -qq -r /vagrant/jobs/Python_Pipeline/requirements.txt
pip install -qq -r /vagrant/jobs/Python_Pipeline/requirements.txt 2>&1
echo "INFO: Done installing Python."

# create folder for SQLite DB
Expand Down

0 comments on commit 9e6c525

Please sign in to comment.