Skip to content

Commit

Permalink
Merge pull request #18 from camalot/develop
Browse files Browse the repository at this point in the history
develop -> master
  • Loading branch information
camalot committed May 20, 2016
2 parents 236b256 + 4ed4e4c commit c009e4d
Show file tree
Hide file tree
Showing 14 changed files with 566 additions and 245 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
.idea/
node_modules/
.vagrant/
dist/
hpi/
target/
work/
*.iml
webapp/
57 changes: 39 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
# jenkins-dark [![Build status](https://ci.appveyor.com/api/projects/status/14lnufroy4v83xjk?svg=true)](https://ci.appveyor.com/project/camalot/jenkins-dark-stylish)
A stylish for Jenkins to give a dark theme.
A theme for Jenkins to give a dark look.

```
NOTE: This has not been tested with Jenkins 2.x.
```

You will need to add the domains that you want this to apply to yourself.

```
@-moz-document domain("my-jenkins-ci-host.com") { ... }
```
You will need to add the domains that you want this to apply to yourself if you use the Stylish plugin.

## How to install

_note: these steps may be slightly different for FireFox version of Stylish_
### Simple Theme Jenkins Plugin (auto-updated)
- Install the [Simple Theme Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Simple+Theme+Plugin) on your Jenkins Server
- Click `Manage Jenkins`
- Click `Configure System` and scroll to `Theme` section
- Specify the URL of `http://camalot.github.io/jenkins-dark-stylish/jenkins-dark.min.css` for the CSS
- Click `Save`

### Native Jenkins Plugin
- Download the [latest release hpi file](https://github.com/camalot/jenkins-dark-stylish/releases/latest)
- Go to `Jenkins -> Manage Jenkins -> Manage Plugins -> Advanced`
- Go to the `Upload Plugin` section
- Select the `hpi` file you downloaded
- Click `Upload`
- Restart Jenkins
- Profit!

### Stylish

_NOTE: these steps may be slightly different for FireFox version of Stylish_

- Install Stylish:
- [Chrome][stylish-chrome]
- [Firefox][stylish-firefox]
- Download the [latest release](https://github.com/camalot/jenkins-dark-stylish/releases/latest)
- Download the [latest release zip](https://github.com/camalot/jenkins-dark-stylish/releases/latest)
- Extract to a known location
- Open the `css` file in your text editor of choice
- Modify the `@-moz-document` line to contain the domains you want to apply this to
- `@-moz-document domain("my-jenkins-ci-host.com") { ... }`
- Save the changes
- Open the Stylish Style Manager (_Manage installed styles._)
- Click on _Write new Style_
- Under _Mozilla Format_, Click on _Import_ button
- Open the Stylish Style Manager (`Manage installed styles`)
- Click on `Write new Style`
- Under `Mozilla Format`, Click on `Import` button
- Select the `jenkins-dark.css` file that you extracted earlier
- Add your domains that you want this to apply to
- Profit!

## Screenshots
Expand All @@ -51,11 +62,21 @@ _note: these steps may be slightly different for FireFox version of Stylish_
## How to build

```
$ npm install less
$ npm install less-plugin-clean-css
$ lessc --no-color --clean-css ./jenkins-dark.less ./dist/jenkins-dark.css
$ npm install
$ grunt
```

This will generate the following:
- dist/jenkins-dark.css
- dist/jenkins-dark.min.css

## How to contribute

- Fork the _Jenkins-Dark-Stylish_ repository
- Clone the repository
- Create a new branch (eg. `feature/style-menus`)
- Create a pull request into `develop`


[stylish-chrome]: https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en
[stylish-firefox]: https://addons.mozilla.org/en-US/firefox/addon/stylish/
15 changes: 15 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos"
config.vm.network :forwarded_port, guest: 8080, host: 8880
# Provisioning
provision_cmd = "wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo; " \
"rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key; " \
"yum install jenkins java-1.6.0-openjdk -y; "
config.vm.provision :shell, :inline => provision_cmd
end
87 changes: 79 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,99 @@ skip_tags: true
image: WMF 5
environment:
nodejs_version: 5.11.0
git_email:
secure: ZLfpxUrw1AeB4Hzmg9poFh3ehcghbjDXbGa1zdUAmb0=
git_name:
secure: bOGR0uSE/yW6nUd9i7fcJg==
gh_access_token:
secure: Es5XTlIJiCiCFJHGDOA09AGFVZQL0jIWtUuPp4+m7MBcfeoVGbWQP2jYU3oSL5bw
install:
- ps: Install-Product node $env:nodejs_version x64
- cmd: npm install -g less
- cmd: npm install -g less-plugin-clean-css
- ps: |
Install-Product node $env:nodejs_version x64;
(Get-Content -Path "${env:APPVEYOR_BUILD_FOLDER}\package.json") | foreach { $_ -replace "`"version`": `"0.0.0`"", "`"version`": `"$ENV:APPVEYOR_BUILD_VERSION`"" } | Set-Content -Path "${env:APPVEYOR_BUILD_FOLDER}\package.json";
- ps: (Get-Content -Path "${env:APPVEYOR_BUILD_FOLDER}\package.json")
- cmd: npm install -g grunt-cli
- cmd: npm install -g grunt
- cmd: npm update -g npm
- cmd: npm install
- ps: |
$mvnVersion = '3.2.5'
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven\")) {
(new-object System.Net.WebClient).DownloadFile(
"http://www.us.apache.org/dist/maven/maven-3/${mvnVersion}/binaries/apache-maven-${mvnVersion}-bin.zip",
'c:\maven-bin.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
}
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET MAVEN_OPTS=-Xmx4g
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
build_script:
- cmd: lessc --lint jenkins-dark.less
- cmd: lessc jenkins-dark.less ./dist/jenkins-dark.css
- cmd: lessc --clean-css jenkins-dark.less ./dist/jenkins-dark.min.css
- ps: Compress-Archive -Path ${env:APPVEYOR_BUILD_FOLDER}/dist/*.css -DestinationPath ./dist/${env:APPVEYOR_PROJECT_NAME}-${env:APPVEYOR_BUILD_VERSION}.zip
- ps: |
$dist = "${env:APPVEYOR_BUILD_FOLDER}\}\dist\";
if ( !(Test-Path -Path $dist) ) {
New-Item -Path $dist -ItemType Directory -Force;
}
- cmd: grunt
- ps: |
$webapp = "${env:APPVEYOR_BUILD_FOLDER}\plugin\src\main\webapp";
if ( (Test-Path -Path $webapp) ) {
Remove-Item -Path $webapp | Out-Null;
}
New-Item -Path $webapp -ItemType Directory -Force | Out-Null;
Copy-Item -Path ${env:APPVEYOR_BUILD_FOLDER}\dist\*.min.css -Destination ${env:APPVEYOR_BUILD_FOLDER}\plugin\src\main\webapp\
Compress-Archive -Path "${env:APPVEYOR_BUILD_FOLDER}/dist/*.css" -DestinationPath "${env:APPVEYOR_BUILD_FOLDER}/dist/${env:APPVEYOR_PROJECT_NAME}-${env:APPVEYOR_BUILD_VERSION}.zip"
$plugin = "${env:APPVEYOR_BUILD_FOLDER}\plugin\";
$target = Join-Path -Path $plugin -ChildPath target;
if ( (Test-Path -Path $target) ) {
Remove-Item -Path $target | Out-Null;
}
New-Item -Path $target -ItemType Directory -Force | Out-Null;
Set-Location $plugin;
& mvn package -B;
"Sleeping..." | Write-Host;
Start-Sleep -s 15;
"Time to wake up..." | Write-Host;
Copy-Item -Path "$target\jenkins-dark-theme.hpi" -Destination "${env:APPVEYOR_BUILD_FOLDER}\dist\${env:APPVEYOR_PROJECT_NAME}-${env:APPVEYOR_BUILD_VERSION}.hpi"
artifacts:
- path: dist/jenkins-dark.css
name: css
- path: dist/*.zip
name: zip
- path: dist/*.hpi
name: hpi
cache:
- c:\maven
- c:\Users\appveyor\.m2
deploy:
- provider: GitHub
tag: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)
release: $(APPVEYOR_PROJECT_NAME)-$(APPVEYOR_BUILD_VERSION)
auth_token:
secure: Es5XTlIJiCiCFJHGDOA09AGFVZQL0jIWtUuPp4+m7MBcfeoVGbWQP2jYU3oSL5bw
artifact: zip
artifact: zip, hpi
draft: false
force_update: true
on:
branch: master
after_deploy:
- ps: |
if ( $ENV:APPVEYOR_PULL_REQUEST_NUMBER -eq $null -and $ENV:APPVEYOR_REPO_BRANCH -match 'master$' ) {
Set-Location "${env:APPVEYOR_BUILD_FOLDER}";
& git reset --hard;
& git config --global credential.helper store;
Add-Content "$ENV:USERPROFILE\.git-credentials" "https://$($ENV:gh_access_token):[email protected]`n";
& git config --global user.email "$ENV:git_email"
& git config --global user.name "$ENV:git_user"
$temp = "c:\temp\jenkins-dark-stylish";
$VERSION = "$ENV:APPVEYOR_BUILD_VERSION";
if ( !(Test-Path -Path $temp )) {
New-Item -Path $temp -Force -ItemType Directory | Out-Null;
}
Copy-Item -Path "${env:APPVEYOR_BUILD_FOLDER}\dist\*.css" -Destination $temp;
& git checkout gh-pages;
Copy-Item -Path "$temp\*.*" -Destination ${env:APPVEYOR_BUILD_FOLDER};
& git commit -a -m "version $VERSION";
& git push origin gh-pages;
}
76 changes: 76 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);

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

grunt.initConfig({
clean: {
dist: {
src: ["dist/*"]
}
},

less: {
dist: {
options: {
//paths: ["assets/css"]
},
files: {"dist/jenkins-dark.css": "jenkins-dark.less"}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'dist/',
src: ['*.css', '!*.min.css'],
dest: 'dist/',
ext: '.min.css'
}]
}
},
replace: {
dist: {
options: {
patterns: [{
match: /\${VERSION}/g,
replacement: pkg.version
}, {
match: /jenkins-dark-theme<\/artifactId>\s+<version>[^>]*<\/version>/g,
replacement: 'jenkins-dark-theme</artifactId>\n <version>' + pkg.version + '</version>'
}]
},
files: [{
src: ['dist/jenkins-dark.css'],
dest: 'dist/jenkins-dark.css'
}, {
src: ['plugin/pom.xml'],
dest: 'plugin/pom.xml'
}]
}
},
postcss: {
options: {
map: false,
processors: [
require('autoprefixer')({
browsers: 'last 2 versions'
}), // add vendor prefixes
require('postcss-encode-base64-inlined-images'),
require('cssnano')() // minify the result
]
},
dist: {
files: [{
expand: true,
cwd: 'dist/',
src: ['*.css', '!*.min.css'],
dest: 'dist/',
ext: '.min.css'
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', ['clean', 'less', 'replace', 'cssmin', 'postcss']);
}
Loading

0 comments on commit c009e4d

Please sign in to comment.