Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
blog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
blog
Commits
ebeb2b99
Commit
ebeb2b99
authored
4 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Remove Fabric, replace with Pipenv scripts.
parent
e901c0df
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Pipfile
+6
-1
6 additions, 1 deletion
Pipfile
Pipfile.lock
+1
-126
1 addition, 126 deletions
Pipfile.lock
README.md
+21
-14
21 additions, 14 deletions
README.md
fabfile.py
+0
-88
0 additions, 88 deletions
fabfile.py
with
28 additions
and
229 deletions
Pipfile
+
6
−
1
View file @
ebeb2b99
...
...
@@ -5,10 +5,15 @@ name = "pypi"
[packages]
pelican
=
"*"
"fabric3"
=
"*"
pelican-minification
=
"*"
[dev-packages]
[requires]
python_version
=
"3.6"
[scripts]
build
=
"pelican --settings publishconf.py"
clean
=
"rm -rf __pycache__/ output/* sitespeed-result/ lighthouse-result/"
dev
=
"pelican --listen --port 8080 --autoreload"
publish
=
"rsync --delete --verbose --times --recursive --compress --checksum output/ nimrod@host01.shore.co.il:/var/www/www.shore.co.il/blog/"
This diff is collapsed.
Click to expand it.
Pipfile.lock
+
1
−
126
View file @
ebeb2b99
{
"_meta"
:
{
"hash"
:
{
"sha256"
:
"
119959021872ee07af13ffcd6190f06f366833af53825a10fcbe23801b00c3a2
"
"sha256"
:
"
4616ef5f2497b0e3287bac972b29bd2d5b5bbe9d93dc18744dac5f6038c0a161
"
},
"pipfile-spec"
:
6
,
"requires"
:
{
...
...
@@ -16,92 +16,12 @@
]
},
"default"
:
{
"bcrypt"
:
{
"hashes"
:
[
"sha256:5b93c1726e50a93a033c36e5ca7fdcd29a5c7395af50a6892f5d9e7c6cfbfb29"
,
"sha256:63d4e3ff96188e5898779b6057878fecf3f11cfe6ec3b313ea09955d587ec7a7"
,
"sha256:81fec756feff5b6818ea7ab031205e1d323d8943d237303baca2c5f9c7846f34"
,
"sha256:a67fb841b35c28a59cebed05fbd3e80eea26e6d75851f0574a9273c80f3e9b55"
,
"sha256:c95d4cbebffafcdd28bd28bb4e25b31c50f6da605c81ffd9ad8a3d1b2ab7b1b6"
,
"sha256:cd1ea2ff3038509ea95f687256c46b79f5fc382ad0aa3664d200047546d511d1"
,
"sha256:cdcdcb3972027f83fe24a48b1e90ea4b584d35f1cc279d76de6fc4b13376239d"
],
"version"
:
"==3.2.0"
},
"blinker"
:
{
"hashes"
:
[
"sha256:471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"
],
"version"
:
"==1.4"
},
"cffi"
:
{
"hashes"
:
[
"sha256:005f2bfe11b6745d726dbb07ace4d53f057de66e336ff92d61b8c7e9c8f4777d"
,
"sha256:09e96138280241bd355cd585148dec04dbbedb4f46128f340d696eaafc82dd7b"
,
"sha256:0b1ad452cc824665ddc682400b62c9e4f5b64736a2ba99110712fdee5f2505c4"
,
"sha256:0ef488305fdce2580c8b2708f22d7785ae222d9825d3094ab073e22e93dfe51f"
,
"sha256:15f351bed09897fbda218e4db5a3d5c06328862f6198d4fb385f3e14e19decb3"
,
"sha256:22399ff4870fb4c7ef19fff6eeb20a8bbf15571913c181c78cb361024d574579"
,
"sha256:23e5d2040367322824605bc29ae8ee9175200b92cb5483ac7d466927a9b3d537"
,
"sha256:2791f68edc5749024b4722500e86303a10d342527e1e3bcac47f35fbd25b764e"
,
"sha256:2f9674623ca39c9ebe38afa3da402e9326c245f0f5ceff0623dccdac15023e05"
,
"sha256:3363e77a6176afb8823b6e06db78c46dbc4c7813b00a41300a4873b6ba63b171"
,
"sha256:33c6cdc071ba5cd6d96769c8969a0531be2d08c2628a0143a10a7dcffa9719ca"
,
"sha256:3b8eaf915ddc0709779889c472e553f0d3e8b7bdf62dab764c8921b09bf94522"
,
"sha256:3cb3e1b9ec43256c4e0f8d2837267a70b0e1ca8c4f456685508ae6106b1f504c"
,
"sha256:3eeeb0405fd145e714f7633a5173318bd88d8bbfc3dd0a5751f8c4f70ae629bc"
,
"sha256:44f60519595eaca110f248e5017363d751b12782a6f2bd6a7041cba275215f5d"
,
"sha256:4d7c26bfc1ea9f92084a1d75e11999e97b62d63128bcc90c3624d07813c52808"
,
"sha256:529c4ed2e10437c205f38f3691a68be66c39197d01062618c55f74294a4a4828"
,
"sha256:6642f15ad963b5092d65aed022d033c77763515fdc07095208f15d3563003869"
,
"sha256:85ba797e1de5b48aa5a8427b6ba62cf69607c18c5d4eb747604b7302f1ec382d"
,
"sha256:8f0f1e499e4000c4c347a124fa6a27d37608ced4fe9f7d45070563b7c4c370c9"
,
"sha256:a624fae282e81ad2e4871bdb767e2c914d0539708c0f078b5b355258293c98b0"
,
"sha256:b0358e6fefc74a16f745afa366acc89f979040e0cbc4eec55ab26ad1f6a9bfbc"
,
"sha256:bbd2f4dfee1079f76943767fce837ade3087b578aeb9f69aec7857d5bf25db15"
,
"sha256:bf39a9e19ce7298f1bd6a9758fa99707e9e5b1ebe5e90f2c3913a47bc548747c"
,
"sha256:c11579638288e53fc94ad60022ff1b67865363e730ee41ad5e6f0a17188b327a"
,
"sha256:c150eaa3dadbb2b5339675b88d4573c1be3cb6f2c33a6c83387e10cc0bf05bd3"
,
"sha256:c53af463f4a40de78c58b8b2710ade243c81cbca641e34debf3396a9640d6ec1"
,
"sha256:cb763ceceae04803adcc4e2d80d611ef201c73da32d8f2722e9d0ab0c7f10768"
,
"sha256:cc75f58cdaf043fe6a7a6c04b3b5a0e694c6a9e24050967747251fb80d7bce0d"
,
"sha256:d80998ed59176e8cba74028762fbd9b9153b9afc71ea118e63bbf5d4d0f9552b"
,
"sha256:de31b5164d44ef4943db155b3e8e17929707cac1e5bd2f363e67a56e3af4af6e"
,
"sha256:e66399cf0fc07de4dce4f588fc25bfe84a6d1285cc544e67987d22663393926d"
,
"sha256:f0620511387790860b249b9241c2f13c3a80e21a73e0b861a2df24e9d6f56730"
,
"sha256:f4eae045e6ab2bb54ca279733fe4eb85f1effda392666308250714e01907f394"
,
"sha256:f92cdecb618e5fa4658aeb97d5eb3d2f47aa94ac6477c6daf0f306c5a3b9e6b1"
,
"sha256:f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591"
],
"version"
:
"==1.14.3"
},
"cryptography"
:
{
"hashes"
:
[
"sha256:21b47c59fcb1c36f1113f3709d37935368e34815ea1d7073862e92f810dc7499"
,
"sha256:451cdf60be4dafb6a3b78802006a020e6cd709c22d240f94f7a0696240a17154"
,
"sha256:4549b137d8cbe3c2eadfa56c0c858b78acbeff956bd461e40000b2164d9167c6"
,
"sha256:48ee615a779ffa749d7d50c291761dc921d93d7cf203dca2db663b4f193f0e49"
,
"sha256:559d622aef2a2dff98a892eef321433ba5bc55b2485220a8ca289c1ecc2bd54f"
,
"sha256:5d52c72449bb02dd45a773a203196e6d4fae34e158769c896012401f33064396"
,
"sha256:65beb15e7f9c16e15934569d29fb4def74ea1469d8781f6b3507ab896d6d8719"
,
"sha256:680da076cad81cdf5ffcac50c477b6790be81768d30f9da9e01960c4b18a66db"
,
"sha256:762bc5a0df03c51ee3f09c621e1cee64e3a079a2b5020de82f1613873d79ee70"
,
"sha256:89aceb31cd5f9fc2449fe8cf3810797ca52b65f1489002d58fe190bfb265c536"
,
"sha256:983c0c3de4cb9fcba68fd3f45ed846eb86a2a8b8d8bc5bb18364c4d00b3c61fe"
,
"sha256:99d4984aabd4c7182050bca76176ce2dbc9fa9748afe583a7865c12954d714ba"
,
"sha256:9d9fc6a16357965d282dd4ab6531013935425d0dc4950df2e0cf2a1b1ac1017d"
,
"sha256:a7597ffc67987b37b12e09c029bd1dc43965f75d328076ae85721b84046e9ca7"
,
"sha256:ab010e461bb6b444eaf7f8c813bb716be2d78ab786103f9608ffd37a4bd7d490"
,
"sha256:b12e715c10a13ca1bd27fbceed9adc8c5ff640f8e1f7ea76416352de703523c8"
,
"sha256:b2bded09c578d19e08bd2c5bb8fed7f103e089752c9cf7ca7ca7de522326e921"
,
"sha256:b372026ebf32fe2523159f27d9f0e9f485092e43b00a5adacf732192a70ba118"
,
"sha256:cb179acdd4ae1e4a5a160d80b87841b3d0e0be84af46c7bb2cd7ece57a39c4ba"
,
"sha256:e97a3b627e3cb63c415a16245d6cef2139cca18bb1183d1b9375a1c14e83f3b3"
,
"sha256:f0e099fc4cc697450c3dd4031791559692dd941a95254cb9aeded66a7aa8b9bc"
,
"sha256:f99317a0fa2e49917689b8cf977510addcfaaab769b3f899b9c481bbd76730c2"
],
"version"
:
"==3.1.1"
},
"csscompressor"
:
{
"hashes"
:
[
"sha256:afa22badbcf3120a4f392e4d22f9fff485c044a1feda4a950ecc5eba9dd31a05"
...
...
@@ -115,14 +35,6 @@
],
"version"
:
"==0.16"
},
"fabric3"
:
{
"hashes"
:
[
"sha256:647e485ec83f30b587862f92374d6affc217f3d79819d1d7f512e42e7ae51e81"
,
"sha256:7c5a5f2eb3079eb6bd2a69931f1ca298844c730ce3fdc68111db16e8857a0408"
],
"index"
:
"pypi"
,
"version"
:
"==1.14.post1"
},
"feedgenerator"
:
{
"hashes"
:
[
"sha256:a28a5add781509390d1a6a52d017829853ee4bef1d2e7b4d5da0e9d1b395ce54"
,
...
...
@@ -181,13 +93,6 @@
],
"version"
:
"==1.1.1"
},
"paramiko"
:
{
"hashes"
:
[
"sha256:4f3e316fef2ac628b05097a637af35685183111d4bc1b5979bd397c2ab7b5898"
,
"sha256:7f36f4ba2c0d81d219f4595e35f70d56cc94f9ac40a6acdf51d6ca210ce65035"
],
"version"
:
"==2.7.2"
},
"pelican"
:
{
"hashes"
:
[
"sha256:2c5c721bc95caa406673d74a5b906f42289930dabee598b41930a18cf98742a5"
,
...
...
@@ -203,13 +108,6 @@
"index"
:
"pypi"
,
"version"
:
"==0.1.1"
},
"pycparser"
:
{
"hashes"
:
[
"sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"
,
"sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"
],
"version"
:
"==2.20"
},
"pygments"
:
{
"hashes"
:
[
"sha256:307543fe65c0947b126e83dd5a61bd8acbd84abec11f43caebaf5534cbc17998"
,
...
...
@@ -217,29 +115,6 @@
],
"version"
:
"==2.7.1"
},
"pynacl"
:
{
"hashes"
:
[
"sha256:06cbb4d9b2c4bd3c8dc0d267416aaed79906e7b33f114ddbf0911969794b1cc4"
,
"sha256:11335f09060af52c97137d4ac54285bcb7df0cef29014a1a4efe64ac065434c4"
,
"sha256:2fe0fc5a2480361dcaf4e6e7cea00e078fcda07ba45f811b167e3f99e8cff574"
,
"sha256:30f9b96db44e09b3304f9ea95079b1b7316b2b4f3744fe3aaecccd95d547063d"
,
"sha256:4e10569f8cbed81cb7526ae137049759d2a8d57726d52c1a000a3ce366779634"
,
"sha256:511d269ee845037b95c9781aa702f90ccc36036f95d0f31373a6a79bd8242e25"
,
"sha256:537a7ccbea22905a0ab36ea58577b39d1fa9b1884869d173b5cf111f006f689f"
,
"sha256:54e9a2c849c742006516ad56a88f5c74bf2ce92c9f67435187c3c5953b346505"
,
"sha256:757250ddb3bff1eecd7e41e65f7f833a8405fede0194319f87899690624f2122"
,
"sha256:7757ae33dae81c300487591c68790dfb5145c7d03324000433d9a2c141f82af7"
,
"sha256:7c6092102219f59ff29788860ccb021e80fffd953920c4a8653889c029b2d420"
,
"sha256:8122ba5f2a2169ca5da936b2e5a511740ffb73979381b4229d9188f6dcb22f1f"
,
"sha256:9c4a7ea4fb81536c1b1f5cc44d54a296f96ae78c1ebd2311bd0b60be45a48d96"
,
"sha256:c914f78da4953b33d4685e3cdc7ce63401247a21425c16a39760e282075ac4a6"
,
"sha256:cd401ccbc2a249a47a3a1724c2918fcd04be1f7b54eb2a5a71ff915db0ac51c6"
,
"sha256:d452a6746f0a7e11121e64625109bc4468fc3100452817001dbe018bb8b08514"
,
"sha256:ea6841bc3a76fa4942ce00f3bda7d436fda21e2d91602b9e21b7ca9ecab8f3ff"
,
"sha256:f8851ab9041756003119368c1e6cd0b9c631f46d686b3904b18c0139f4419f80"
],
"version"
:
"==1.4.0"
},
"python-dateutil"
:
{
"hashes"
:
[
"sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"
,
...
...
This diff is collapsed.
Click to expand it.
README.md
+
21
−
14
View file @
ebeb2b99
...
...
@@ -6,28 +6,35 @@
-
Python 3.6
-
[
Pipenv
](
https://pipenv.org
)
-
[
Docker
](
https://www.docker.com/
)
(
Only
needed for running the lighthouse and
sitespeed tests)
-
[
direnv
](
http://direnv.net/
)
(
Just
for ease of use)
-
rsync
## Usage
All tasks are done via
`fab`
using
`pipenv`
Serve a development version of the blog at http://localhost:8080/
```
pipenv run dev
```
pipenv run $ fab -l
Available commands:
build Build local version of site
clean Remove generated files
dev Auto-regenerate files and serve at http://localhost:8080/
lighthouse Run Chrome's Lighthouse report against the local dev server
preview Build production version of site
publish Publish to production via rsync
regenerate Automatically regenerate site upon file modification
serve Serve site at http://localhost:8080/
sitespeed Run sitespeed test against the local dev server
Build a production version of the blog at
`output/`
```
pipenv run build
```
Publish the blog (sync to server, requires running
`pipenv run build`
beforehand)
```
pipenv run publish
```
Delete the outputed files
```
pipenv run clean
```
## License
...
...
This diff is collapsed.
Click to expand it.
fabfile.py
deleted
100644 → 0
+
0
−
88
View file @
e901c0df
from
fabric.api
import
lcd
,
env
,
local
,
hosts
,
warn_only
import
fabric.contrib.project
as
project
import
multiprocessing
import
os
env
.
use_ssh_config
=
True
# Local path configuration (can be absolute or relative to fabfile)
env
.
deploy_path
=
'
output
'
DEPLOY_PATH
=
env
.
deploy_path
# Remote server configuration
production
=
'
host01.shore.co.il
'
dest_path
=
'
/var/www/www.shore.co.il/blog/
'
UID
=
os
.
getuid
()
def
clean
():
"""
Remove generated files
"""
local
(
f
'
rm -rf __pycache__/
{
DEPLOY_PATH
}
/* sitespeed-result/ lighthouse-result/
'
)
def
build
():
"""
Build local version of site
"""
local
(
'
pelican -s pelicanconf.py
'
)
def
regenerate
():
"""
Automatically regenerate site upon file modification
"""
local
(
'
pelican -D -r -s pelicanconf.py
'
)
def
serve
():
"""
Serve site at http://localhost:8080/
"""
with
lcd
(
DEPLOY_PATH
):
local
(
'
python -m http.server 8080
'
)
def
dev
():
"""
Auto-regenerate files and serve at http://localhost:8080/
"""
server_process
=
multiprocessing
.
Process
(
target
=
serve
,
daemon
=
True
)
server_process
.
start
()
regenerate
()
server_process
.
terminate
()
server_process
.
join
(
timeout
=
3
)
def
preview
():
"""
Build production version of site
"""
local
(
'
pelican -s publishconf.py
'
)
@hosts
(
production
)
def
publish
():
"""
Publish to production via rsync
"""
preview
()
project
.
rsync_project
(
remote_dir
=
dest_path
,
exclude
=
"
.DS_Store
"
,
local_dir
=
DEPLOY_PATH
.
rstrip
(
'
/
'
)
+
'
/
'
,
delete
=
True
,
extra_opts
=
'
-c
'
,
)
def
sitespeed
():
"""
Run sitespeed test against the local dev server
"""
build
()
with
warn_only
():
local
(
'
docker run --rm --privileged --net=host gliderlabs/hostlocal
'
)
server_process
=
multiprocessing
.
Process
(
target
=
serve
,
daemon
=
True
)
server_process
.
start
()
local
(
f
'
docker run --rm --shm-size=1g -u
{
UID
}
-v
"
$PWD:/sitespeed.io
"
sitespeedio/sitespeed.io http://169.254.255.254:8080/
'
)
server_process
.
terminate
()
server_process
.
join
(
timeout
=
3
)
def
lighthouse
():
"""
Run Chrome
'
s Lighthouse report against the local dev server
"""
build
()
with
warn_only
():
local
(
'
docker run --rm --privileged --net=host gliderlabs/hostlocal
'
)
server_process
=
multiprocessing
.
Process
(
target
=
serve
,
daemon
=
True
)
server_process
.
start
()
local
(
'
mkdir -p lighthouse-result
'
)
local
(
'
docker run --rm -u {UID} -v
"
$PWD/lighthouse-result:/home/chrome/reports
"
--cap-add=SYS_ADMIN --user=1000 justinribeiro/lighthouse lighthouse --chrome-flags=
"
--headless --no-sandbox --disable-gpu
"
http://169.254.255.254:8080/
'
)
server_process
.
terminate
()
server_process
.
join
(
timeout
=
3
)
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