Atlassian Bamboo with Django & Python - Possible?

后端 未结 4 1221
没有蜡笔的小新
没有蜡笔的小新 2021-01-30 03:33

At my company, we currently use Atlassian Bamboo for our continuous integration tool. We currently use Java for all of our projects, so it works great.

However, we are

4条回答
  •  面向向阳花
    2021-01-30 04:08

    You can even add a bootstrap for pip and virtualenv on a clean environment quite easily, which is cool:

    wget https://bootstrap.pypa.io/get-pip.py
    python get-pip.py --root=${bamboo.build.working.directory}/tmp --ignore-installed
    export PATH=${bamboo.build.working.directory}/tmp/usr/local/bin:$PATH
    export PYTHONPATH=${bamboo.build.working.directory}/tmp/usr/local/lib/python2.7/dist-packages:$PYTHONPATH
    pip install --root=${bamboo.build.working.directory}/tmp --ignore-installed virtualenv
    virtualenv virtual_tmp
    cd virtual_tmp
    . bin/activate
    echo Pip is located `which pip`
    pip install django
    pip install djangorestframework
    

    Warning, source bin/activate does not work as the inline script tasks are stored into an sh file (so bash run it in sh compatibility mode).

    Edit

    Even better, we can run unit tests on the top of it, with xml outputs that can be parsed by the JUnit of bamboo:

    pip install unittest-xml-reporting
    python manage.py test --noinput --testrunner="xmlrunner.extra.djangotestrunner.XMLTestRunner"
    

提交回复
热议问题