Skip to content

Instantly share code, notes, and snippets.

View sunnoy's full-sized avatar
🎯
Focusing

Hui Liu sunnoy

🎯
Focusing
View GitHub Profile
@sunnoy
sunnoy / clean-docker-for-mac.sh
Created September 23, 2019 09:43 — forked from MrTrustor/clean-docker-for-mac.sh
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# 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
@sunnoy
sunnoy / build-kube-e2e.sh
Created August 12, 2019 08:37 — forked from ethernetdan/build-kube-e2e.sh
Build Docker image of Kubernetes E2E tests
#!/bin/bash -x
set -euo pipefail
echo "Building conformance image..."
echo
APT_PACKAGES="rsync"
# build docker image of repository
docker build -t "${IMAGE_NAME}:${IMAGE_TAG}" - <<EOF
FROM golang:1.8
@sunnoy
sunnoy / Jenkinsfile
Created July 17, 2019 04:35 — forked from abayer/Jenkinsfile
New Declarative Pipeline features in 1.1
pipeline {
agent {
// "node" is a new agent type that works the same as "label" but allows
// additional parameters, such as "customWorkspace" below.
node {
label "some-label"
// This is equivalent to the "ws(...)" step - sets the workspace on the
// agent to a hard-coded path. If it's not an absolute path, it'll be
// relative to the agent's workspace root.
customWorkspace "/use/this/path/instead"
@sunnoy
sunnoy / Jenkinsfile
Created July 17, 2019 04:35 — forked from qzm/Jenkinsfile
Vue.js / Jenkinsfile /Pipelines
pipeline {
agent {
docker {
image 'node'
}
}
stages {
stage('Clone Sources') {
steps {
@sunnoy
sunnoy / 02-Jenkinsfile
Created July 17, 2019 04:34 — forked from abtris/02-Jenkinsfile
Jenkinsfile - imperative style vs declarative style
pipeline {
agent any
environment {
PACKAGE="github.com/abtris/bee"
GOPATH="/Users/abtris/go"
GOROOT="/usr/local/opt/go/libexec"
}
stages {
stage('Preparation') {
steps {
pipeline {
// run on jenkins nodes tha has java 8 label
agent { label 'java8' }
// global env variables
environment {
EMAIL_RECIPIENTS = '[email protected]'
}
stages {
stage('Build with unit testing') {
@sunnoy
sunnoy / Jenkinsfile
Created July 17, 2019 04:33 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@sunnoy
sunnoy / Jenkinsfile
Created July 17, 2019 04:32 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@sunnoy
sunnoy / Jenkinsfile
Created July 16, 2019 10:16 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@sunnoy
sunnoy / 配置方法.sh
Last active August 9, 2019 02:47
kubectl配置认证
#创建一个专属的namespace
kubectl create ns spinnaker
#创建一个sa
kubectl create serviceaccount spinnaker-service-account -n spinnaker
#进行sa的集群角色绑定
kubectl create clusterrolebinding spinnaker-service-account --clusterrole cluster-admin --serviceaccount=spinnaker:spinnaker-service-account
#获取sa的token-secret