Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dominik-george.de
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nik | Klampfradler
dominik-george.de
Commits
dd9ae4b2
Verified
Commit
dd9ae4b2
authored
7 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Remove fabfile.
parent
57222907
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fabfile.py
+0
-92
0 additions, 92 deletions
fabfile.py
with
0 additions
and
92 deletions
fabfile.py
deleted
100644 → 0
+
0
−
92
View file @
57222907
from
fabric.api
import
*
import
fabric.contrib.project
as
project
import
os
import
shutil
import
sys
import
SocketServer
from
pelican.server
import
ComplexHTTPRequestHandler
# Local path configuration (can be absolute or relative to fabfile)
env
.
deploy_path
=
'
output
'
DEPLOY_PATH
=
env
.
deploy_path
# Remote server configuration
production
=
'
nik@shore.naturalnet.de:22
'
dest_path
=
'
/home/nik/public_html/dominik-george.de
'
# Rackspace Cloud Files configuration settings
env
.
cloudfiles_username
=
'
my_rackspace_username
'
env
.
cloudfiles_api_key
=
'
my_rackspace_api_key
'
env
.
cloudfiles_container
=
'
my_cloudfiles_container
'
# Github Pages configuration
env
.
github_pages_branch
=
"
gh-pages
"
# Port for `serve`
PORT
=
8000
def
clean
():
"""
Remove generated files
"""
if
os
.
path
.
isdir
(
DEPLOY_PATH
):
shutil
.
rmtree
(
DEPLOY_PATH
)
os
.
makedirs
(
DEPLOY_PATH
)
def
build
():
"""
Build local version of site
"""
local
(
'
pelican -s pelicanconf.py
'
)
def
rebuild
():
"""
`build` with the delete switch
"""
local
(
'
pelican -d -s pelicanconf.py
'
)
def
regenerate
():
"""
Automatically regenerate site upon file modification
"""
local
(
'
pelican -r -s pelicanconf.py
'
)
def
serve
():
"""
Serve site at http://localhost:8000/
"""
os
.
chdir
(
env
.
deploy_path
)
class
AddressReuseTCPServer
(
SocketServer
.
TCPServer
):
allow_reuse_address
=
True
server
=
AddressReuseTCPServer
((
''
,
PORT
),
ComplexHTTPRequestHandler
)
sys
.
stderr
.
write
(
'
Serving on port {0} ...
\n
'
.
format
(
PORT
))
server
.
serve_forever
()
def
reserve
():
"""
`build`, then `serve`
"""
build
()
serve
()
def
preview
():
"""
Build production version of site
"""
local
(
'
pelican -s publishconf.py
'
)
def
cf_upload
():
"""
Publish to Rackspace Cloud Files
"""
rebuild
()
with
lcd
(
DEPLOY_PATH
):
local
(
'
swift -v -A https://auth.api.rackspacecloud.com/v1.0
'
'
-U {cloudfiles_username}
'
'
-K {cloudfiles_api_key}
'
'
upload -c {cloudfiles_container} .
'
.
format
(
**
env
))
@hosts
(
production
)
def
publish
():
"""
Publish to production via rsync
"""
local
(
'
pelican -s publishconf.py
'
)
project
.
rsync_project
(
remote_dir
=
dest_path
,
exclude
=
"
.DS_Store
"
,
local_dir
=
DEPLOY_PATH
.
rstrip
(
'
/
'
)
+
'
/
'
,
delete
=
True
,
extra_opts
=
'
-c
'
,
)
def
gh_pages
():
"""
Publish to GitHub Pages
"""
rebuild
()
local
(
"
ghp-import -b {github_pages_branch} {deploy_path} -p
"
.
format
(
**
env
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment