Skip to content

Instantly share code, notes, and snippets.

@totten
Created April 29, 2016 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save totten/7abeb9eb9558c5bc9d4105b40c19b1e5 to your computer and use it in GitHub Desktop.
Save totten/7abeb9eb9558c5bc9d4105b40c19b1e5 to your computer and use it in GitHub Desktop.
### Jenkins Job
### Name: Tool-Publish-civix
### Source code management: git, https://github.com/totten/civix.git
### Build trigger: Poll SCM every 10 minutes
### Build script:
#!/bin/bash
set -ex
#### Config
PROGRAM=civix.phar
TMPFILE=bin/civix.phar
PUBLISH_DIR=/var/www/download.civicrm.org/public/civix
REVISION=$(date +'%Y-%m-%d')-$(git rev-parse HEAD | head -c8)
PHP=/opt/php/5.4.45/bin/php
export PATH=$HOME/buildkit/bin:$PATH
#### Build it
[ -d vendor ] && rm -rf vendor
[ -f "$TMPFIE" ] && rm -f "$TMPFILE"
$PHP `which composer` install --no-scripts
$PHP -dphar.readonly=0 `which box` build
#### Publish
mv "$TMPFILE" "${PUBLISH_DIR}/${PROGRAM}-${REVISION}"
pushd "${PUBLISH_DIR}"
[ -L "${PROGRAM}" ] && rm -f "${PROGRAM}"
ln -s "${PROGRAM}-${REVISION}" "${PROGRAM}"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment