Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Fb automate version #204

Merged
merged 5 commits into from
Sep 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Automated Version Bump
  • Loading branch information
febg-codecov committed Sep 21, 2019
commit 579012a8b6b53ad3e83f75428bedfc0be3fcf67e
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@ notifications:
sudo: false
before_install:
- tar zxvf shunit2-2.1.6.tgz
script: env -i PATH="$PATH" tests/test

stages:
- name: deploy
if: branch = Version Bump

jobs:
include:
- stage: Test
script: env -i PATH="$PATH" tests/test
- stage: Version Bump
script: bash version.sh
32 changes: 32 additions & 0 deletions version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

set -x

short_git=$(git rev-parse --short HEAD)
echo $short_git
date=`date +%Y%m%d`
_version="$date-$short_git"


change_file () {
sed -i -e "s|.*VERSION=.*|VERSION=\"$_version\"|g" codecov
rm codecov-e
}

checkout_branch () {
git fetch
git checkout $1
git pull
}

commit_and_upload () {
git add codecov
git commit -m "Version $_version Release"
git remote rm origin
git remote add origin https://codecov:${GH_TOKEN}@github.com/codecov/codecov-bash.git
git push origin master --quiet
}

checkout_branch "production"
change_file
commit_and_upload