{"id":2050,"date":"2013-04-24T18:51:38","date_gmt":"2013-04-24T16:51:38","guid":{"rendered":"http:\/\/planetozh.com\/blog\/?p=2050"},"modified":"2013-04-24T18:53:51","modified_gmt":"2013-04-24T16:53:51","slug":"how-to-nightly-build-from-svn-repository","status":"publish","type":"post","link":"https:\/\/planetozh.com\/blog\/2013\/04\/how-to-nightly-build-from-svn-repository\/","title":{"rendered":"How-to: generate nightly builds from a SVN repository"},"content":{"rendered":"<p>As you might know, <a href=\"http:\/\/yourls.org\/\">YOURLS<\/a> development is now <a href=\"https:\/\/github.com\/YOURLS\/YOURLS\">hosted on Github<\/a>. It&#39;s now easy to download the current development snapshot, since Github provides an <tt>archive\/master.zip<\/tt>.<\/p>\n<p>But not so long ago, YOURLS dev was hosted <a href=\"http:\/\/code.google.com\/p\/yourls\/\">on Google Code<\/a>, where there is no such convenient way to download the current SVN trunk as a <tt>.zip<\/tt> archive. To generate &quot;nightly builds&quot;, I wrote this little script:<\/p>\n<div class=\"igsh-code-box\" id=\"ig-sh-1\"><pre class=\"language-bash line-numbers\" data-no-optimize=\"1\" data-cfasync=\"false\"><code class=\"language-bash\">#!\/bin\/bash\r\n# Simple bash script to generate YOURLS nightly builds\r\n\r\n# Export in a year-month-day directory\r\nPWD=&quot;\/home\/ozh\/yourls.org\/nightly-builds&quot;\r\nBUILD=$(date +%Y-%m-%d)\r\nsvn -q export http:\/\/yourls.googlecode.com\/svn\/trunk\/ $PWD\/$BUILD\r\n\r\n# Make package and remove dir\r\ncd $PWD\r\nzip -r -q yourls-$BUILD.zip $BUILD\r\nrm -rf $BUILD\r\n\r\n# Remove old (&gt;7 days) builds\r\nfind $PWD\/*zip -mtime +7 -exec rm {} \\;<\/code><\/pre><\/div>\n<p>Now you just need to add the script to your cron jobs and call it every night.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As you might know, YOURLS development is now hosted on Github. It&#39;s now easy to download the current development snapshot, since Github provides an archive\/master.zip. But not so long ago, YOURLS dev was hosted on Google Code, where there is no such convenient way to download the current SVN trunk as a .zip archive. To generate &quot;nightly builds&quot;, I wrote\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[5,2,359],"class_list":["post-2050","post","type-post","status-publish","format-standard","hentry","category-published","tag-bash","tag-code","tag-yourls"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/2050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=2050"}],"version-history":[{"count":9,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/2050\/revisions"}],"predecessor-version":[{"id":2059,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/2050\/revisions\/2059"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=2050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/categories?post=2050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/tags?post=2050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}