push to deploy
1.server端
建立裸仓
$ mkdir ~/repo.git
$ cd ~/repo.git
$ git init --bare
脚本
$ vim ~/repo.git/hooks/post-receive
#!/bin/sh
git --work-tree=~/htdocs --git-dir=~/repo.git checkout -f
echo "Hooray, the new version is published!"
$ chmod +x ~/repo.git/hooks/post-receive
***复制仓库,如果是已有代码的,直接从server代码处git clone到本地来,跳过下步
$ git clone ~/repo.git ~/htdocs
2.client端
$ git remote add live ssh://your_username@your_hostname.tld/~/repo.git
已经好了,使用时直接push同步到server,如下:
$ git commit -m "your commit message"
$ git push live master
来源:https://ma.ttias.be/simple-git-push-workflow-deploy-code-server/
push to deploy的更多相关文章
- 初遇 dotcloud
逛园子的时候看到新浪SAE,正学习建站呢,好东西.(论环境的影响...) 不过发现新浪SAE只支持 Python2,我更喜欢 Python3 e...找找其他的,发现了 dotcloud,遂试试,下面 ...
- 从零开始,做一个NodeJS博客(一):Heroku上的最简NodeJS服务器
标签:NodeJS,Heroku 0 这里是这个伪系列的第一篇,因为我也不知道自己能不能做完,然后到底能做成什么样子.总之,尽力而为吧,加油. 1 Heroku App 的构成 Heroku 所谓的 ...
- 使用Skaffold一键将项目发布到Kubernetes
当前skaffold版本为v0.4,还未发布正式版本,不建议在生产环境中使用: skaffold用于开发人员快速部署程序到Kubernetes中:skaffold提供了dev.run两种模式:使用sk ...
- 【git】git简单使用教程
git的简单使用教程: 1.安装git bash客户端 2.打开git bash,cd到需要存储代码的路径下, 执行:git clone -b deploy ssh://git@gitlab.xxxx ...
- 【高可用架构】借助Envoy工具发布项目到多台服务器
前言 在上一篇,我们已经成功在开发机上部署了Deploy项目,下面我们继续在开发机上安装Envoy 两台应用服务器的IP 192.168.10.12 192.168.10.18 [高可用架构]系列链接 ...
- Salesforce LWC学习(一)Salesforce DX配置
LWC: Create a Salesforce DX Project and Lightning Web Component:https://www.youtube.com/watch?v=p268 ...
- Rancher 构建 CI/CD 自动化流程 - 动态配置 Jenkins-slave(二)
一.说明 1.1 说明 前面介绍采用 Jenkinsfile + KubernetesPod.yaml 方式进行部署项目(Rancher 构建 CI/CD 自动化流程 - 动态配置 Jenkins-s ...
- Rancher 构建 CI/CD 自动化流程 - 动态配置 Jenkins-slave(一)
一.说明 1)需求: Rancher 上部署 Jenkins-master,服务采用 Jenkins-slave 发布,发布完成后 Jenkins-slave 自动销毁. 2)环境: Rancher ...
- Windows docker k8s asp.net core
在上一篇文章 Ubuntu 18 Kubernetes的Install and Deploy 我们在ubuntu在部署了k8s集群, 今天来看看windows下怎么搞. 主要点有: 1) window ...
随机推荐
- h5 canvas 画图
h5 canvas 画图 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...
- hdu 1806 rmq
找到一个区间内出现最多的数的次数 10 3 //10个数字三次询问 -1 -1 1 1 1 1 3 10 10 10 2 3 1 10 5 10 0 143 #include<cstdio> ...
- 免费电子书:微软Azure基础之Azure Automation
(此文章同时发表在本人微信公众号"dotNET每日精华文章") Azure Automation是Azure内置的一项自动化运维基础功能,微软为了让大家更快上手使用这项功能,特意推 ...
- Ubuntu常用命令大全(转)
点评:Ubuntu常用命令大全,学习ubuntn系统的朋友可以收藏下,用ctrl+F查找即可 一.文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件) ls -a 列出当前目录文件(包括隐含文件 ...
- Android ImageView图片自适应 (转)
网络上下载下来的图片自适应:android:adjustViewBounds="true"(其详细解释在下面)<ImageView android:id=" ...
- Source insight怎样恢复默认界面布局 窗口嵌入
先关闭,然后在c盘的文档的Source Insight\Settings目录里面,将CF3文件剪切到别的地方,再打开 不过有些其它设置也会丢失,需要重新设置,参见Source_Insight破解版下载 ...
- 水题 ZOJ 3876 May Day Holiday
题目传送门 /* 水题:已知1928年1月1日是星期日,若是闰年加1,总天数对7取余判断就好了: */ #include <cstdio> #include <iostream> ...
- eBay 消息发送(1)
1.简介 Call Index Doc: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/index.html 消息发送主要 ...
- Pebbles
Pebbles Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Sub ...
- BZOJ2062 : 素颜2(face2)
写个cmp然后sort就好了. cmp的话,需要快速知道两个串的lcp,于是倍增+Hash即可. #include<cstdio> #include<algorithm> ty ...