Skip to content

Instantly share code, notes, and snippets.

View jaohaohsuan's full-sized avatar

Henry jaohaohsuan

View GitHub Profile
@jaohaohsuan
jaohaohsuan / Jenkinsfile
Created April 30, 2017 10:13
helm Jenkins template
podTemplate(
label: 'es-build',
containers: [
containerTemplate(name: 'jnlp', image: 'henryrao/jnlp-slave', args: '${computer.jnlpmac} ${computer.name}', alwaysPullImage: true)
],
volumes: [
hostPathVolume(mountPath: '/root/.kube/config', hostPath: '/root/.kube/config')
]) {
node('es-build') {
@jaohaohsuan
jaohaohsuan / delete-builds.groovy
Last active April 6, 2017 05:31
delete jenkins builds
def jobName = "jenkins-master"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
@jaohaohsuan
jaohaohsuan / pod-with-container-pipeline.groovy
Created April 6, 2017 05:25
jenkins pipeline pod & docker run hybrid
podTemplate(
label: 'stored2',
containers: [
containerTemplate(name: 'jnlp', image: 'henryrao/jnlp-slave', args: '${computer.jnlpmac} ${computer.name}', alwaysPullImage: true),
containerTemplate(name: 'elastic', image: 'docker.elastic.co/elasticsearch/elasticsearch:5.2.2', ttyEnabled: true,
command: '/usr/share/elasticsearch/bin/elasticsearch -Ehttp.host=0.0.0.0 -Etransport.host=127.0.0.1 -Expack.security.enabled=false',
envVars: [
containerEnvVar(key: 'ES_JAVA_OPTS', value: '-Des.cgroups.hierarchy.override=/')
])
],
@jaohaohsuan
jaohaohsuan / declarative-agent.groovy
Created April 4, 2017 13:57
注意看到agent section. 可以支持在不同stage使用不同的agent(node)或容器
pipeline {
agent none
stages {
stage('Build') {
agent { label 'docker' }
steps {
echo "hello"
}
}
}
@jaohaohsuan
jaohaohsuan / sbt-notes.md
Last active March 2, 2017 02:43
sbt notes

sbt notes

package scala project
如何從sbt傳入參數到configuration?
akka {
 remote {
val lines = """|PUT my_index
|{
| "mappings": {
| "my_type": {
| "properties": {
| "location": {
| "type": "geo_point"
| }
| }
| }

#改/etc/hosts

可精确改到原有hostname原来是指向127.0.0.1(lookback)的问题, 在建立ceph的osd node一定得改

原始/etc/hosts

127.0.0.1    node1 node1

变成

@jaohaohsuan
jaohaohsuan / delve.md
Last active November 25, 2016 01:17
解决sierra macOS无法用delve

不能debug的错误信息

could not launch process: could not fork/exec

先自己产生证书, 接下来一定要重开机

  • 获取delve源代码
@jaohaohsuan
jaohaohsuan / coreos-ipxe-run.sh
Last active November 23, 2016 13:32
bootkube server containers
docker run --rm --net=host --cap-add=NET_ADMIN quay.io/coreos/dnsmasq -d -q --dhcp-range=192.168.90.20,192.168.90.30 --enable-tftp --tftp-root=/var/lib/tftpboot --dhcp-userclass=set:ipxe,iPXE --dhcp-boot=tag:#ipxe,undionly.kpxe --dhcp-boot=tag:ipxe,http://bootcfg.example.com:8080/boot.ipxe --log-queries --log-dhcp --dhcp-option=3,192.168.90.1 --address=/bootcfg.example.com/192.168.90.250
docker run -p 8080:8080 --rm -v $PWD/demo1:/var/lib/bootcfg:Z -v $PWD/demo1/groups:/var/lib/bootcfg/groups:Z quay.io/coreos/bootcfg:latest -address=0.0.0.0:8080 -log-level=debug
@jaohaohsuan
jaohaohsuan / install-kubectl.sh
Created November 18, 2016 01:50
install kubectl form image
docker run --rm \
-v /opt/bin:/tmp/bin gcr.io/google_containers/hyperkube:v1.4.6 \
/bin/sh -c "cp /hyperkube /tmp/bin" \
&& ln -s /opt/bin/hyperkube /opt/bin/kubectl