Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
github_deploy writes lastdeploy file
- Loading branch information
Showing
with
12 additions
and
1 deletion.
-
+1
−0
CHANGES.txt
-
+11
−1
nikola/plugins/command/github_deploy.py
|
@@ -10,6 +10,7 @@ Features |
|
|
Bugfixes |
|
|
-------- |
|
|
|
|
|
* github_deploy records lastdeploy timestamp like regular deploy |
|
|
* Don’t check the same remote URL more than once (Issue #1732) |
|
|
* All remotely checked links resulted in incorrect warnings (`nikola check -lr`) |
|
|
* Exclude `<meta content="noindex" name="robots">` from sitemaps |
|
|
|
@@ -25,14 +25,15 @@ |
|
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
|
|
|
|
from __future__ import print_function |
|
|
from datetime import datetime |
|
|
import os |
|
|
import subprocess |
|
|
import sys |
|
|
from textwrap import dedent |
|
|
|
|
|
from nikola.plugin_categories import Command |
|
|
from nikola.plugins.command.check import real_scan_files |
|
|
from nikola.utils import get_logger, req_missing |
|
|
from nikola.utils import get_logger, req_missing, makedirs, unicode_str |
|
|
from nikola.__main__ import main |
|
|
from nikola import __version__ |
|
|
|
|
@@ -119,3 +120,12 @@ def _commit_and_push(self): |
|
|
'returned {1}'.format(e.cmd, e.returncode) |
|
|
) |
|
|
sys.exit(e.returncode) |
|
|
|
|
|
self.logger.info("Successful deployment") |
|
|
|
|
|
# Store timestamp of successful deployment |
|
|
timestamp_path = os.path.join(self.site.config["CACHE_FOLDER"], "lastdeploy") |
|
|
new_deploy = datetime.utcnow() |
|
|
makedirs(self.site.config["CACHE_FOLDER"]) |
|
|
with io.open(timestamp_path, "w+", encoding="utf8") as outf: |
|
|
outf.write(unicode_str(new_deploy.isoformat())) |