GithubHelp home page GithubHelp logo

jenkinssharedlibrary's Introduction

JenkinsLibrary

简介

本共享库是《DevOps流水线最佳实践》教程产出,涵盖基本的构建、部署、发布工具集成。

使用说明

配置共享库

  • 系统管理 -> 系统设置 -> Global Pipeline Libraries
  • Source Code Management -> git -> 仓库地址 -> 认证凭据

替换信息

  • 凭据 -> [gitlab/nexus/artifactory/jira]
  • 服务器地址 -> [gitlab/nexus/artifactory/jira]

目录结构

共享库中存储的每个文件都是一个groovy的类,每个文件(类)中包含一个或多个方法,每个方法包含groovy语句块。 Shared Library遵循固定的代码目录结构:

+- src                     # Groovy source files
|   +- org
|       +- foo
|           +- Bar.groovy  # for org.foo.Bar class
+- vars
|   +- foo.groovy          # for global 'foo' variable
|   +- foo.txt             # help for 'foo' variable
+- resources               # resource files (external libraries only)
|   +- org
|       +- foo
|           +- bar.json    # static helper data for org.foo.Bar

src目录:

  • 标准的Java源目录结构,存放编写的groovy类,执行流水线时,此目录将添加到类路径
  • 存放一些特定的功能实现,文件格式为.groovy

vars目录:

  • 存放可从Pipeline访问的全局脚本(标准化脚本),这些脚本文件在流水线中作为变量公开
  • 使用驼峰(camelCased)命名方式,文件格式为.groovy
  • 在.groovy文件中,可以通过import的方式,引入src目录的类库

resources目录:

  • 从外部库中使用步骤来加载相关联的非Groovy文件

doc目录:

  • 存放pipeline的相关文档说明
  • 一般包含ReadMe.md文件

jenkinssharedlibrary's People

Contributors

bwcxyk avatar

Stargazers

 avatar  avatar dishuihengxin avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.