diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..efe808a9b49ca70a897fd8fc7066afb743edd367 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,23 @@ +stages: + - build + +build_documentation: + stage: build + image: python:3.7-slim + before_script: + - apt-get update + - apt-get install build-essential -y + - apt-get purge -y --auto-remove + - rm -rf /var/lib/apt/lists/* + - find /usr/local/lib/python3.7 -name "*.pyc" -type f -delete + script: + - pip install -r requirements.txt + - make clean + - make html SPHINXOPTS="-W --keep-going -n" + - ./fix_cross_references.sh + only: + - master + - merge_requests + artifacts: + paths: + - _build/html diff --git a/01-workflow-osm-tools.md b/01-workflow-osm-tools.md index 4cafcae5c54fb19e92e8ed317438ab0a4b92f92f..98ff6482fbaa31887e28cce90c386dd350ca8dda 100644 --- a/01-workflow-osm-tools.md +++ b/01-workflow-osm-tools.md @@ -28,7 +28,7 @@ If you need any help, contact us at ## Contributing code -### Clone your project +### Clone your project (https) 1. Clone a git repository, for example: ```bash @@ -61,6 +61,24 @@ More information about the Gerrit commit-msg hook can be found [here](https://gi 3. Click on "List" menu. 4. Select a product to see the available cloning URLs. +### Clone your project (ssh) + +1. Authenticate your local host with Gerrit + + 1. Create a SSH public-private key pair locally. Git offers this tool for linux and windows users (via Git Bash) **ssh-keygen -o** but you need to ensure that the user.name and the user.email picked up by the terminal matches the settings from Gerrit (Check with **git config -l**). Accept all the default settings that the prompt will ask until it finishes. By the end you should see a **id_rsa** file (private key) and a **id_rsa.pub** file (public key) created under your host's **.ssh/** folder. + 2. Open the id_rsa.pub file with any text editor and copy its content. + 3. Login to Gerrit (ETSI account) and access the settings page https://osm.etsi.org/gerrit/#/settings/ + 4. Go to the **SSH Public Keys** tab and add the public key to the registered key lists + +2. Access Gerrit and find the repository that you need. In this example, the **Features** repo is found here https://osm.etsi.org/gerrit/#/admin/projects/osm/Features +3. Copy the clone command choosing **ssh** and **clone with commit-msg hook** option. +4. Paste the command in your Git Bash terminal within the folder in which you want the repository. + +```bash +git clone "ssh://$USERNAME@osm.etsi.org:29418/osm/Features" && (cd "Features" && curl https://osm.etsi.org/gerrit/tools/hooks/commit-msg > .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg) +``` +**Note**: Replace $USERNAME with your ETSI username. + ### Configure your Git environment 1. Configure your git username globally: @@ -254,6 +272,8 @@ Link: (you can navigate there 1. **Jenkins** builds, tests the new contribution, and reports the result on its web interface. 2. **Jenkins** votes on the contribution using **“Code-Verif”** (-1, +1) on **Gerrit**. +Jenkins is configured to relaunch the CI pipelines when a new patch is pushed to the review commit and by manually adding a comment with the keyword "retrigger" to the commit review UI. + ### Code Review 1. Other **contributors** and **MDG Committers** can comment the new contribution and vote using **“Code-Review”** (-1, 0, +1) on **Gerrit**. @@ -433,12 +453,13 @@ When amending code from a different author, reviewer and original author should This will download the change, put it in a branch called review/AUTHOR/change (if the change has no tag, the sequence number will be used instead), and switch to that branch. 3. After that, you can amend the downloaded change to improve it. Finally, push it again: ```bash - #$ git add # add the changes - #$ git commit --amend # do not touch the Change-Id. The Change-Id is the way for gerrit to keep track what belongs to what development stream as a new patch set. - #$ git commit --amend --author # if you want to mark the changes as yours. + #$ git add # add the changes + #$ git commit --amend # do not touch the Change-Id. The Change-Id is the way for gerrit to keep track what belongs to what development stream as a new patch set. + #$ git commit --amend --author="username \"** # The username and email must contain the exact names from your ETSI account (the <> notation around the email is compulsory) #$ git review -c -R # The -R is important, since it tells git-review to not rebase your change against master. ``` **NOTE**: Don't use the -m flag to specify a commit message, since it will override the previous message and regenerate the Change-Id. Instead, use the text editor to change the commit message if needed, and keep the Change-Id line intact. + **NOTE**: If the original author appears as uploader and assignee in gerrit you will need to request support to **osmsupport@etsi.org** asking for permission to change the assigned user to the commit. Once confirmed, you should be able to amend the user from the commit and push. 4. Delete the branch once you have finished: ```bash $ git branch -D review/garciadeblas/1280