Professional Documents
Culture Documents
Git Lab Advanced Uses Seminar Slides
Git Lab Advanced Uses Seminar Slides
Git Lab Advanced Uses Seminar Slides
2 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Git & GitLab Basics
3 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
GitLab CI Pipelines
https://gitlab.epri.com/<project-path>/pipelines
4 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
GitLab Runner
https://gitlab.epri.com/<project-path>/-/settings/ci_cd
5 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Choosing a Runner
Shared
– Registered to a GitLab group & can be used by any project in that group
Dedicated
– Registered to a specific project
EPRI IT Hosted
– Maintained by SQA
– Project must be managed by SQA
– Required for Subscriber Website (SWS) deployments
6 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
GitLab CI Jobs
7 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
GitLab CI Jobs continued
https://gitlab.epri.com/<project-path>/-/jobs
8 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
The .gitlab-ci.yml file
A YAML file that defines a series of Variables, Stages, Jobs that get
executed with every new Pipeline.
A basic job consists of the following elements:
– stage – Determines order in which jobs are executed
– script – Commands that are executed by the runner
9 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
The .gitlab-ci.yml file continued
10 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
The .gitlab-ci.yml file continued
The behavior that determines when each job will run is highly
customizable, jobs can be triggered based on:
– Changes to specific branches [11]
– Variable comparisons [12]
– Changes to specific files [13]
– A full list of .gitlab-ci.yml features can be found here: [14].
11 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
.gitlab-ci.yml file breakdown
12 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
.gitlab-ci.yml file breakdown continued
13 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Code Building Jobs
Disadvantages
– Upfront time & labor cost of configuring runners and build scripts
14 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Using EPRI IT managed runners for builds
15 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Package Management
16 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Installed Dependencies & Build Tools
Installed Dependencies
Package management may not be viable for specific dependencies
Installing on the Runner environment may be necessary
Build Tools
Need to be installed on runner environment
Tools varies depending on project language and framework
– Node.js – npm
– C – gcc
– .NET – msbuild (and Visual Studio build tools)
17 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Build Script
Examples:
– Node.js
npm install
npm run-script build
– .NET
nuget restore
msbuild /t:Build /p:Configuration=Release /p:TargetFramework=v4.5.2
18 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Git Large File Storage
19 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Git LFS Installation and Usage
20 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Q &A
21 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.
Together…Shaping the Future of Electricity
22 www.e pr i .c om © 2019 Electric Power Research Institute, Inc. All rights reserved.