2016年3月3日 星期四

Jenkins swarm with docker

因為某些原因所以前一陣子弄了一套Jenkins,不過為了部署方便,光靠原本的Jenkins自己的部署slave的方式實在不是合我用,所以就在想如何跟Docker整合在一起,一方面也是環境單純可以避面Slave Node上有缺套件沒有記錄到,一方面是要部署多台時可以更快更無腦,所以花了一點時間找到了一套Jenkins Plugin叫做 Swarm

Swarm最大特色大概就是可以不用先在Master node身上先進行設定才能增加Slave Node,而是反過來的方式,讓Slave Node可以直接向Master註冊,省去很多設定上的麻煩,非常適合我這懶人。為了方便所以已經直接整合成一個Github repository

Step
$ git clone https://github.com/aminzai/jenkins-swarm-docker.git
$ cd jenkins-swarm-docker
$ docker-compose up -d

2016年2月23日 星期二

Create a simple jenkins by docker-compose

1. Create jenkins's home directory
mkdir /jenkins
mkdir /jenkins/home
cd jenkins
2.Edit docker-compose.yml
main:
    image: jenkins
    ports:
        - 8080:8080
        - 50000:50000
    volumes:
        - ./home:/var/jenkins_home
3.Start dcoker compose
docker-compose up -d
4. Done
http://:8080

Add Jenkins slave node via Java Web start


1. Manage Jenkins=>Manage Nodes=> New Node
2. Type node's name and select Dumb Slave
3.Type Information
Remote root directory:type the working directory
Launch method: Launch slave agents via Java Web Start
Other:set as your wish
4. We will saw this screen.
5. click into the node information
6. Setup the slave node
6.1. Check Java SE environment exist (Download Page)
6.2. Download the slave.jar (by the page)

 7. Run Slave (by MacOSX)
# java -jar slave.jar -jnlpUrl http://xxxxxxx/slave-agent.jnlp
 8. Reload Jenkins node list will the the node started.

幫Jenkins 拉皮(change theme)

想必應該很多人對預設的Jenkins介面感覺到很漂亮,會想要幫他拉皮一下。

所以找了一個 jenkins-material-theme來拉拉Jenkins的皮

1.進入"管理Jenkins"
2.選擇"管例外掛程式"
3. 選擇"可用的"分頁

4.1.在搜尋框輸入"theme"
4.2.選取"Simple Theme Plugin"
4.3.直接安裝
4.4.等待安裝並重開Jenkins完畢
5. 在"管理Jenkins" => "設定系統"中 就可以看到Theme選項
6.在 URL of theme CSS加入"http://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-light.css"


7.儲存=>畫面更新後就完成了!

2016年2月21日 星期日

Repack Android ramdisk

Unpack:
#cat ramdisk.img | gzip -d | cpio -i
Pack:
#find . | cpio -o -H newc | gzip > ramdisk.img