Skip to content
Snippets Groups Projects
Commit ef99707b authored by Sett's avatar Sett
Browse files

Add ska_logging dependency

`lmcbaseclass` package now depends on `ska_logging` package (SAR-54).

- the `ska-logging` package is available from our nexus repository which requires `--extra-index-url` not supported by `python setup.py`
- install latest pip via `get-pip.py` script due to issues with `--extra-index-url`
- new manually triggered job to publish docker image
parent 77723f48
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,12 @@ stages: ...@@ -24,6 +24,12 @@ stages:
- linting - linting
- publish - publish
- pages - pages
- release
.install_pip: &install_pip |-
apt-get -y update && apt-get install -yq curl python3-distutils
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py
clean shell runner: clean shell runner:
stage: .pre stage: .pre
...@@ -62,13 +68,12 @@ unit tests: ...@@ -62,13 +68,12 @@ unit tests:
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
before_script: before_script:
- docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
- *install_pip
tags: tags:
- docker-executor - docker-executor
script: script:
- apt-get -y update
- apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends
- echo $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) - echo $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA)
- pip3 install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) - pip3 install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
- make test - make test
- scripts/validate-metadata.sh - scripts/validate-metadata.sh
artifacts: artifacts:
...@@ -80,13 +85,12 @@ linting: ...@@ -80,13 +85,12 @@ linting:
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
before_script: before_script:
- docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
- *install_pip
tags: tags:
- docker-executor - docker-executor
script: script:
- apt-get -y update
- apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends
- echo $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) - echo $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA)
- pip3 install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) - pip3 install -U $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA) --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
- make lint - make lint
artifacts: artifacts:
paths: paths:
...@@ -111,6 +115,22 @@ publish to nexus: ...@@ -111,6 +115,22 @@ publish to nexus:
# Confirm semantic versioning of tag # Confirm semantic versioning of tag
- $CI_COMMIT_TAG =~ /^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/ - $CI_COMMIT_TAG =~ /^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$/
release docker image:
stage: release
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
before_script:
- docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
tags:
- docker-executor
script:
- make build
- make push
when: manual
only:
refs:
- master
pages: pages:
stage: pages stage: pages
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
...@@ -121,7 +141,6 @@ pages: ...@@ -121,7 +141,6 @@ pages:
script: script:
- cp -R build public - cp -R build public
- mv public/lmcbaseclasses_htmlcov/* public - mv public/lmcbaseclasses_htmlcov/* public
- make push
artifacts: artifacts:
paths: paths:
- public - public
...@@ -75,7 +75,7 @@ release: check-status check-release build push ...@@ -75,7 +75,7 @@ release: check-status check-release build push
push: pre-push do-push post-push ## push the image to the Docker registry push: pre-push do-push post-push ## push the image to the Docker registry
do-push: do-push:
# docker push $(IMAGE):$(VERSION) docker push $(IMAGE):$(VERSION)
docker push $(IMAGE):latest docker push $(IMAGE):latest
snapshot: build push snapshot: build push
......
release=0.2.0 release=0.3.0
tag=lmcbaseclasses-0.2.0 tag=lmcbaseclasses-0.3.0
...@@ -6,6 +6,5 @@ FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:latest AS runtime ...@@ -6,6 +6,5 @@ FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:latest AS runtime
RUN ipython profile create RUN ipython profile create
# A temporary workaround until system team can investigate why 'pipenv install -e .' doesn't work # A temporary workaround until system team can investigate why 'pipenv install -e .' doesn't work
RUN python setup.py install RUN pip install -e . --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
CMD ["/venv/bin/python", "/app/skabase/SKABaseDevice/SKABaseDevice.py"] CMD ["/venv/bin/python", "/app/skabase/SKABaseDevice/SKABaseDevice.py"]
...@@ -39,6 +39,7 @@ setuptools.setup( ...@@ -39,6 +39,7 @@ setuptools.setup(
setup_requires=[] + pytest_runner, setup_requires=[] + pytest_runner,
install_requires=[ install_requires=[
"future", "future",
"ska_logging"
], ],
keywords="lmc base classes ska", keywords="lmc base classes ska",
zip_safe=False) zip_safe=False)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment