Commit 6e8b1663 authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

Merge branch 'AT5-259': No need to import tango or skabase when building the Readthedocs

documentation
parents aba16e07 ca305153
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
*.sav
*.swp
*.py[cod]
*.egg-info
*.eggs
@@ -8,8 +10,6 @@ dist
.cache
__pycache__

Pipfile.lock

htmlcov
.coverage
coverage.xml

.gitlab-ci.yml

0 → 100644
+90 −0
Original line number Diff line number Diff line
# GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application.
# Docker, when used with GitLab CI, runs each job in a separate and isolated container using the predefined image that is set up in .gitlab-ci.yml.
# In this case we use the latest python docker image to build and test this project.
#image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest

variables:
  DOCKER_DRIVER: overlay2

services:
   - docker:dind
# TODO: add file for LOW project
include:
  - local: csp-lmc-common/.gitlab-ci.yml
  - local: csp-lmc-mid/.gitlab-ci.yml

# cache is used to specify a list of files and directories which should be cached between jobs. You can only use paths that are within the project workspace.
# If cache is defined outside the scope of jobs, it means it is set globally and all jobs will use that definition
cache:
  paths:

# before_script is used to define the command that should be run before all jobs, including deploy jobs, but after the restoration of artifacts.
# This can be an array or a multi-line string.
#before_script:
#  - docker login --username $DOCKER_REGISTRY_USERNAME --password $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST

# The YAML file defines a set of jobs with constraints stating when they should be run.
# You can specify an unlimited number of jobs which are defined as top-level elements with an arbitrary name and always have to contain at least the script clause.
# In this case we have only the test job which produce an artifacts (it must be placed into a directory called "public")
# It is also specified that only the master branch will be subject of this job.

# stages:
# build:        build the docker images for csp-lmc-mid and csp-lmc-low
# test:         execute tests on csp-lmc-common, csp-lmc-mid, csp-lmc-low
# package:      create the python packages for common, mid and low
# publish:      publish on nexus the mid and low images and the  common python package
# pages:        create the badges
stages:
  - build
  - test
  - linting
  - publish
  - 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:
  stage: .pre
  tags:
    - docker-executor
  script:
    # Gitlab CI badges creation
    - rm -rf build/*

pages:
  stage: pages
  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
  stage: pages
  only:
    - master
  script:
   - cp -R build public
   - mv build/htmlcov/* public
  artifacts:
    paths:
      - public
    expire_in: 30 days

create ci metrics:
  stage: .post
  image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
  when: always
  tags:
    - docker-executor
  script:
    # Gitlab CI badges creation: START
    - apt-get -y update
    - apt-get install -y curl --no-install-recommends
    - curl -s https://gitlab.com/ska-telescope/ci-metrics-utilities/raw/master/scripts/ci-badges-func.sh | sh
    # Gitlab CI badges creation: END
  artifacts:
    paths:
      - ./build
+118 −0
Original line number Diff line number Diff line
# Local Gitlab-CI file for csp-lmc-common project
 
# 
# Build csp-lmc-common python package
# 

.build_python:
  stage: build
  dependencies: []
  image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
  tags:
    - docker-executor
  artifacts:
    paths:
      - ./$BUILD_PATH/dist/

.build_python_dev:
  extends: .build_python
  dependencies: []
  script:
    - cd $BUILD_PATH
    - python setup.py egg_info -b+dev.$CI_COMMIT_SHORT_SHA sdist bdist_wheel

.build_python_release:
  extends: .build_python
  script:
    - cd $BUILD_PATH
    - python setup.py sdist bdist_wheel

build:csp-lmc-common_pkg_dev: # Executed on a commit
  extends: .build_python_dev
  variables:
    BUILD_PATH: csp-lmc-common

build:csp-lmc-common_pkg:
  extends: .build_python_release
  variables:
    BUILD_PATH: csp-lmc-common
  only: [master]

#
# Build csp-lmc-common image 
#
build:csp-lmc-common_image:
  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
  stage: build
  script:
    - cd $BUILD_PATH      
    - make build
  variables:
    BUILD_PATH: csp-lmc-common/docker

#
# Publish csp-lmc-common python package
#

.publish_python:
  stage: publish
  image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
  variables:
    TWINE_USERNAME: $TWINE_USERNAME
    TWINE_PASSWORD: $TWINE_PASSWORD
  tags:
    - docker-executor
  before_script:
    - pip install twine

.publish_python_dev:
  extends: .publish_python
  except: [master]
  script:
    - cd $BUILD_PATH
    - twine upload --repository-url $PYPI_REPOSITORY_URL dist/* || true

.publish_python_release:
  extends: .publish_python
  only: [master]
  script:
    - cd $BUILD_PATH
    - twine upload --repository-url $PYPI_REPOSITORY_URL dist/* || true
    - twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASS dist/* || true

publish:csp-lmc-common_dev:
  extends: .publish_python_dev
  dependencies:
    - build:csp-lmc-common_pkg_dev
  variables:
    BUILD_PATH: csp-lmc-common

publish:csp-lmc-common:
  extends: .publish_python_release
  dependencies:
    - build:csp-lmc-common_pkg
  variables:
    BUILD_PATH: csp-lmc-common

#
# Release csp-lmc-common image on nexus
#
release csp-lmc-common image:
  tags:
    - docker-executor
  stage: release
  dependencies:
    - build:csp-lmc-common_image
  script:
    - cd $BUILD_PATH      
    - make push
  when: manual
  only:
    refs:
      - master
  variables:
    BUILD_PATH: csp-lmc-common/docker

csp-lmc-common/Pipfile

0 → 100644
+35 −0
Original line number Diff line number Diff line
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
# numpy and pytango versions must match those in the ska-python-builder image,
# otherwise pytango will be recompiled.
numpy = "==1.17.2"
pytango = "==9.3.1"
# itango is added to make it easier to exercise the device in a CLI session,
# but it's not mandatory. If you remove itango, you should also remove the
# 'RUN ipython profile create' line from Dockerfile.
itango = "*"
# If you want to debug devices running in containers, add pydevd to the dependencies
# pydevd = "*"

[dev-packages]
docutils = "*"
MarkupSafe = "*"
Pygments = "*"
pylint = "*"
pytest = "*"
pytest-cov = "*"
pytest-pylint = "*"
pytest-json-report = "*"
python-dotenv = ">=0.5.1"
ptvsd = "*"
Sphinx = "*"
sphinx_rtd_theme = "*"
sphinx-autobuild = "*"
sphinxcontrib-websupport = "*"

[requires]
python_version = "3"
+718 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading