Versions Compared

Key

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

...

  1. Prepare your personal access token. Take a look here to find documentation - link.
  2. Log in to gitlab.eufus.psnc.pl
  3. On the top bar, select Menu > Projects and find your project
  4. On the left sidebar, select Settings > CI/CD

  5. Expand Variables
  6. Click Add Variable
  7. Name the Enter variable name in the Key field. We are using name CREDENTIALS - in this tutorial

  8. Enter <your_gitlabgithub_token>username>:<your_githubgitlab_username> as token> as the Value.

    Tip

    Remove Protect variable checkbox to use it in each tag or branch


    Warning

    Mark Mask variable to protect your confidential data from others.

    Access token serves the purpose of password.


    Be !!! Be careful! If somebody intercepts your token, all your repositories might be at risk! Do not share your access tokens !!!


  9. Press Add variable.
    If you performed the steps correctly, the list should display as below
  10. Update you .gitlab-ci.yml file to use variable with access token

    Code Block
    title.gitlab-ci.yml
    linenumberstrue
    stages:
      - Test Docker with access to external repository
    
    Execution inside Docker container:
      stage: Test Docker with access to external repository
      tags:
        - Docker
      image: 'gitlab.eufus.psnc.pl:5050/g2michal/imas-based-docker/ual-fc2k'
      before_script:
        - module load IMAS
        - imasdb test
        - git clone https://$CREDENTIALS@github.com/mkopsnc/beaver-data.git
        - tar -xf beaver-data/data/input/input.tar.gz -C $HOME/public/imasdb/test/3/0
      script:
        - make
        - ./bin/main


  11. Check your CI/CD pipelines. If everything is okay, job should be successful


...