Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Log in to gitlab.eufus.psnc.pl
  2. On the top bar, select Menu > Projects and find your project
  3. Press "+" button and select New File
  4. File must be in root of your repository and be called gitlab-ci.yml
  5. Prepare content for CI / CD purposes - you can use simple example below as a template

    Code Block
    title.gitlab-ci.yml
    linenumberstrue
    stages:
      - Test IMAS
    
    Test IMAS environment:
      stage: Test IMAS
      tags:
        - HPC
      before_script:
        - eval `/usr/bin/modulecmd bash load cineca`
        - eval `/usr/bin/modulecmd bash load imasenv`
        - mkdir test-database
        - imasdb `pwd`/test-database
        # a hack to allow installing imasdb in custom folder (non ~/public)
        - export ids_path="`pwd`/test-database;$ids_path"
      script:
        - python3 ids_put.py
        - python3 ids_get.py
      after_script:
        - rm -rf `pwd`/test-database
        - eval `/usr/bin/modulecmd bash purge`


    Tip

    There is a hack to allow installing imasdb in custom folder (non ~/public):
     - imasdb `pwd`/test-database 


  6. Complete each section. Remember that each project has different requirements, so the commands must be adapted to your code.
    1. tags - The tag indicates whether the task is to be performed by HPC or Docker. Use HPC in this example. Using Docker is described here 

      Info

      Our GitLab's CI/CD is using HPC on Gateway. This means that the script commands will be called and run like on Gateway


    2. before_script - is used to define the command that should be run before all builds, including deploy builds
    3. script - defines a shell script which is executed by Runner
    4. after_script is used to define the command that will be run after for builds
  7. At the end press Commit changes
    Image Added

How to check my CI/CD tasks?

  1. On the top bar, select Menu > Projects and find your project
  2. On the left sidebar, select CI/CD > Pipelines

  3. A list of tasks with their statuses will be displayed (passed or failed).
    Click on your task status for details
    Image Modified

  4. Check pipline details - press title of test 
    Image Modified
  5. You can examine step by step your CI/CD task and in case of failure you can learn why it did fail
    Image Modified