Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.71 KiB
Newer Older
Jan Caron's avatar
Jan Caron committed
image: "python:3.5"

before_script:
  # Check and print Python version
Jan Caron's avatar
Jan Caron committed
  - python --version
  # Create SSH configuration directory if necessary (also parents with -p, mode: read/write/exec):
  - mkdir -p --mode=700 ~/.ssh/
  # Add SSH key for jutil:
  - echo "ID_RSA_JUTIL" > ~/.ssh/id_rsa_jutil
  # Provide read access to owner (octal value code: 400) to the key with chmod:
  - chmod 400 ~/.ssh/id_rsa_jutil
  # Configure SSH to use ~/.ssh/jutil_key for iffgit.fz-juelich.de (-e allows \n):
  - echo -e "Host iffgit.fz-juelich.de\n\tIdentityFile ~/.ssh/id_rsa_jutil\n" > ~/.ssh/config

  #- cat ~/.ssh/config

  #- ssh-keyscan -H 'iffgit.fz-juelich.de'
  #- echo $(<ssh-keyscan -H 'iffgit.fz-juelich.de') >> ~/.ssh/known_hosts
  #- cat ~/.ssh/known_hosts
  # For Docker builds disable host key checking. Be aware that by adding that
  # you are suspectible to man-in-the-middle attacks.
  # WARNING: Use this only with the Docker executor, if you use it with shell
  # you will overwrite your user's SSH config.
  # - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
  # >> appends instead of overwriting
  - echo -e "iffgit.fz-juelich.de $ID_RSA_JUTIL_PUB" >> ~/.ssh/known_hosts
  - cat ~/.ssh/known_hosts
  # Install jutil via secure ssh connection:
  - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git
Jan Caron's avatar
Jan Caron committed
stages:
  - test

Jan Caron's avatar
Jan Caron committed
test:
Jan Caron's avatar
Jan Caron committed
  stage: test
  script:
    # TODO: Different jobs with custom develop arguments? extra_requires (hyperspy, plotting)?
    # TODO: Use pip install -e .[hyperspy], etc.
    # Install requirements (-e: editable, like python setup.py develop, but pip, not easy_install):
    - pip install -e .  # TODO: belongs here or before_script?
Jan Caron's avatar
Jan Caron committed
    - python setup.py test