Skip to content

Commit

Permalink
Merge pull request #1 from afonsof/master
Browse files Browse the repository at this point in the history
Sync with afonsof
  • Loading branch information
wbagdon authored Dec 20, 2016
2 parents f7a6296 + 09ec9f7 commit d30af29
Show file tree
Hide file tree
Showing 9 changed files with 217 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ _site/
dist/
hpi/material-theme/
hpi/material-theme.zip
.tmp/
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "6.4"
before_script:
- npm install grunt-cli -g
143 changes: 101 additions & 42 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,75 @@ module.exports = function (grunt) {

var pkg = grunt.file.readJSON('package.json');

grunt.initConfig({
var colors = {
'red': '#F44336',
'pink': '#E91E63',
'purple': '#9C27B0',
'deep-purple': '#673AB7',
'indigo': '#3F51B5',
'blue': '#2196F3',
'light-blue': '#039BE5',
'cyan': '#0097A7',
'teal': '#26A69A',
'green': '#43A047',
'light-green': '#689F38',
'lime': '#AFB42B',
'yellow': '#FBC02D',
'amber': '#FF6F00',
'orange': '#EF6C00',
'deep-orange': '#FF5722',
'brown': '#795548',
'grey': '#757575',
'blue-grey': '#607D8B'
};

var fileCreatorTask = {};
var lessFiles = {
"dist/material-light.css": "less/style.less",
"dist/material-static.css": "less/static.less"
};

clean: {
dist: {
src: ["dist/*"]
}
},
var replaceFiles = [
{src: ['dist/material-light.css'], dest: 'dist/material-light.css'},
{src: ['dist/material-static.css'], dest: 'dist/material-static.css'},
{src: ['plugin/pom.xml'], dest: 'plugin/pom.xml'}
];

less: {
dist: {
files: {
"dist/material-light.css": "less/style.less",
"dist/material-static.css": "less/static.less"
}
}
},
var cssMinFiles = {
'dist/material-light.css': ['dist/material-light.css'],
'dist/material-static.css': ['dist/material-static.css']
};

imageEmbed: {
light: {
src: ["dist/material-light.css"],
dest: "dist/material-light.css",
options: {
deleteAfterEncoding: false
}
},
static: {
src: ["dist/material-static.css"],
dest: "dist/material-static.css",
options: {
deleteAfterEncoding: false
}
}
for (var name in colors) {
var color = colors[name];

fileCreatorTask['.tmp/' + name + '.less'] = new Function('fs', 'fd', 'done', '{\
fs.writeFileSync(fd, \'@import "../less/style";@color-primary:' + color + ';@color-link:' + color + ';\');\
done();\
}');
var distFile = 'dist/material-' + name + '.css';

lessFiles[distFile] = '.tmp/' + name + '.less';
replaceFiles.push({src: [distFile], dest: distFile});
cssMinFiles[distFile] = distFile
}


grunt.initConfig({
"file-creator": {
dist: fileCreatorTask
},

cssmin: {
minify: {
files: {
'dist/material-light.css': ['dist/material-light.css'],
'dist/material-static.css': ['dist/material-static.css']
}
clean: {
dist: {
src: ["dist/*"]
}
},

imagemin: {
dynamic: {
options: {
svgoPlugins: [{
removeViewBox: true,
removeDoctype: true,
removeXMLProcInst: true,
removeComments: true,
Expand Down Expand Up @@ -100,6 +121,12 @@ module.exports = function (grunt) {

},

less: {
dist: {
files: lessFiles
}
},

replace: {
dist: {
options: {
Expand All @@ -114,13 +141,16 @@ module.exports = function (grunt) {
}
]
},
files: [
{src: ['dist/material-light.css'], dest: 'dist/material-light.css'},
{src: ['dist/material-static.css'], dest: 'dist/material-static.css'},
{src: ['plugin/pom.xml'], dest: 'plugin/pom.xml'}
]
files: replaceFiles
}
},

cssmin: {
minify: {
files: cssMinFiles
}
},

postcss: {
options: {
map: false,
Expand All @@ -133,11 +163,40 @@ module.exports = function (grunt) {
dist: {
src: 'dist/material*.css'
}
},

imageEmbed: {
light: {
src: ["dist/material-light.css"],
dest: "dist/material-light.css",
options: {
deleteAfterEncoding: false
}
}, light_blue: {
src: ["dist/material-light-blue.css"],
dest: "dist/material-light-blue.css",
options: {
deleteAfterEncoding: false
}
},
static: {
src: ["dist/material-static.css"],
dest: "dist/material-static.css",
options: {
deleteAfterEncoding: false
}
}
},

fileExists: {
scripts: Object.keys(lessFiles)
}

});

// Default task(s).
grunt.registerTask('default', ['clean', 'imagemin', 'less', 'replace', 'cssmin', 'postcss']);
grunt.registerTask('default', ['clean', 'file-creator', 'imagemin', 'less', 'replace', 'cssmin', 'postcss']);
grunt.registerTask('test', ['default', 'fileExists']);


};
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Afonso F

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# jenkins-material-theme
![image](http://afonsof.com/jenkins-material-theme/images/logo.svg)
# jenkins-material-theme [![Build Status](https://travis-ci.org/afonsof/jenkins-material-theme.svg?branch=master)](https://travis-ci.org/afonsof/jenkins-material-theme)
Beautify your Jenkins with the Material Design theme!

Website: http://jenkins-contrib-themes.github.io/jenkins-material-theme
<a href='https://pledgie.com/campaigns/32522'><img alt='Click here to lend your support to: Jenkins Material Theme and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/32522.png?skin_name=chrome' border='0' ></a>

Website: http://afonsof.com/jenkins-material-theme

So you love **Jenkins** but hate its ugly user interface and icons... Me too! Introducing **Jenkins Material Theme**.
You can turn your favorite frog CI tool into a handsome prince in few steps!
Expand All @@ -10,52 +13,52 @@ You can turn your favorite frog CI tool into a handsome prince in few steps!
* Just one small css file (35K)
* Embed minified SVG images
* Multiple ways to install
* Use your own Company logo with the [generator][generator]
* Customize the color and logo using the [generator][generator]

## Screenshots
[![Screenshot jenkins-material-theme main](images/screenshot-jenkins-material-theme-main.png)](images/screenshot-jenkins-material-theme-main-large.png) [![Screenshot jenkins-material-theme legend](images/screenshot-jenkins-material-theme-legend.png)](images/screenshot-jenkins-material-theme-legend-large.png) [![Screenshot jenkins-material-theme console](images/screenshot-jenkins-material-theme-console.png)](images/screenshot-jenkins-material-theme-console-large.png)
[![Screenshot jenkins-material-theme main](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-main.png)](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-main-large.png) [![Screenshot jenkins-material-theme legend](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-legend.png)](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-legend-large.png) [![Screenshot jenkins-material-theme console](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-console.png)](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-console-large.png)
[![Screenshot jenkins-material-theme history](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-history.png)](http://afonsof.com/jenkins-material-theme/images/screenshot-jenkins-theme-material-history-large.png)


## Installation

### Using this GitHub page (recommended) (auto-updated)

1. Install [Jenkins Simple Theme Plugin][simple]
1. Choose your color:
![image](http://afonsof.com/jenkins-material-theme/images/pallete.png)

1. Click `Manage Jenkins`
2. Replace `{{your-color-name}}` in the URL by the chosen color: `https://afonsof.com/jenkins-material-theme/dist/material-{{your-color-name}}.css`

1. Click `Configure System` and scroll down to `Theme`
3. Install [Jenkins Simple Theme Plugin][simple]

1. Specify the URL for `https://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-light.css`.
4. Click `Manage Jenkins`

1. Click `Save`
5. Click `Configure System` and scroll down to `Theme`

6. Set the CSS field to the generated URL.

### Using the Native Jenkins Plugin
7. Click `Save`

1. Download the file https://github.com/jenkins-contrib-themes/jenkins-material-theme/raw/master/hpi/material-theme.hpi

1. Go to `Manage Jenkins > Plugins > Advanced`
### Using your Jenkins Hosting

1. Select the downloaded file in the area `Upload Plugin`
1. Follow the step 1 and 2 of the previous method

1. Click `Upload`
2. Download the generated URL

1. Restart your Jenkins Server
3. Upload the downloaded file to your web server

### Using your Jenkins Hosting
4. Follow the steps 3 to 7 of the previous method using your uploaded file as URL in step 6

1. Upload the file `https://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-light.css` to your web server

1. Follow the steps of the previous method using your uploaded file as URL in step 4
### Using Stylish (only you will be able to see the awesome theme)

1. Follow the step 1 and 2 of the previous method

### Using Stylish (only you will be able to see the awesome theme)
1. Copy the content of the file downloaded file

1. Install the [Stylish Chrome extension][stylish]

1. Copy the content of the file https://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-light.css

1. Go to Stylish options and click in `Write new style`

1. Paste the theme css in the code box
Expand All @@ -64,7 +67,7 @@ You can turn your favorite frog CI tool into a handsome prince in few steps!

1. Click in `Save`

1. Go to your Jenkins website and enable the theme in the Stylish Chrome t oolbar icon
1. Go to your Jenkins website and enable the theme in the Stylish Chrome toolbar icon


## Development
Expand Down Expand Up @@ -109,5 +112,5 @@ http://afonsof.mit-license.org/
[stylish]: https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe
[canon-jenkins]: https://github.com/rackerlabs/canon-jenkins
[heldroe]: https://github.com/Heldroe
[generator]: http://jenkins-contrib-themes.github.io/jenkins-material-theme
[generator]: http://afonsof.com/jenkins-material-theme
[bootstraponline]: https://github.com/bootstraponline
Binary file modified hpi/material-theme.hpi
Binary file not shown.
Loading

0 comments on commit d30af29

Please sign in to comment.