finishing the gitlab integration

This commit is contained in:
Kim Neunert 2019-12-09 11:43:33 +01:00
parent 9e7c08816b
commit efab27450f
4 changed files with 45 additions and 24 deletions

View file

@ -1,6 +1,6 @@
# this image contains python, bitcoind and docker
# check docker/python-bitcoind on how it's built
image: registry.gitlab.com/k9ert/specter-desktop/python-bitcoind:latest
image: registry.gitlab.com/cryptoadvance/specter-desktop/python-bitcoind:latest
variables:
# Cache documentation: https://docs.gitlab.com/ee/ci/caching/

View file

@ -1,3 +1,4 @@
This Dockerimage is manually created and uploaded:
docker build -t registry.gitlab.com/k9ert/specter-desktop/python-bitcoind .
docker build -t registry.gitlab.com/cryptoadvance/specter-desktop/python-bitcoind .
docker push registry.gitlab.com/cryptoadvance/specter-desktop/python-bitcoind .

View file

@ -0,0 +1,42 @@
# introduction
specter-desktop is using gitlab and Travis-CI for continuous integration purposes. Both have advantages and disadvantages so ... let's use both!
Gitlab:
* is completely open Source for server- and clients
* the gitlab-runner can run docker and is itself running on docker
* but does not support Pull-Requests
* needs to have bitcoind in a prepared docker-container which binds the build to that version
Travis-CI:
* supports the PR-model
* quite easy to setup even without docker
* enables to test against any specific version of bitcoind we would like to
# Gitlab
Gitlab is a great CI/CD-platform and in the meantime it's quite easy to use it for github-repositories.
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/github_integration.html
The main file which specifies the jobs on gitlab is .gitlab-ci.yml
We're using a gitlab-docker-runner which means that all jobs are running in a container.
However at the same time we're using docker to spinup a bitcoind.
The image is created manually (see /docker) and used for running the tests AND also for
spinning up bitcoind.
For that reason we need to share the docker-socket from the host into the container and
create our own gitlab specific runner as described here:
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-socket-binding
Due to that setup there are some specifics which are mainly addressed in tests/conftest
start_bitcoind-function:
* some pytest specific stuff to enable "pytest --docker" (used in .gitlab-ci.yml)
* adding -rpcallowip= (from a docker network) to bitcoind
* not use localhost but the docker-network-ip-address when talking to the bitcoind
# Travis-CI
Travis-CI setup is very straightforward. As we're using the build-cache, the bitcoind sources and build is cached. Therefore such a build would only take 2 minutes. If the master-branch has new commits, bitcoind gets automatically rebuilt and the tests are running against the new version (tests/install_bitcoind.sh).
# Summary
It's great to use both systems but it would be better to have the fixed version (as in the dockerimages of gitlab) in the PRs and the updated tests against the newest version (as in install_bitcoind.sh used by travis-CI) for daily/monthly builds.
Anyway, good enough for now.

View file

@ -1,22 +0,0 @@
# introduction
Gitlab is a great CI/CD-platform and in the meantime it's quite easy to use it for github-repositories.
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/github_integration.html
The main file which specifies the jobs on gitlab is .gitlab-ci.yml
We're using a gitlab-docker-runner which means that all jobs are running in a container.
However at the same time we're using docker to spinup a bitcoind.
The image is created manually (see /docker) and used for running the tests AND also for
spinning up bitcoind.
For that reason we need to share the docker-socket from the host into the container and
create our own gitlab specific runner as described here:
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-socket-binding
Due to that setup there are some specifics which are mainly addressed in tests/conftest
start_bitcoind-function:
* some pytest specific stuff to enable "pytest --docker" (used in .gitlab-ci.yml)
* adding -rpcallowip= (from a docker network) to bitcoind
* not use localhost but the docker-network-ip-address when talking to the bitcoind