Skip to content

Commit d268995

Browse files
authored
Merge pull request #8 from paladini/easy-deploy
Major core update + awesome new documentation
2 parents 3cd1faf + de1331e commit d268995

17 files changed

+708
-73
lines changed

.gitignore

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# Created by https://www.gitignore.io/api/node,python,sublimetext
2+
3+
### Node ###
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
*.pid.lock
16+
17+
# Directory for instrumented libs generated by jscoverage/JSCover
18+
lib-cov
19+
20+
# Coverage directory used by tools like istanbul
21+
coverage
22+
23+
# nyc test coverage
24+
.nyc_output
25+
26+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27+
.grunt
28+
29+
# Bower dependency directory (https://bower.io/)
30+
bower_components
31+
32+
# node-waf configuration
33+
.lock-wscript
34+
35+
# Compiled binary addons (http://nodejs.org/api/addons.html)
36+
build/Release
37+
38+
# Dependency directories
39+
node_modules/
40+
jspm_packages/
41+
42+
# Typescript v1 declaration files
43+
typings/
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
63+
64+
### Python ###
65+
# Byte-compiled / optimized / DLL files
66+
__pycache__/
67+
*.py[cod]
68+
*$py.class
69+
70+
# C extensions
71+
*.so
72+
73+
# Distribution / packaging
74+
.Python
75+
build/
76+
develop-eggs/
77+
dist/
78+
downloads/
79+
eggs/
80+
.eggs/
81+
lib/
82+
lib64/
83+
parts/
84+
sdist/
85+
var/
86+
wheels/
87+
*.egg-info/
88+
.installed.cfg
89+
*.egg
90+
91+
# PyInstaller
92+
# Usually these files are written by a python script from a template
93+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
94+
*.manifest
95+
*.spec
96+
97+
# Installer logs
98+
pip-log.txt
99+
pip-delete-this-directory.txt
100+
101+
# Unit test / coverage reports
102+
htmlcov/
103+
.tox/
104+
.coverage
105+
.coverage.*
106+
.cache
107+
.pytest_cache/
108+
nosetests.xml
109+
coverage.xml
110+
*.cover
111+
.hypothesis/
112+
113+
# Translations
114+
*.mo
115+
*.pot
116+
117+
# Flask stuff:
118+
instance/
119+
.webassets-cache
120+
121+
# Scrapy stuff:
122+
.scrapy
123+
124+
# Sphinx documentation
125+
docs/_build/
126+
127+
# PyBuilder
128+
target/
129+
130+
# Jupyter Notebook
131+
.ipynb_checkpoints
132+
133+
# pyenv
134+
.python-version
135+
136+
# celery beat schedule file
137+
celerybeat-schedule.*
138+
139+
# SageMath parsed files
140+
*.sage.py
141+
142+
# Environments
143+
.venv
144+
env/
145+
venv/
146+
ENV/
147+
env.bak/
148+
venv.bak/
149+
150+
# Spyder project settings
151+
.spyderproject
152+
.spyproject
153+
154+
# Rope project settings
155+
.ropeproject
156+
157+
# mkdocs documentation
158+
/site
159+
160+
# mypy
161+
.mypy_cache/
162+
163+
### SublimeText ###
164+
# cache files for sublime text
165+
*.tmlanguage.cache
166+
*.tmPreferences.cache
167+
*.stTheme.cache
168+
169+
# workspace files are user-specific
170+
*.sublime-workspace
171+
172+
# project files should be checked into the repository, unless a significant
173+
# proportion of contributors will probably not be using SublimeText
174+
# *.sublime-project
175+
176+
# sftp configuration file
177+
sftp-config.json
178+
179+
# Package control specific files
180+
Package Control.last-run
181+
Package Control.ca-list
182+
Package Control.ca-bundle
183+
Package Control.system-ca-bundle
184+
Package Control.cache/
185+
Package Control.ca-certs/
186+
Package Control.merged-ca-bundle
187+
Package Control.user-ca-bundle
188+
oscrypto-ca-bundle.crt
189+
bh_unicode_properties.cache
190+
191+
# Sublime-github package stores a github token in this file
192+
# https://packagecontrol.io/packages/sublime-github
193+
GitHub.sublime-settings
194+
195+
196+
# End of https://www.gitignore.io/api/node,python,sublimetext

README.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

includes/deploy.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
3+
HOME_PATH=$HOME
4+
GHOST_PATH="${HOME_PATH}/.ghost/current"
5+
GHOST_SERVER_URL="localhost:2373/"
6+
7+
first_deploy() {
8+
if [ -d "$GHOST_PATH" ]; then
9+
cd "$GHOST_PATH"
10+
11+
# Expects an input from user to provide a Git remote URL in which Ghost will be deployed.
12+
echo ' -------------------- INFORMATION NEEDED -------------------- '
13+
echo ''
14+
echo "Following you'll be asked to enter a Git Remote URL in which you would like to deploy Ghost."
15+
echo "Example:"
16+
echo " [email protected]:YOUR_USERNAME/YOUR_REPOSITORY.git"
17+
echo ''
18+
read -p "Remote URL: " remote_url
19+
20+
# Setting up buster on the current folder.
21+
buster setup --gh-repo="$remote_url"
22+
buster generate --domain="$GHOST_SERVER_URL"
23+
24+
git init
25+
git remote add origin "$remote_url"
26+
27+
# Add .gitignore
28+
if [ -f "gitignore.base" ]; then
29+
$(rm -f .gitignore)
30+
$(cp gitignore.base .gitignore)
31+
fi
32+
33+
git add -A
34+
git commit -m "First commit on Github Pages using Ghost."
35+
git push origin master:master master:gh-pages -f
36+
fi
37+
}
38+
39+
update() {
40+
if [ -d "$GHOST_PATH" ]; then
41+
cd "$GHOST_PATH"
42+
43+
# Generating static files
44+
buster generate --domain="$GHOST_SERVER_URL"
45+
46+
# Commiting changes to repository in order to deploy new content.
47+
git add -A
48+
git commit -m "Update on the website at $(date)"
49+
git push origin master:master master:gh-pages -f
50+
fi
51+
}
52+
53+
deploy() {
54+
if [ -d "$GHOST_PATH" ]; then
55+
cd "$GHOST_PATH"
56+
57+
# Check if repo already exists on current path
58+
repo_exists="$(git status)"
59+
case "fatal" in
60+
*"$repo_exists"*)
61+
echo '[INFO] Configuring git repository...'
62+
echo '[INFO] Generating static files from Ghost server...'
63+
first_deploy
64+
exit
65+
;;
66+
esac
67+
echo '[INFO] Deploying to your Github repository...'
68+
update
69+
fi
70+
}
71+
deploy
72+
73+

0 commit comments

Comments
 (0)