2018-07-09 08:03:44 -06:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
docker:
|
|
|
|
- image: arednmesh/builder
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Update Config.mk
|
|
|
|
command: |
|
2018-07-09 12:08:22 -06:00
|
|
|
export MY_WORKING_DIRECTORY=`pwd`
|
|
|
|
ls -la
|
|
|
|
sed -i "s/NoCall/${CIRCLE_PROJECT_USERNAME}-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}/g" ${MY_WORKING_DIRECTORY}/config.mk
|
|
|
|
cat ${MY_WORKING_DIRECTORY}/config.mk
|
2018-07-09 08:03:44 -06:00
|
|
|
set
|
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: make
|
|
|
|
- run:
|
|
|
|
name: Compress build files
|
2018-07-09 12:08:22 -06:00
|
|
|
command: tar -cjf ~/${ARTIFACTS_FILE} -C ${MY_WORKING_DIRECTORY}/${ARTIFACTS_DIR} .
|
2018-07-09 08:03:44 -06:00
|
|
|
- run:
|
|
|
|
name: Deploy Files
|
2018-07-09 12:08:22 -06:00
|
|
|
command: scp -o StrictHostKeyChecking=no ~/${ARTIFACTS_FILE} ${SSH_USER}@${SSH_HOST}:~/
|
2018-07-09 08:03:44 -06:00
|
|
|
- run:
|
2018-07-09 13:50:17 -06:00
|
|
|
name: Untar Files
|
2018-07-09 08:03:44 -06:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'tar -xjf ~/${ARTIFACTS_FILE} -C ~/'"
|
2018-07-09 13:50:17 -06:00
|
|
|
- run:
|
|
|
|
name: Remove tarball
|
2018-07-09 08:03:44 -06:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'rm ~/${ARTIFACTS_FILE}'"
|
2018-07-09 13:50:17 -06:00
|
|
|
- run:
|
|
|
|
name: Empty nightly dir
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'rm -rf ${NIGHTLY_DIR}'"
|
|
|
|
- run:
|
|
|
|
name: Move targets
|
2018-07-09 08:03:44 -06:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mv ~/targets ${NIGHTLY_DIR}'"
|
2018-07-09 13:50:17 -06:00
|
|
|
- run:
|
|
|
|
name: Move packages
|
2018-07-09 12:08:22 -06:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mv ~/packages ${NIGHTLY_DIR}'"
|