create bare repo and workdir on master and slaves
cd ~
git init --bare projectname.git
mkdir projectname
create post-receive hooks on each slave
#!/bin/bash | |
burn() { | |
local output="$2" | |
if [ ! "$output" ];then | |
output="${1%/}.iso" | |
fi | |
hdiutil makehybrid -iso -joliet -o "$output" "$1" | |
} |
#/bin/sh | |
# Remove all stopped containers | |
docker rm $(docker ps -aq) | |
# Remove all untagged images | |
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") |
#!/bin/bash | |
slice() { | |
DIR=$(gm identify -format %d "$1") | |
FILENAME=$(gm identify -format %t "$1") | |
EXTENSION=$(gm identify -format %e "$1") | |
WIDTH=$(gm identify -format %w "$1") | |
OFFSET=$((WIDTH/2)) | |
if [ "$DIR" ]; then | |
FILENAME="${DIR}/${FILENAME}" |
{ | |
"env": { | |
"es6": true, | |
"node": true | |
}, | |
"extends": "eslint:recommended", | |
"parserOptions": { | |
"ecmaVersion": 8 | |
}, | |
"rules": { |
#!/bin/bash | |
# step 1: 安装必要的一些系统工具 | |
sudo apt-get update | |
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common | |
# step 2: 安装GPG证书 | |
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - | |
# Step 3: 写入软件源信息 | |
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | |
# Step 4: 更新并安装 Docker-CE |
#!/bin/bash | |
# get the latest linux kernel at http://kernel.ubuntu.com/~kernel-ppa/mainline/ | |
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14-rc6/linux-image-4.14.0-041400rc6-generic_4.14.0-041400rc6.201710230731_amd64.deb | |
# install the kernel | |
dpkg -i linux-image-4.*.deb | |
# update grub | |
# for linode, change kernel in boot settings to GRUB 2 |
#!/bin/sh | |
WORK_BRANCH=production | |
WORK_DIR=/path/to/workdir | |
COMPOSE_FILE=/path/to/docker-compose.yml | |
SU_PWD=sudo_pass | |
SERVICE=service_name | |
CMD=command | |
restart() |
#!/bin/bash | |
USERNAME=username | |
WORK_DIR=/path/to/workdir | |
declare -a HOSTS=("hostname1" "hostname2" "hostname3") | |
function copy_files() | |
{ | |
scp -r "$WORK_DIR" "$USERNAME"@"$1":"$WORK_DIR" |
create bare repo and workdir on master and slaves
cd ~
git init --bare projectname.git
mkdir projectname
create post-receive hooks on each slave
#!/bin/bash | |
USERNAME=$(whoami) | |
declare -a HOSTS=( | |
hostname1 | |
hostname2 | |
hostname3) | |
for i in "${HOSTS[@]}" |