Skip to content

Conversation

@Gathros
Copy link
Contributor

@Gathros Gathros commented Apr 28, 2018

No description provided.

@Butt4cak3
Copy link
Contributor

I suggest a few changes to make the script more flexible and catch some possible errors:

  • Make the output directory (../algorithm-archive.github.io) configurable. One way would be via an environment variable. Then you could either run AAA_DIR=../algorithm-archivists.github.io update_site.sh "..." or add the environment variable permanently.
  • Check that the output directory exists before even building the site.
  • Run git reset --hard, git clean -dfx and git pull in the output directory to make sure that it's clean and the push operation won't fail.
  • Check if both the build and the copy operation from /tmp to the output dir succeeded before proceding with the commit.
@Butt4cak3
Copy link
Contributor

I reviewed and refined the script together with @Gathros and I'd say it's ready to use.

The command syntax is

./update_site.sh <commit_message> [pages_repo] 

where pages_repo is the path to your local "algorithm-archivists.github.io" repository. You can alternatively set this path with an environment variable called "AAA_DIR".

@leios
Copy link
Member

leios commented Apr 28, 2018

Cool! Thanks a lot for all the help! This is super useful.

@leios leios merged commit c92a09b into algorithm-archivists:master Apr 28, 2018
@Gathros Gathros deleted the UpdateSitePR branch April 29, 2018 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants