pipenvで作った環境をBitbucketのPipelinesでテストする
会社ではBitbucketを使ってgit管理しています。BitbucktにはPipelinesというCIツールがあります。
最近は主にpythonで開発していて、パッケージ管理をpipenvを使うようになったのですが、Bitbucketでテストする時にはbitbucket-pipelines.ymlに以下のような設定をすると良いようでした。
# This is a sample build configuration for Python. # Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples. # Only use spaces to indent your .yml configuration. # ----- # You can specify a custom docker image from Docker Hub as your build environment. image: python:3.6.3 pipelines: default: - step: caches: - pip script: # Modify the commands below to build your repository. - pip install pipenv --upgrade - pipenv install --dev --deploy --system - python -m unittest
とりあえずこれで気兼ねなくテストを書けるので捗りそうですね。