Skip to content

Commit

Permalink
Merge pull request #8 from paladini/easy-deploy
Browse files Browse the repository at this point in the history
Major core update + awesome new documentation
  • Loading branch information
paladini authored May 6, 2018
2 parents 3cd1faf + de1331e commit d268995
Show file tree
Hide file tree
Showing 17 changed files with 708 additions and 73 deletions.
196 changes: 196 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# Created by https://www.gitignore.io/api/node,python,sublimetext

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

# Environments
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# workspace files are user-specific
*.sublime-workspace

# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache

# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings


# End of https://www.gitignore.io/api/node,python,sublimetext
68 changes: 0 additions & 68 deletions README.md

This file was deleted.

73 changes: 73 additions & 0 deletions includes/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env bash

HOME_PATH=$HOME
GHOST_PATH="${HOME_PATH}/.ghost/current"
GHOST_SERVER_URL="localhost:2373/"

first_deploy() {
if [ -d "$GHOST_PATH" ]; then
cd "$GHOST_PATH"

# Expects an input from user to provide a Git remote URL in which Ghost will be deployed.
echo ' -------------------- INFORMATION NEEDED -------------------- '
echo ''
echo "Following you'll be asked to enter a Git Remote URL in which you would like to deploy Ghost."
echo "Example:"
echo " [email protected]:YOUR_USERNAME/YOUR_REPOSITORY.git"
echo ''
read -p "Remote URL: " remote_url

# Setting up buster on the current folder.
buster setup --gh-repo="$remote_url"
buster generate --domain="$GHOST_SERVER_URL"

git init
git remote add origin "$remote_url"

# Add .gitignore
if [ -f "gitignore.base" ]; then
$(rm -f .gitignore)
$(cp gitignore.base .gitignore)
fi

git add -A
git commit -m "First commit on Github Pages using Ghost."
git push origin master:master master:gh-pages -f
fi
}

update() {
if [ -d "$GHOST_PATH" ]; then
cd "$GHOST_PATH"

# Generating static files
buster generate --domain="$GHOST_SERVER_URL"

# Commiting changes to repository in order to deploy new content.
git add -A
git commit -m "Update on the website at $(date)"
git push origin master:master master:gh-pages -f
fi
}

deploy() {
if [ -d "$GHOST_PATH" ]; then
cd "$GHOST_PATH"

# Check if repo already exists on current path
repo_exists="$(git status)"
case "fatal" in
*"$repo_exists"*)
echo '[INFO] Configuring git repository...'
echo '[INFO] Generating static files from Ghost server...'
first_deploy
exit
;;
esac
echo '[INFO] Deploying to your Github repository...'
update
fi
}
deploy


Loading

0 comments on commit d268995

Please sign in to comment.