Commit d336a4a4 authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

TestPipeline: Try to generate midcsp development image using the

csp-lmc-common package in gitlab and to store the built image in
gitlab repo for test purposes.
parent 23c8c198
Loading
Loading
Loading
Loading
Loading
+20 −16
Original line number Diff line number Diff line
@@ -14,26 +14,15 @@
    paths:
      - ./$BUILD_PATH/dist/

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

.build_python_release:
  extends: .build_python
  script:
    - cd $BUILD_PATH
    - python3 setup.py egg_info -b+$CI_COMMIT_SHORT_SHA sdist bdist_wheel

build:csp-lmc-mid_pkg_dev: # Executed on a commit
  extends: .build_python_dev
  variables:
    BUILD_PATH: csp-lmc-mid

build:csp-lmc-mid_pkg:
  extends: .build_python_release
  extends: .build_python
  script:
    - cd $BUILD_PATH
    - python3 setup.py egg_info -b+$CI_COMMIT_SHORT_SHA sdist bdist_wheel
  variables:
    BUILD_PATH: csp-lmc-mid
  only: [master]
@@ -51,10 +40,25 @@ build:csp-lmc-mid_image:
  script:
    - cd $BUILD_PATH      
    - make build
    - make push
  variables:
    BUILD_PATH: csp-lmc-mid

build:csp-lmc-mid_dev-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:
    - k8srunner
  stage: build
  script:
    - cd $BUILD_PATH      
    - echo $IMG
    - docker build -t $IMG  --build-arg PROJECT_ID=$CI_PROJECT_ID -f Dockerfile.gitlab .
    - echo -n "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
    - docker push "$IMG"
  variables:
    BUILD_PATH: csp-lmc-mid
    IMG: "$CI_REGISTRY_IMAGE:mid-csp-lmc-$CI_COMMIT_SHORT_SHA"
# test:csp-lmc-mid:
#  stage: test
#  image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
+16 −0
Original line number Diff line number Diff line
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2 AS buildenv
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:9.3.2 AS runtime

# create ipython profile to so that itango doesn't fail if ipython hasn't run yet
RUN ipython profile create

ENV PATH=/home/tango/.local/bin:$PATH
ARG PROJECT_ID
# install all ska packages from nexus repository before installing the dev 
# csp-lmc-common package. In this way the csp-òmc-common dependencies are already
# in place and the package can be installed from the gitlab repo without errors.
RUN python3 -m pip install -r requirements-gitlab.txt .
#install
RUN python3 -m pip install -U --index-url https://gitlab.com/api/v4/projects/$PROJECT_ID/packages/pypi/simple csp-lmc-common 

CMD ["/venv/bin/python","/app/csp_lmc_mid/MidCspMaster.py"]
+7 −0
Original line number Diff line number Diff line
numpy == 1.17.2
pytango >= 9.3.2
jsonschema >= 3.2.0
lmcbaseclasses >=0.8.1
ska-log-transactions
ska-telescope-model