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.
__________________