TravisCI Push Dev to Master on Success

In the Software Engineering course I’m taking we were given a .travis.yml and makefile to help us automate our project deployment. By default even thought the makefile would notice missing files, the TravisCi testing would pass. So I ended up modifying the makefile to have it fail and force the TravisCI announce the broken build. I also added a new step which on a successful deployment would automatically merge the Dev and Master branches. 


   @for i in $(FILES);                                        \
   do                                                         \
     if [ -e $$i ]; then echo "$$i found" ; else touch .failed && echo "$$i NOT  FOUND" ; fi \
   done ;                                                      \
   if [ -e .failed ]; then exit 1; else echo "Found all"; fi

ifeq ($(TRAVIS_BRANCH),dev)
    git config --global ""
    git config --global "Marek5050"
    git remote set-branches --add origin master
    git fetch
    git reset --hard
    git checkout master --force 
    git merge --no-ff --no-edit dev
    git push origin master


    - make collatz-tests
    - make Collatz.html
    - make Collatz.log
    - make test
    - make check
    - make push


Original post on Github




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s