Raised This Month: $ Target: $400
 0% 

Travis CI + Sourcemod


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Toastbrot_290
SourceMod Donor
Join Date: Apr 2013
Old 05-01-2015 , 14:07   Travis CI + Sourcemod
Reply With Quote #1

I just started to switch from bitbucket to github and recognized that many developers use travis for testing their plugins against sourcemod compiler. Because I never worked with travis and couldn't find a tutorial for using it with sourcemod easily, i read their docs, created a configuration that fits to all of my plugins and posted it here.

Code:
language: c

env: 
  global:
    - INCLUDE=addons/sourcemod/scripting/include/
    - SCRIPTING=addons/sourcemod/scripting/
    - PLUGINS=addons/sourcemod/plugins/
    - HOME=ftp.toastdev.de/plugins
  matrix:
    - SOURCEMOD=1.7.1

before_install:
  - sudo apt-get update
  - sudo apt-get install gcc-multilib
  - sudo apt-get install lynx
  - sudo apt-get install lib32stdc++6
  - mkdir build-env

install:
  - cd build-env
  - wget http://sourcemod.gameconnect.net/files/sourcemod-$SOURCEMOD-linux.tar.gz
  - tar -xzvf sourcemod-$SOURCEMOD-linux.tar.gz
  - cd ../
  - find build-env/addons/sourcemod/scripting/ -name "*.sp" -type f -delete
  - cp -rv $SCRIPTING/. build-env/addons/sourcemod/scripting/
  - cp -rv $INCLUDE/. build-env/addons/sourcemod/scripting/include/

before_script:
  - chmod +rx build-env/addons/sourcemod/scripting/spcomp
  - chmod +rx build-env/addons/sourcemod/scripting/compile.sh
  - cd build-env/addons/sourcemod/scripting/
  
script:
  - ./compile.sh
  
after_success:
  - cd ../../../..
  - cp -rv build-env/addons/sourcemod/scripting/compiled/. $PLUGINS
  - cd $PLUGINS
  - find . -type f -exec curl --user $FTPUSER:$FTPPASS --ftp-create-dirs -T {} ftp://$HOME/$SOURCEMOD/{} \;
Configuration
You have to upload the custom includes, that your plugin needs, to your repo.
Then you have to set the env vars. The global one are holding the paths to your custom includes and sp files. Those are relative to your repo root. Also you can set the versions of sourcemod to test against. If you define multiple versions, multiple tests will be triggered.
For auto deployment you also need to set repo vars FTPUSER and FTPPASS.

Auto Deployment
This file contains a auto deployment after successfull build. This can be used for providing up to date downloads or pushing the plugin to test server for future tests. Anyway it has to get modified in most cases. Therefor you can edit HOME var and/or the last line (ftp://$HOME/$SOURCEMOD/) which holds the destination. If you don't need it simply remove the after_sucess part.

Example

Maybe somone can make use of it.
__________________

Last edited by Toastbrot_290; 05-01-2015 at 14:12.
Toastbrot_290 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode