forked from Praqma/memory-map-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New features: Added support for GCC 4.8.2/4.3.2 Improvements: Developed test tools to make the writing of tests easier Improved and expanded upon existing tests through the use of mentioned test tools Tests using the mentioned test tools now run on slaves Made plugin configuration more flexible, e.g. allowing multiple parsers Improved the README, including some developer oriented documentation Minor formatting and refactoring in various classes
- Loading branch information
thi
committed
Jul 7, 2015
1 parent
9fde3f2
commit 9742d92
Showing
62 changed files
with
7,534 additions
and
1,240 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 |
---|---|---|
@@ -1,9 +1,35 @@ | ||
memory-map-plugin | ||
Memory Map plugin | ||
================= | ||
This readme file mostly contains developer oriented documentation. | ||
For user oriented documentation, please see the [plugin's Jenkins wiki page](https://wiki.jenkins-ci.org/display/JENKINS/Memory+Map+Plugin) | ||
|
||
A repository for the memory-map-plugin | ||
##Introduction | ||
The Memory Map plugin provides assistance for monitoring the memory map created by a linker. It is especially useful when development is being conducted in conditions where memory is limited, e.g. when developing for an embedded system. | ||
It allows for displaying memory map values throughout builds in a graph, making it easier to follow up on memory usage. | ||
|
||
- Invalid builds are not considered when drawing a graph, so builds with configuration errors will not be included | ||
- Max value markers are drawn on project basis, and are not stored as part of build info | ||
- The plugin needs 2 files available to function, the first one is the linker command file, the second one is the actual .map file. The linker command file takes precedence | ||
- The plugin reports values in either kb or kWords. Word size is configurable. | ||
##References | ||
###Plugin repositories | ||
* [Jenkins CI's repository on GitHub](https://github.com/jenkinsci/memory-map-plugin) | ||
* [Praqma's repository on GitHub](https://github.com/Praqma/memory-map-plugin) | ||
|
||
###Automated builds | ||
* [Praqma's Memory Map plugin build view](http://code.praqma.net/ci/view/Open%20Source/view/Memory%20Map%20Plugin/) | ||
* [Maven project Memory Map Plugin](https://jenkins.ci.cloudbees.com/job/plugins/job/memory-map-plugin/) | ||
|
||
###Roadmap | ||
* [Memory Map plugin's Trello board](https://trello.com/b/eOsTMooO/memory-map-plugin-for-jenkins-ci) | ||
|
||
###Wiki and issue tracker | ||
User oriented documentation can be found on the wiki: | ||
* [Memory Map plugin's Jenkins wiki page](https://wiki.jenkins-ci.org/display/JENKINS/Memory+Map+Plugin) | ||
|
||
Issues are tracked using the Jenkins JIRA issue tracker: | ||
* [Memory Map on JIRA](https://issues.jenkins-ci.org/browse/JENKINS-29122?jql=project%20%3D%20JENKINS%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20component%20%3D%20%27memory-map-plugin%27) | ||
|
||
##Contributing | ||
|
||
We happily accept pull requests on [Praqma's Memory Map GitHub repository](https://github.com/Praqma/memory-map-plugin), where we also release from. **Do not make pull requests on the [Jenkins CI GitHub Repository](https://github.com/jenkinsci/pretested-integration-plugin)** - it is only used as final archive for released versions. | ||
|
||
* Please reference a JIRA issue in your pull request. | ||
* Please either include tests for your code changes or make sure your changes are covered by existing tests. | ||
* Unless you are contributing a simple bugfix or feature implementation, please consult the [Memory Map plugin's Trello board](https://trello.com/b/eOsTMooO/memory-map-plugin-for-jenkins-ci) to discuss implementation ideas. |
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,111 @@ | ||
#!/usr/bin/env ruby | ||
# encoding: utf-8 | ||
require 'open3' | ||
require 'docopt' | ||
require "pp" | ||
require 'fileutils' | ||
require 'rubygems' | ||
require 'nokogiri' | ||
require 'open-uri' | ||
|
||
|
||
doc = <<DOCOPT | ||
Check there is a changelog entry on URL that matches the current project version in the pom (if removing snapshot). | ||
pom.xml | ||
... | ||
<version>2.2.3-SNAPSHOT</version> | ||
... | ||
then there must be a changelog entry on URL (could be https://wiki.jenkins-ci.org/display/JENKINS/Pretested+Integration+Plugin): | ||
... | ||
h5. Version 2.2.3 | ||
... | ||
Script could of course be improved to to take regexp to look for etc. | ||
Usage: | ||
#{__FILE__} URL | ||
#{__FILE__} -h | ||
example: | ||
./check_for_changelog.rb https://wiki.jenkins-ci.org/display/JENKINS/Pretested+Integration+Plugin | ||
Arguments: | ||
URL URL to look for changelog entry "h5. Version %VERSION", where %VERSION matches version in pom xml | ||
Options: | ||
-h --help show this help message and exit | ||
DOCOPT | ||
|
||
|
||
if __FILE__ == $0 | ||
begin | ||
params = Docopt::docopt(doc) | ||
pp params | ||
|
||
version = "none" | ||
result = false | ||
found = false | ||
filename="pom.xml" | ||
max_lines_to_check = 30 # only check first 30 lines, and the project version is there | ||
File.open(filename, "r").each_line do |line| | ||
if (max_lines_to_check < 0) then | ||
break | ||
end | ||
if mymatch = line.match('<version>([0-9]+\.[0-9]+\.[0-9]+)-SNAPSHOT</version>') then | ||
# matchdata returned: | ||
#pp mymatch[0] # matches the hole line | ||
#pp mymatch[1] # matches the grouping around the version number | ||
if mymatch[1].match(/[0-9]+\.[0-9]+\.[0-9]+/) then ## extra check | ||
# This how the plugin need the environment variables | ||
found = true | ||
version = mymatch[1] | ||
pp "Found version number in pom to be: #{ version }" | ||
break | ||
end | ||
#pp line | ||
max_lines_to_check = max_lines_to_check - 1 | ||
end | ||
end | ||
|
||
|
||
|
||
|
||
# https://blog.engineyard.com/2010/getting-started-with-nokogiri | ||
page = Nokogiri::HTML(open(params["URL"])) | ||
# Find all "a" tags with a parent tag whose name is "h5" | ||
# as we know h3 is the version number headers in the changelog | ||
# <h5><a name="PretestedIntegrationPlugin-Version2.2.3"></a>Version 2.2.3</h5> | ||
|
||
page.xpath('//h5/a').each do |node| | ||
# nodes look like this: | ||
# #(Element:0x10970bc { | ||
# name = "a", | ||
# attributes = [ | ||
# #(Attr:0x1096d4c { | ||
# name = "name", | ||
# value = "PretestedIntegrationPlugin-Version2.2.3" | ||
# })] | ||
# }) | ||
|
||
# node["name"] will look like: PretestedIntegrationPlugin-Version2.2.3 | ||
if mymatch = /PretestedIntegrationPlugin-Version([\d|\.]+.*)/.match(node["name"]) then | ||
if mymatch[1] == version then | ||
pp "Found match with version and changelog entry on web page - great job!" | ||
result = true | ||
end | ||
end | ||
end | ||
|
||
if not result then | ||
abort("Could find any changelog entry on the url - please create a changelog") | ||
end | ||
|
||
rescue Docopt::Exit => e | ||
puts "ERROR - #{ __FILE__ } - wrong usage.\n" << e.message | ||
abort() # needed for non zero exit code | ||
end | ||
end |
Oops, something went wrong.