Skip to content
Permalink
Browse files
github_deploy writes lastdeploy file
  • Loading branch information
da2x committed May 21, 2015
1 parent 28be7f6 commit f7e5152de061d1d50e264f860edf6c7793706bca
Showing with 12 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +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()))

0 comments on commit f7e5152

Please sign in to comment.