пятница, 6 июня 2014 г.

Two words about continuous integration for mono projects


Github has a great continuous integration system called Travis.CI. I use it for HyperFastCgi server to check that solution correctly builds after commit and I am going to use it for unit-tests in future. Travis.CI has a very simple configuration syntax, for example HyperFastCgi travis.yml file looks like that

language: c

before_install:
    #add badgerpots ppa key
    - wget http://badgerports.org/directhex.ppa.asc
    - sudo apt-key add directhex.ppa.asc
    #add bagderport repository
    - sudo apt-get install python-software-properties
    - sudo add-apt-repository "deb http://badgerports.org $(lsb_release -sc) main"
    - sudo apt-get update
    #install mono
    - sudo apt-get install mono-devel

script:
    - ./autogen.sh --prefix=/usr
    - make
    - sudo make install

Yesterday I've found, that drone (analogue of Travis.CI) made support for GitLab (analogue of Github) two month ago. So now you can run Github-like version control with Travis-like continuous integration for your private projects without using github and travis. I did not try to install drone to my gitlab server yet, but if it works without serious issues it's a really, really cool!

воскресенье, 1 июня 2014 г.

Running ASP.NET vNext on mono/linux

This is a quick starting guide to run "Hello, world" ASP.NET vNext app on mono/linux.

Installing mono 3.4.1

At first, you need to compile the latest mono version from sources. Sources are located at http://github.com/mono/mono. You can follow the docs on the main page, but BEWARE of using --prefix=/usr/local as option of autogen.sh file! Before doing it check where is your system mono installed. You can check it with which command.

$ which mono
/usr/bin/mono

If mono is located in /usr/bin (for example Ubuntu holds it there) then you should change prefix to --prefix=/usr otherwise you'll get two different mono installation and could run into the issues "where is the proper library located?". If you use Ubuntu, you can run this script. It'll install mono, xsp (mono web server) and monodevelop IDE.

Installing ASP.NET vNext

Run the following commands:

wget https://raw.githubusercontent.com/graemechristie/Home/KvmShellImplementation/kvmsetup.sh 
chmod a+x kvmsetup.sh
./kvmsetup.sh
source ~/.kre/kvm/kvm.sh
kvm upgrade

Running "Hello, world!" application

git clone https://github.com/davidfowl/HelloWorldVNext
cd HelloWorldVNext
git submodule update --init
kpm restore
cd src/helloworldweb
k web-firefly

It will start the web application at localhost:3001. To change host and port edit the file firefly/src/main/Firefly/ServerFactory.cs at line 30. Put there your host and port. No need to compile, just run k web-firefly again

You can also try to run Nowin host with the command k web, but due to the issue with sockets, you can run only ~1000 requests to your web server