Skip to content

Latest commit

 

History

History
187 lines (126 loc) · 7.57 KB

CNCFCI_GITLAB_CONFIGURATION.md

File metadata and controls

187 lines (126 loc) · 7.57 KB

New cncf.ci Project Gitlab Configuration Setup

GitHub Project Configuration

  1. Make crosscloudci/projectname-configuration project -- copy an existing projectname-configuration project (see testproj-configuration example: https://github.com/crosscloudci/testproj-configuration)

test project configuration

  1. Edit the cncfci.yml (see testproj-configuration: https://github.com/crosscloudci/testproj-configuration/blob/master/cncfci.yml which is for the testproj example: https://github.com/crosscloudci/testproj)

Test Project

  1. Edit .gitlab-ci.yml to include curl commands and scripts for getting build status, deploys, and tests e.g. envoy-configuration (see https://github.com/crosscloudci/testproj-configuration/blob/master/.gitlab-ci.yml)

Test Project

  1. Optional: write a ci proxy plugin for your ci tool and submit a pull request (see https://github.com/crosscloudci/ex_ci_proxy/blob/master/README.md)

Gitlab Setup

GitLab Pipeline Setup

You need to have admin permissions to do this. Also, if this process is done on the production gitlab server, you'll need to rsync the changes to your other servers or implement the same changes manually in each environment.

In Gitlab you need to complete the following steps.

  1. Create a new group

git add group

git add group

  1. Create a new project

git add project

git add project

  1. Set up mirroring (steps and menu items in gitlab)
  • Select admin

git select admin

  • Select your project (e.g. jaeger) within the admin interface
  • Botuser needs to be in user permissions

git select admin

 - Add bot user as member (as the master role)

git select admin

  • Impersonate bot user
    • Admin
      • Search for bot, click on bot user

git search bot user

   - Impersonate bot user

git impersonate bot user

  • Settings
    • Repository
      • Pull from remote repository
      • Select mirror, add https repo address, select bot user

git repository mirroring

  • Select the project Project
    • You should see that the code is pulled down

git check mirroring

    - Stop impersonating the bot user
  1. Set up project variables (steps and menu items in gitlab)
    • Settings
      • Pipeline trigger

git add trigger

  • add trigger
  • make sure a token is created
    • Pipelines

git custom path

  - Custom ci config path	    
    - e.g. https://raw.githubusercontent.com/crosscloudci/envoy-configuration/master/.gitlab-ci.yml

git add trigger

  • Add Secret variables
    • CLOUD
      • e.g. aws
    • ARCH
      • e.g. AMD64
    • PIPELINE_RELEASE_TYPE
      • stable
  1. Enable runners (steps and menu items in gitlab)

git enable runners

- settings
  - ci/cd
    - Runner settings
      - Enable all runners for this project
  1. Add the project to global configuration yml (e.g. https://github.com/crosscloudci/cncf-configuration/blob/master/cross-cloud.yml)

cross cloud global config

- Cncf configuration
  - Integration branch
    - Add to cross-cloud.yml
      - Duplicate a project
      - Find logo image e.g. https://d33wubrfki0l68.cloudfront.net/77bb2db951dc11d54851e79e0ca09e3a02b276fa/9c0b7/img/envoy-logo.svg
      - Add to cncf artwork repo
        - Link to cross cloud artwork repo
          - Update the project names e.g. to envoy 
          - Charts are the repo that we get the helm charts from
          - Change timeout for how long your build takes
  1. Review pipelines

new pipeline

Trigger Client

  1. Add the new project into the enviroment.rb

enviroment.rb

  1. Get token from trigger (steps and menu items in gitlab)

.env

  • Settings
    • CI/CD
      • Pipeline trigger
        • copy token
    • Put in .env for trigger client

Optional CI Setup (legacy manual build -- not using ci-proxy )

  1. Clone the project
git clone yourprojectname
- e.g. git clone https://github.com/envoyproxy/envoy.git
  1. Make a note of any ci instructions including scripts for building and publishing images
  • e.g. the .circleci/config.yml file outlines lots of shell scripts that refer to a docker dependencies image and build image
  1. Replicate the builds
  • e.g. use docker to replicate a build image using the previously viewed ci
  • you probably want to pin your image
  • update the script not to push
  • images will be local after build
  • publish to gitlab directory
  1. Create a script that builds head

  2. Create a script that builds stable

How to Debug

  1. Add a sleep to the .gitlab-ci.yml script
  2. ssh [email protected]
  3. Click on compile job

Gitlab yml common issues

  • If .gitlab-ci.yml does not refresh:
    • Go to pipelines
    • Copy/cut the gitlab.yml and save an empty url
    • Paste the url in again and save it