Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Malwine opened this issue Aug 15, 2016 · 11 comments
Open

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

Malwine opened this issue Aug 15, 2016 · 11 comments

Comments

@Malwine
Copy link
Member

Malwine commented Aug 15, 2016

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.

@yokolet
Copy link
Member

yokolet commented Aug 15, 2016

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

@Malwine
Copy link
Member Author

Malwine commented Sep 28, 2016

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

@yokolet
Copy link
Member

yokolet commented Oct 28, 2016

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.

@Malwine Malwine added the ruby label Nov 11, 2016
@Malwine
Copy link
Member Author

Malwine commented Apr 10, 2017

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.

@Malwine Malwine self-assigned this Apr 10, 2017
@Malwine Malwine changed the title Write a script to update site.time Write a script to update site.time and add TRAVIS CI Apr 10, 2017
@Malwine
Copy link
Member Author

Malwine commented Apr 10, 2017

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

@Malwine
Copy link
Member Author

Malwine commented Apr 11, 2017

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?

@davidchambers
Copy link
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! 🎉

@Malwine
Copy link
Member Author

Malwine commented Apr 11, 2017

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)

@Malwine Malwine removed their assignment Apr 23, 2017
@davidchambers
Copy link
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.

@davidchambers
Copy link
Contributor

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

@davidchambers
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants