From aa4bb40ebb13113c3fef2e3fbd14245af9e44c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cruz?= Date: Wed, 27 Dec 2017 18:00:50 +0100 Subject: [PATCH] chore: triggers homebrew formula update --- .travis.yml | 19 ++++++++++----- deploy.sh | 61 ------------------------------------------------- deploy_key.enc | Bin 3248 -> 0 bytes 3 files changed, 13 insertions(+), 67 deletions(-) delete mode 100755 deploy.sh delete mode 100644 deploy_key.enc diff --git a/.travis.yml b/.travis.yml index e36c91c..3414807 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,24 @@ language: generic -script: "./deploy.sh" -env: - global: - - ENCRYPTION_LABEL: ea50756eca0f - - secure: BCvgps08hfR/bTBExS5AorCihffUuhskgfOH2p926u+xBObKHVS9dwsp8n2W+XlxCDCjXWUQtmbGlPi1eOKZnlfL8i6cMEa7ZAzjcGb8EGicwySA/zVNeb4eNzMhsFJGP4+T61zVi0uQNBFSEuFnpVftpBahafFf3/FZlj+9CvgEl9J6QTBU00aOHe1CXeAfqCtQLMpNYfJdqAWEnGpEouW4zb06ulkcOqNE87wn8y0R2kcvMb05pmIaYoMlStp/8M3NEJpTAgMTW0vnpX6pGOw7Z52K16m3SCIn7yeB+9r0+6buZLNevWAHxXMVCtADH3LoKy6OaFfs5BqBZGbCYgQPHeFOoEig78scptpm8IFLMTrydOe4Bi0bd+IYdEQ2Ns4CeDnSB16mPF+pyN+U9NHDoiguqvwA4PfC1J12oaD1tZFGTDTllPpkvo5WQIsfFWG8z1gYfBZROJ3RUBTIlakFjbtSYSxXAA+m1DL251CyKzbpJaVbi4JmAG5sD+ixiRlq9Y1vtdYxQ5CeB21o+bPvmv23Tn4OtP9MSP//lA55c5MGJjiQmlyaZfNNszeCrpnw6rkHguDSeAXMca76xBpEjSckDTsDKE52zF3eGIJYg1fvQTh5xYoyeYd/1DEL2xNsIaPmnl1v5bYwKEGxR5BP/IoPLwr8ZV+NBNh+658= branches: only: - master +before_deploy: + - git config --global user.email "rcruzper@gmail.com" + - git config --global user.name "Travis CI" + - GIT_TAG=`git describe --abbrev=0 --tags | awk -F'[.]' '/^v/ {print $1"."$2"."$3+1}'` + - OLD_VERSION=`git describe --abbrev=0 --tags | awk -F'[.]' '/^v/ {print $1"."$2"."$3}' | cut -c 2-` + - NEW_VERSION=`git describe --abbrev=0 --tags | awk -F'[.]' '/^v/ {print $1"."$2"."$3+1}' | cut -c 2-` + - SHA256=`shasum -a 256 kps | cut -c -64` + - git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER" deploy: provider: releases api_key: - secure: U1d+r8okigRkYYqVBs+lDqSFyuBTkvb1q7RD67JuupJdqSfW1tLFA62ruRwJJ2SJyhUPozs4CTUow/AvhJ2/WEtkYVDTxyRU4TF+QZm2Xtv2lSowyHBmyCCmBTqzj49g2mWpWcH9CW2zeIXQg/dq41bkmcSZRixYQijgTAuAkCATnIcWJ0mN3WqKSugrGI0AureJWtDfosCfFRBOqcp4WeXwwvn0v4JuMNX132tDd8Zel/9mHsbDbW93unlfdQ4nlXB4TgjOoFVo+WBLOBUfgbBaMXgmglAB0w1/ccCZnC2CjfXXMbNwoS3VtRNG9tb1cMoQqPlcjaRbZFDMV2BZlpqfWY3L8QJDFmVaTIiU0aBb1tWjXrOuyGgRlpN/hYXwePlTR+eNXzdQJHChRU+l2apC6xnQWrjjyiMkEX974ej45onuvVfdntPHBD4/UUY3luhJaO+MYj/xc/z3SbNdMMp/dcogWH9dtqsiTUwSHI9FY6IqXE4/1nwohWNON3eSDwlVHz4yCWeLtnvIphS229+3BlyYEOzgGrHasEO97xG2GiAavGL8bPeLKBlMnmo+0EsRfO2OfkQjp9BCreBfHloV/TjXTv9d/trOBnt+337RnNqWleK7oX9tG6XIEmOQzdKA/3PMo/xvUWV6K3eTNTBRSU0HWcfwhdNsXsXJ9s4= + secure: eGHtNhkIFp9gIDblFjlO23oefKeEGagKJjnS2ulcUcZ8z/K/49K51EG9ldT79HF14HrOT6gnGW8cQQoFSW/MHs5dMYVhHiOVOLNHZQlNK7UPMdUDa3FFO5tkMAAjWnU+B0VJY2WdD8KBgilPoqiv+N1//lyY8D69H/w4d9RdIyjlwLHXsjnvo+VWuMFXkWr8VikXAckIfHnw0tst7NSRW7Bpn1WbvlpwWEyXrRuO402y/OcAaqTKWh3WLPER+mulOQZbWZUm/L+F4reO481R2byIX5wIIc+EWln6ju2E36GfVMLznJkSWhrJapWqOQruXcp0EszKZCudrBz/BbwaOxSPWB6cDimvdKQ3L2DHsGstpB9TvBAb3LO/sBWlziBtXTAb0Dax+AfgWDWTYl4OQRFnYzrHEdrKYoKxfyzA7r/jBvcJ+djhqqX94CTuK9UCYMxIAK3oQDfBFsJOYTYmEP5xtIPbpxeiQ4roiucIW17BmaDRcvHJWfptDJfG/CbH9YDvDsMZXVWWGsoSaVg3aIQdWJ8nSDDRSxtJji9pe7UM25tlM1jfJI79UOpHwSVPg8MzeYU89qb7JB0Lh1WseC4d9BAQWGdSyrppaNbnJV2a1k9O4ZulWhmZ/rIBuPUucWVZn6NKbZaq7gfaBy0MN2bZOU5b3h9icbQSmR4VMyM= file: kps skip_cleanup: true on: condition: "$TRAVIS_TEST_RESULT == 0" + repo: rcruzper/kps +after_deploy: + - body="{\"request\":{\"version\":\"master\",\"config\":{\"env\":{\"old_version\":\"$OLD_VERSION\",\"formula\":\"kps\",\"new_version\":\"$NEW_VERSION\",\"sha256\":\"$SHA256\"}}}}" + - curl -s -X POST -H "Content-Type:application/json" -H "Accept:application/json" -H "Travis-API-Version:3" -H "Authorization:token $TRAVIS_API_TOKEN" -d "$body" https://api.travis-ci.org/repo/rcruzper%2Fhomebrew-tools/requests diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 415a42f..0000000 --- a/deploy.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -set -e # Exit with nonzero exit code if anything fails - -if git diff-tree --no-commit-id --name-only -r HEAD; then - echo 'kps code changed, creating release' - - git pull --tags - # Save some useful information - REPO=`git config remote.origin.url` - SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} - OLD_VERSION=`git describe --tags $(git rev-list --tags --max-count=1) | awk -F'[.]' '/^v/ {print $1"."$2"."$3}' | cut -c 2-` - NEW_VERSION=`git describe --tags $(git rev-list --tags --max-count=1) | awk -F'[.]' '/^v/ {print $1"."$2"."$3+1}' | cut -c 2-` - SHA256=`shasum -a 256 kps | cut -c -64` - - # Set config - git config --global user.email "rcruzper@gmail.com" - git config --global user.name "Travis CI" - - # Create git tag - GIT_TAG=`git describe --tags $(git rev-list --tags --max-count=1) | awk -F'[.]' '/^v/ {print $1"."$2"."$3+1}'` - git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER" - - # Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc - ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" - ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" - ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} - ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} - openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d - chmod 600 deploy_key - eval `ssh-agent -s` - ssh-add deploy_key - - # Now that we're all set up, we can push. - git push $SSH_REPO --tags - - body="{ - \"request\": { - \"version\":\"master\", - \"config\": { - \"env\": { - \"old_version\":\"$OLD_VERSION\", - \"formula\":\"kps\", - \"new_version\":\"$NEW_VERSION\", - \"sha256\":\"$SHA256\" - } - } - } - }" - - curl -s -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVIS_API_TOKEN}" \ - -d "$body" \ - https://api.travis-ci.org/repo/rcruzper%2Fhomebrew-tools/requests -else - echo 'kps code does not changed' - exit 1 -fi \ No newline at end of file diff --git a/deploy_key.enc b/deploy_key.enc deleted file mode 100644 index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