Skip to content

Write a script to update site.time and add TRAVIS CI #1

Open

Description

@Malwine

Jekyll would usually show old posts(=workshops) and no posts that have a future date. We turned the behavior around with these code lines:

{% assign curDate = site.time | date: '%s' %}
    {% for post in site.posts %}
        {% assign postStartDate = post.date | date: '%s' %}
        {% if postStartDate >= curDate %}
          <li>
            <span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>

            <h2>
              <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
            </h2>
          </li>
        {% endif %}
    {% endfor %}

This works fine. The only problem is that site.time only gets updated once we deploy. And we might not deploy everyday. (A deploy happens everytime we push to gh-pages branch.)

💡 The idea is to write a script that updates site.time everyday.

Activity

  1. yokolet commented on Aug 15, 2016

    @yokolet
    Member

    I think Travis CI has a setup to run every day. Through, Travis CI, I guess this process can be automated.

  2. Malwine commented on Sep 28, 2016

    @Malwine
    MemberAuthor

    Hi @yokolet I merged your last PR. Thank you for it 💯
    Would you like to take this issue over and set up Travis?

  3. yokolet commented on Oct 28, 2016

    @yokolet
    Member

    https://github.com/jirutka/rake-jekyll is promising. Travis CI hits rake task which hooks up a redeploy.
    I'll try this using test website. But, it's nice if someone test and report how to do at this website.

  4. Malwine commented on Apr 10, 2017

    @Malwine
    MemberAuthor

    Moving the other issue documentation here: If there is a way to prebuild Jekyll in Travis it would be nice to set it up for future contributors.

  5. self-assigned this
    on Apr 10, 2017
  6. changed the title [-]Write a script to update site.time[/-] [+]Write a script to update site.time and add TRAVIS CI[/+] on Apr 10, 2017
  7. Malwine commented on Apr 10, 2017

    @Malwine
    MemberAuthor

    For doumentation:

    Your Travis CI Trial
    Welcome to Travis CI! Your account ClojureBridge (GitHub name: ClojureBridge) is now successfully set up for your trial.
    
    You have 100 builds left to test things out.
    
    To ensure uninterrupted service, sign the account up for a subscription before the trial runs out. Note that you need to be an owner of the account to sign up for a subscription.
    
    If you need more trial builds, simply reply to this email, and we can add more builds for you!
    
    And if you have any questions, just shoot us an email, we are here to help :)
    
    Thank you and have a great day!
    
    The Travis CI Team 
    

    but I guess we can move it once the repo is public

  8. Malwine commented on Apr 11, 2017

    @Malwine
    MemberAuthor

    Hi @davidchambers, we need to discuss one thing. With the help of my great Travis friend Lisa we set up Travis now 🎉

    If we want to use a cron job there, that would run a script and redeploy the website every day to get the current time, then it will do a push a commit every day. That would mean that we have 365 commits per year polluting our git history.

    What do you think about that?

  9. davidchambers commented on Apr 11, 2017

    @davidchambers
    Contributor

    That would mean that we have 365 commits per year polluting our git history.

    I'm not overly bothered by this, actually. Your proposed solution sounds straightforward and (I hope) reliable. Let's not complicate things. :)

    Also, go Lisa! 🎉

  10. Malwine commented on Apr 11, 2017

    @Malwine
    MemberAuthor

    Todo:

    • Script to run that daily deployment tutorial1
    • Fix Travis ReadMe badge when repo is public (I didn't use the token and so it doesn't seem to work at the moment)
  11. removed their assignment
    on Apr 23, 2017
  12. davidchambers commented on Oct 1, 2018

    @davidchambers
    Contributor

    I have not been able to push commits from Travis CI (see #52 and #58 for my attempts). To get things going I created a script on my computer and told launchd to run it every 12 hours. The first run resulted in 6a1cb91. I'll keep an eye on the script for a few days to determine whether the approach is reliable.

  13. davidchambers commented on Oct 4, 2018

    @davidchambers
    Contributor

    The script is working. It won't run if my computer is asleep, but I'm happy to put this issue to bed. :)

  14. davidchambers commented on Mar 20, 2019

    @davidchambers
    Contributor

    My script has stopped working, so we should make another effort to get a Travis cron job to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions