Skip to content

GitLab ISIMA / LIMOS✯

URL of the dedicated educational forge

https://gitlab.isima.fr

URL of the dedicated research forge

https://gitlab.limos.fr

Getting Started✯

To get started with GitLab, you can read the CRI ISIMA/LIMOS post

Who can connect to GitLab?✯

All Active Directory users (Windows account / print) can connect to https://gitlab.isima.fr.

Associating External Users with a Project✯

It is possible to add external users to an existing GitLab project (educational or research). Procedure:

  • Create a local account in our infrastructure: either do it yourself or by creating a ticket providing the user's first name, last name, email, and requirements (VPN, research GitLab, etc.)
  • Once the account is created and the user has been notified of their account credentials, they must connect to GitLab for the first time and inform you
  • Once their user is created in GitLab, you can add them as a project member. Go to the Project Information/members tab and click the Invite members button on the right, search for them by name or username, and specify their role correctly.

GitLab and Continuous Integration✯

GitLab allows for continuous integration and can automatically deploy to a machine whenever a change is made to the GitLab repository.

To do this, edit a gitlab-ci.yml file at the root of the project that may look like this:

image: ubuntu:xenial                  # Specify the OS of the machine

before_script:                        # To be executed before the script
  - apt-get update                    # Update then install rsync, openssh tools and configure openssh
  - apt-get --yes --force-yes install rsync
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  - mkdir -p ~/.ssh
  - eval $(ssh-agent -s)
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  - ssh-add <(echo "$SSH_PRIVATE_KEY")
  # This last line adds the private SSH key found in your environment variables

# Below, a stage named deploy is created that will synchronize the repo with your VM
# All content will be deleted and restored except for gitlab-ci and README files
deploy_prod:
  stage: deploy
  script:
    - echo "deploy my_site_web"
    - rsync -av --exclude='.gitlab-ci.yml' --exclude='README.md' --delete . $PROD_USERNAME@$PROD_HOST:$PROD_ISP_PATH/

This file will be executed on each commit of any file in the repository. A GitLab runner will create a rebuilt image of the machine using Docker technology.

It is useful to use environment variables that are meant to remain hidden; they start with $ in the gitlab-ci file.

Edit these variables in "Settings/Continuous Integration and Delivery".

For the example above, you would find these in the environment variables:

var_environ

Finally, you can check that your CI is running correctly in "Continuous Integration and Delivery/Pipelines".

GitLab CI Patch✯

On the LIMOS GitLab, CI may not work because SSL verification fails.

You must patch your gitlab-ci.yml file by adding a GIT_SSL_NO_VERIFY variable set to True:

image: ubuntu:xenial

variables:
  GIT_SSL_NO_VERIFY: "1"

before_script:
  - apt-get update
  - ...

Appendix✯

Other Institutional Forges✯

The UCA forge will close in summer 2023 and all projects hosted there will disappear. If you have any, you must migrate them.

URL of the Renater forge: SourceSup

https://sourcesup.renater.fr/