I have 3 python packages proj1
, proj12
and proj13
. Both proj12
and
proj13
depend on proj1
(with from proj1.xxx import yyy
).
The 3 projects are on a private gitlab instance, each one has it's own .gitlab-ci
.
In proj1 http://gitlab.me.com/group/proj1/.gitlab-ci.yml
we run unittest
and create a wheel exposed as an artifact::
# http://gitlab.me.com/group/proj1/.gitlab-ci.yml
image: python:2
mytest:
artifacts:
paths:
- dist
script:
- apt-get update -qy; apt-get install -y python-dev python-pip
- pip install -r requirements.txt
- python setup.py test
- python setup.py bdist_wheel
look:
stage: deploy
script:
- ls -lah dist
For proj12 and proj13 in e.g.
http://gitlab.me.com/group/proj12/.gitlab-ci.yml
we would like to run tests
too, but I need to install proj1
wheel to make it run.
All 3 projects are in the same gitlab private group.
What is the gitlab way to do this ?
proj1
wheel to the proj12
with an artifact
http://gitlab.me.com/group/proj12/.gitlab-ci.yml
? It's the same gitlab, the
same group, but a different project.proj2
in proj12/.gitlab-ci.yml
?
proj1
, proj12
and
proj13
are in the same gitlab and same group, the person who do the build
for one project as credentials to do the others. All 3 are connected by the user private token.I try to avoid to have to deploy devpi or pypiserver like solutions.
So I'm looking on what to write in the proj12 .gitlab-ci.yml
to get the
dist/proj1-0.42-py2-none-any.whl
wheel from the proj1 precedent build::
# http://gitlab.me.com/group/proj12/.gitlab-ci.yml
image: python:2
mytest12:
script:
- apt-get update -qy; apt-get install -y python-dev python-pip
- pip install -r requirements.txt
- pip install .
- => some way here to get the proj1 wheel
- pip install proj1-0.42-py2-none-any.whl
- python setup.py test
Links related to our issue:
GitLab Continuous Integration and Delivery automates all the steps required to build, test and deploy your code to your production environment. Continuous integration automates the builds, provides feedback via code review, and automates code quality and security tests.
GitLab CI is a continuous integration and continuous delivery & deployment (CI/CD) server. It helps agile teams to test code from a concentrated area, all while furnishing built-in integration with Git repositories.
A pipeline is usually triggered by a source code repository. Changes in code activate a notification in the CI/CD pipeline tool, which operates the corresponding pipeline. Other triggers you might see frequently include user-initiated or automatically scheduled workflows, as well as results of other pipelines.
CD Pipeline prerequisites To get started, you need to set up an Ubuntu 18.04 server along with a sudo non-root user and firewall. You also need at least 1 GB RAM and 1 CPU. Docker must be installed on the server. A user account on a GitLab instance with an enabled container registry.
You have two ways you can do it:
I would advise passing as an artifact since then you will have it build exactly in the pipeline you are running. As for the cloning, AFAIK you don't need any workaround when cloning submodules but for cloning other repositories I would go with ssh deploy key as it's connected with a repo and not a user like the private token.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With