Skip to content

Commit 504f898

Browse files
committed
Create gh-pages branch via GitHub
0 parents  commit 504f898

File tree

12 files changed

+880
-0
lines changed

12 files changed

+880
-0
lines changed

images/body-bg.png

8.65 KB
Loading

images/highlight-bg.jpg

33.4 KB
Loading

images/hr.png

1.01 KB
Loading

images/octocat-icon.png

1.61 KB
Loading

images/tar-gz-icon.png

1.63 KB
Loading

images/zip-icon.png

1.62 KB
Loading

index.html

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset='utf-8'>
5+
<meta http-equiv="X-UA-Compatible" content="chrome=1">
6+
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
7+
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
8+
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
9+
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
10+
<!--[if lt IE 9]>
11+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12+
<![endif]-->
13+
<title>Git-deploy-php by BrunoDeBarros</title>
14+
</head>
15+
16+
<body>
17+
<div id="container">
18+
<div class="inner">
19+
20+
<header>
21+
<h1>Git-deploy-php</h1>
22+
<h2>git-deploy-php is a simple php-based tool that deploys your Git repositories to FTP/SFTP servers, and keeps them updated automatically.</h2>
23+
</header>
24+
25+
<section id="downloads" class="clearfix">
26+
<a href="https://github.com/BrunoDeBarros/git-deploy-php/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
27+
<a href="https://github.com/BrunoDeBarros/git-deploy-php/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a>
28+
<a href="https://github.com/BrunoDeBarros/git-deploy-php" id="view-on-github" class="button"><span>View on GitHub</span></a>
29+
</section>
30+
31+
<hr>
32+
33+
<section id="main_content">
34+
<h1>
35+
<a name="git-deploy-php-20" class="anchor" href="#git-deploy-php-20"><span class="octicon octicon-link"></span></a>git-deploy-php 2.0</h1>
36+
37+
<p>git-deploy-php allows quick and easy deployments of Git repositories to FTP or SFTP servers. You DO NOT need to have git installed on the server. Great for shared servers where you have no shell access, and to save bandwidth and time by only uploading the files that have changed.</p>
38+
39+
<h2>
40+
<a name="usage" class="anchor" href="#usage"><span class="octicon octicon-link"></span></a>Usage</h2>
41+
42+
<ol>
43+
<li>Drop <code>git-deploy</code> into your project.</li>
44+
<li>Create the <code>deploy.ini</code> file (see below).</li>
45+
<li>Run <code>php git-deploy</code> in your command line / terminal.</li>
46+
</ol><p>And there you go. It's that simple.</p>
47+
48+
<h3>
49+
<a name="deployini" class="anchor" href="#deployini"><span class="octicon octicon-link"></span></a>deploy.ini</h3>
50+
51+
<p>In the root directory of your project, create a <code>deploy.ini</code> file.</p>
52+
53+
<p><em>Note: <code>deploy.ini</code> is the default file's name. You can name it anything you want (for example, <code>staging.ini</code>), and run <code>php git-deploy staging</code>. That serves as an easy way to separate the deployment to staging and production servers.</em></p>
54+
55+
<pre><code>; This is a sample deploy.ini file.
56+
57+
[example]
58+
59+
skip = false
60+
user = example
61+
pass = password
62+
host = example.com
63+
port = 21
64+
path = /path/to/installation
65+
passive = true
66+
67+
; If that seemed too long for you, you can specify servers like this:
68+
[ftp://example:password@example.com:21/path/to/installation]
69+
</code></pre>
70+
71+
<p>The first time it's executed, git-deploy will assume that your deployment server is empty, and will upload all the files in the git repository.
72+
If you've already deployed your project's files previously, you have to create a REVISION file on your deployment server, containing the hash of the commit it's currently in.</p>
73+
74+
<p>To get the hash of the current commit, you can use:</p>
75+
76+
<pre><code>git rev-parse HEAD
77+
</code></pre>
78+
79+
<h2>
80+
<a name="advanced-usage" class="anchor" href="#advanced-usage"><span class="octicon octicon-link"></span></a>Advanced Usage</h2>
81+
82+
<h3>
83+
<a name="using-sftp" class="anchor" href="#using-sftp"><span class="octicon octicon-link"></span></a>Using SFTP</h3>
84+
85+
<p>To use SFTP, you have two options. With the long-form deploy.ini configuration, you just need to add <code>scheme = sftp</code>. With the short-form, you just need to change <code>ftp://</code> to <code>sftp://</code>.</p>
86+
87+
<p>If you want to use a private key to login instead of a password, you can do so by adding the following to your deploy.ini configuration:</p>
88+
89+
<pre><code>sftp_key = /path/to/key/file
90+
</code></pre>
91+
92+
<h3>
93+
<a name="revert-a-deployment" class="anchor" href="#revert-a-deployment"><span class="octicon octicon-link"></span></a>Revert a deployment</h3>
94+
95+
<p>If you deployed using git-deploy and you want to go back to the previous deployment, all you need is <code>--revert</code>:</p>
96+
97+
<pre><code>php git-deploy --revert [your_ini_file_name]
98+
</code></pre>
99+
100+
<p>If you use deploy.ini (i.e., if you didn't give the .ini file a custom name), then you can simply use:</p>
101+
102+
<pre><code>php git-deploy --revert
103+
</code></pre>
104+
105+
<h3>
106+
<a name="deploy-a-specific-commit" class="anchor" href="#deploy-a-specific-commit"><span class="octicon octicon-link"></span></a>Deploy a specific commit</h3>
107+
108+
<pre><code>php git-deploy -r [your_commit_hash] [your_ini_file_name]
109+
</code></pre>
110+
111+
<p>If you use deploy.ini (i.e., if you didn't give the .ini file a custom name), then you can simply use:</p>
112+
113+
<pre><code>php git-deploy -r [your_commit_hash]
114+
</code></pre>
115+
116+
<p>Note: If you want to, instead of using a commit hash, you can use a tag, or any other valid reference.</p>
117+
118+
<h3>
119+
<a name="deploy-the-latest-commit-from-different-branches" class="anchor" href="#deploy-the-latest-commit-from-different-branches"><span class="octicon octicon-link"></span></a>Deploy the latest commit from different branches</h3>
120+
121+
<p>Sometimes you might need to deploy code from different branches to different servers (e.g. from the develop branch to the staging server, and from the master branch to the production server). This is easy to do. Add the following to your deploy.ini configuration:</p>
122+
123+
<pre><code>branch = develop
124+
</code></pre>
125+
126+
<p>git-deploy will then always deploy the latest commit from the develop branch to the server.</p>
127+
128+
<h3>
129+
<a name="list-files-to-upload-and-delete" class="anchor" href="#list-files-to-upload-and-delete"><span class="octicon octicon-link"></span></a>List files to upload and delete</h3>
130+
131+
<p>Sometimes, you may just want to see what files are to be uploaded to the FTP server, and which ones are to be deleted. In this case, you can use <code>-l</code> (lowercase L):</p>
132+
133+
<pre><code>php git-deploy -l [your_ini_file_name]
134+
</code></pre>
135+
136+
<p>If you use deploy.ini (i.e., if you didn't give the .ini file a custom name), then you can simply use:</p>
137+
138+
<pre><code>php git-deploy -l
139+
</code></pre>
140+
141+
<p>Pretty simple, huh?</p>
142+
143+
<h3>
144+
<a name="clean-remote-directories-automatically" class="anchor" href="#clean-remote-directories-automatically"><span class="octicon octicon-link"></span></a>Clean remote directories automatically</h3>
145+
146+
<p>If you have directories you use for caching that you'd like to clear when you deploy a new commit, you can add the following to your .ini file:</p>
147+
148+
<pre><code>clean_directories[] = folder/to/clean
149+
clean_directories[] = another/folder
150+
</code></pre>
151+
152+
<p>And git-deploy will empty those directories for you.</p>
153+
154+
<h3>
155+
<a name="ignore-files" class="anchor" href="#ignore-files"><span class="octicon octicon-link"></span></a>Ignore files</h3>
156+
157+
<p>If you have files that you don't want uploaded to your server, you can add the following to your .ini file:</p>
158+
159+
<pre><code>ignore_files[] = file/toignore.txt
160+
ignore_files[] = another/file/toignore.php
161+
</code></pre>
162+
163+
<p>And git-deploy will ignore those files.</p>
164+
165+
<h3>
166+
<a name="upload-untracked-files" class="anchor" href="#upload-untracked-files"><span class="octicon octicon-link"></span></a>Upload untracked files</h3>
167+
168+
<p>If you have files that you're not tracking in your repository but that you'd still like to upload, you can add the following to your .ini file:</p>
169+
170+
<pre><code>upload_untracked[] = folder/to/upload
171+
upload_untracked[] = another/file/toignore.php
172+
</code></pre>
173+
174+
<p>And git-deploy will automatically upload those files for you. This is super useful for things like Composer, which recommends that you don't track the vendor folder in your git repo. This way, you can have git-deploy upload the entire vendor folder to the server, and you won't need Composer installed on it.</p>
175+
176+
<h3>
177+
<a name="enable-maintenance-mode-on-your-website-for-the-duration-of-the-deployment" class="anchor" href="#enable-maintenance-mode-on-your-website-for-the-duration-of-the-deployment"><span class="octicon octicon-link"></span></a>Enable maintenance mode on your website for the duration of the deployment</h3>
178+
179+
<p>If you want to take your website down with an "under maintenance" page to prevent users from seeing errors during the middle of a deployment, you can ask git-deploy to automatically turn maintenance mode on prior to deploying, and off at the end of the deployment.</p>
180+
181+
<p>It works by modifying a file specified by the <code>maintenance_file</code> option in your <code>deploy.ini</code>. It'll set that file's contents to <code>maintenance_on_value</code> at the start of the deployment and then set its contents to <code>maintenance_off_value</code> at the end of the deployment. For example:</p>
182+
183+
<pre><code>maintenance_file = 'maintenance.php'
184+
maintenance_on_value = '&lt;?php $under_maintenance = true;?&gt;'
185+
maintenance_off_value = '&lt;?php $under_maintenance = false;?&gt;'
186+
</code></pre>
187+
188+
<p>Note: It's up to your application to detect whether or not maintenance mode is on by checking the <code>maintenance_file</code>, and proceed accordingly.</p>
189+
190+
<h2>
191+
<a name="how-it-works" class="anchor" href="#how-it-works"><span class="octicon octicon-link"></span></a>How It Works</h2>
192+
193+
<p>git-deploy stores a file called REVISION on your server. This file contains the hash of the commit that you've deployed to that server. When you run git-deploy, it downloads that file and compares the commit reference in it with the commit you're trying to deploy to find out which files to upload.</p>
194+
195+
<p>git-deploy also stores a REVISION file for each submodule in your repository, as well as a PREVIOUS_REVISION file for both your repository and each submodule. This allows it to keep your submodules up-to-date, as well as to know which commit to go back to you when you run <code>php git-deploy --revert</code>.</p>
196+
197+
<h2>
198+
<a name="suggestions-questions-and-complaints" class="anchor" href="#suggestions-questions-and-complaints"><span class="octicon octicon-link"></span></a>Suggestions, questions and complaints.</h2>
199+
200+
<p>If you've got any suggestions, questions, or anything you don't like about git-deploy, <a href="https://github.com/BrunoDeBarros/git-deploy-php/issues">you should create an issue here</a>. Feel free to fork this project, if you want to contribute to it. </p>
201+
</section>
202+
203+
<footer>
204+
Git-deploy-php is maintained by <a href="https://github.com/BrunoDeBarros">BrunoDeBarros</a><br>
205+
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
206+
</footer>
207+
208+
209+
</div>
210+
</div>
211+
</body>
212+
</html>

javascripts/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('This would be the main JS file.');

params.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"Git-deploy-php","tagline":"git-deploy-php is a simple php-based tool that deploys your Git repositories to FTP/SFTP servers, and keeps them updated automatically.","body":"git-deploy-php 2.0\r\n==================\r\n\r\ngit-deploy-php allows quick and easy deployments of Git repositories to FTP or SFTP servers. You DO NOT need to have git installed on the server. Great for shared servers where you have no shell access, and to save bandwidth and time by only uploading the files that have changed.\r\n\r\nUsage\r\n-----\r\n\r\n1. Drop `git-deploy` into your project.\r\n2. Create the `deploy.ini` file (see below).\r\n3. Run `php git-deploy` in your command line / terminal.\r\n\r\nAnd there you go. It's that simple.\r\n\r\n### deploy.ini\r\n\r\nIn the root directory of your project, create a `deploy.ini` file.\r\n\r\n*Note: `deploy.ini` is the default file's name. You can name it anything you want (for example, `staging.ini`), and run `php git-deploy staging`. That serves as an easy way to separate the deployment to staging and production servers.*\r\n\r\n ; This is a sample deploy.ini file.\r\n \r\n [example]\r\n \r\n skip = false\r\n user = example\r\n pass = password \r\n host = example.com\r\n port = 21\r\n path = /path/to/installation\r\n passive = true\r\n \r\n ; If that seemed too long for you, you can specify servers like this:\r\n [ftp://example:password@example.com:21/path/to/installation]\r\n\r\nThe first time it's executed, git-deploy will assume that your deployment server is empty, and will upload all the files in the git repository.\r\nIf you've already deployed your project's files previously, you have to create a REVISION file on your deployment server, containing the hash of the commit it's currently in.\r\n\r\nTo get the hash of the current commit, you can use:\r\n\r\n git rev-parse HEAD\r\n\r\nAdvanced Usage\r\n--------------\r\n\r\n### Using SFTP\r\n\r\nTo use SFTP, you have two options. With the long-form deploy.ini configuration, you just need to add `scheme = sftp`. With the short-form, you just need to change `ftp://` to `sftp://`.\r\n\r\nIf you want to use a private key to login instead of a password, you can do so by adding the following to your deploy.ini configuration:\r\n\r\n sftp_key = /path/to/key/file\r\n\r\n### Revert a deployment\r\n\r\nIf you deployed using git-deploy and you want to go back to the previous deployment, all you need is `--revert`:\r\n\r\n php git-deploy --revert [your_ini_file_name]\r\n\r\nIf you use deploy.ini (i.e., if you didn't give the .ini file a custom name), then you can simply use:\r\n\r\n php git-deploy --revert\r\n\r\n### Deploy a specific commit\r\n\r\n php git-deploy -r [your_commit_hash] [your_ini_file_name]\r\n\r\nIf you use deploy.ini (i.e., if you didn't give the .ini file a custom name), then you can simply use:\r\n\r\n php git-deploy -r [your_commit_hash]\r\n\r\nNote: If you want to, instead of using a commit hash, you can use a tag, or any other valid reference.\r\n\r\n### Deploy the latest commit from different branches\r\n\r\nSometimes you might need to deploy code from different branches to different servers (e.g. from the develop branch to the staging server, and from the master branch to the production server). This is easy to do. Add the following to your deploy.ini configuration:\r\n\r\n branch = develop\r\n\r\ngit-deploy will then always deploy the latest commit from the develop branch to the server.\r\n\r\n### List files to upload and delete\r\n\r\nSometimes, you may just want to see what files are to be uploaded to the FTP server, and which ones are to be deleted. In this case, you can use `-l` (lowercase L):\r\n\r\n php git-deploy -l [your_ini_file_name]\r\n\r\nIf you use deploy.ini (i.e., if you didn't give the .ini file a custom name), then you can simply use:\r\n\r\n php git-deploy -l\r\n\r\nPretty simple, huh?\r\n\r\n### Clean remote directories automatically\r\n\r\nIf you have directories you use for caching that you'd like to clear when you deploy a new commit, you can add the following to your .ini file:\r\n\r\n\tclean_directories[] = folder/to/clean\r\n\tclean_directories[] = another/folder\r\n\r\nAnd git-deploy will empty those directories for you.\r\n\r\n### Ignore files\r\n\r\nIf you have files that you don't want uploaded to your server, you can add the following to your .ini file:\r\n\r\n\tignore_files[] = file/toignore.txt\r\n\tignore_files[] = another/file/toignore.php\r\n\r\nAnd git-deploy will ignore those files.\r\n\r\n### Upload untracked files\r\n\r\nIf you have files that you're not tracking in your repository but that you'd still like to upload, you can add the following to your .ini file:\r\n\r\n\tupload_untracked[] = folder/to/upload\r\n\tupload_untracked[] = another/file/toignore.php\r\n\r\nAnd git-deploy will automatically upload those files for you. This is super useful for things like Composer, which recommends that you don't track the vendor folder in your git repo. This way, you can have git-deploy upload the entire vendor folder to the server, and you won't need Composer installed on it.\r\n\r\n### Enable maintenance mode on your website for the duration of the deployment\r\n\r\nIf you want to take your website down with an \"under maintenance\" page to prevent users from seeing errors during the middle of a deployment, you can ask git-deploy to automatically turn maintenance mode on prior to deploying, and off at the end of the deployment.\r\n\r\nIt works by modifying a file specified by the `maintenance_file` option in your `deploy.ini`. It'll set that file's contents to `maintenance_on_value` at the start of the deployment and then set its contents to `maintenance_off_value` at the end of the deployment. For example:\r\n\r\n maintenance_file = 'maintenance.php'\r\n maintenance_on_value = '<?php $under_maintenance = true;?>'\r\n maintenance_off_value = '<?php $under_maintenance = false;?>'\r\n\r\nNote: It's up to your application to detect whether or not maintenance mode is on by checking the `maintenance_file`, and proceed accordingly.\r\n\r\nHow It Works\r\n------------\r\ngit-deploy stores a file called REVISION on your server. This file contains the hash of the commit that you've deployed to that server. When you run git-deploy, it downloads that file and compares the commit reference in it with the commit you're trying to deploy to find out which files to upload.\r\n\r\ngit-deploy also stores a REVISION file for each submodule in your repository, as well as a PREVIOUS_REVISION file for both your repository and each submodule. This allows it to keep your submodules up-to-date, as well as to know which commit to go back to you when you run `php git-deploy --revert`.\r\n\r\nSuggestions, questions and complaints.\r\n----------\r\n\r\nIf you've got any suggestions, questions, or anything you don't like about git-deploy, [you should create an issue here](https://github.com/BrunoDeBarros/git-deploy-php/issues). Feel free to fork this project, if you want to contribute to it. ","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}

0 commit comments

Comments
 (0)