gitlab-ci详细说明

gitlab-ci详细说明

2023年7月7日发(作者:)

gitlab-ci详细说明⽂章⽬录概念从 Gitlab 8.0 开始,Gitlab CI 就已经集成在 Gitlab 中,我们只要在项⽬中添加⼀个.⽂件,然后添加⼀个Runner,即可进⾏持续集成。Pipeline⼀次 Pipeline 其实相当于⼀次构建任务,⾥⾯可以包含很多个流程,如安装依赖、运⾏测试、编译、部署测试服务器、部署⽣产服务器等流程。任何提交或者

Merge Request 的合并都可以触发 Pipeline 构建。StagesStages 表⽰⼀个构建阶段,也就是上⾯提到的⼀个流程。我们可以在⼀次 Pipeline 中定义多个 Stages,这些 Stages 会有以下特点:所有 Stages 会按照顺序运⾏,即当⼀个 Stage 完成后,下⼀个 Stage 才会开始只有当所有 Stages 完成后,该构建任务 (Pipeline) 才会成功如果任何⼀个 Stage 失败,那么后⾯的 Stages 不会执⾏,该构建任务 (Pipeline) 失败JobsJobs 表⽰构建⼯作,表⽰某个 Stage ⾥⾯执⾏的⼯作。我们可以在 Stages ⾥⾯定义多个 Jobs,这些 Jobs 会有以下特点:相同 Stage 中的 Jobs 会并⾏执⾏相同 Stage 中的 Jobs 都执⾏成功时,该 Stage 才会成功如果任何⼀个 Job 失败,那么该 Stage 失败,即该构建任务 (Pipeline) 失败job分组可以把job分组,通过 以下⽅式,job名称为build ruby,有3步。build ruby 1/3: stage: build script: - echo "ruby1"build ruby 2/3: stage: build script: - echo "ruby2"build ruby 3/3: stage: build script: - echo "ruby3"variables⾃定义变量⾃定义变量可以通过以下语句定义:variables: TEST: "HELLO WORLD"预定义变量There are also .VariableCHAT_CHANNELCHAT_INPUTCICI_API_V4_URLCI_BUILDS_DIRGitLab10.610.6all11.7allRunnerallall0.4all11.10DescriptionThe Source chat channel that triggered the additional arguments passed with the ble for all jobs executed in CI/CD. true when GitLab API v4 root top-level directory where builds are previous latest commit present on a branch. Is alwaysCI_COMMIT_BEFORE_SHA11.2all0000 in pipelines formerge commit branch name. Available in branch pipelines,CI_COMMIT_BRANCH12.60.5including pipelines for the default branch. Not available in mergerequest pipelines or tag _COMMIT_DESCRIPTIONCI_COMMIT_MESSAGECI_COMMIT_REF_NAMECI_COMMIT_REF_PROTECTED10.810.89.011.11allallallallThe description of the commit. If the title is shorter than 100characters, the message without the first line.提交message。branch or tag名称true if the job is running for a protected _COMMIT_REF_NAME in lowercase, shortened to 63 bytes,CI_COMMIT_REF_SLUG9.0alland with everything except 0-9 and a-z replaced with -. Noleading / trailing -. Use in URLs, host names and _COMMIT_SHACI_COMMIT_SHORT_SHACI_COMMIT_TAGCI_COMMIT_TIMESTAMPCI_COMMIT_TITLECI_CONCURRENT_IDCI_CONCURRENT_PROJECT_ID9.011.79.013.410.8allallallall0.5allall11.1011.10提交versionCI_COMMIT_SHA 前8字符The commit tag name. Available only in pipelines for timestamp of the commit in the ISO 8601 title of the commit. The full first line of the unique ID of build execution in a single unique ID of build execution in a single executor path to the CI/CD configuration file. Defaults to .gitlab-CI_CONFIG_ if is name of the project’s default image prefix for pulling images through the password to pull images through the Dependency _DEBUG_TRACECI_DEFAULT_BRANCHCI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIXCI_DEPENDENCY_PROXY_PASSWORDall12.413.713.71.7allallallVariableCI_DEPENDENCY_PROXY_SERVERCI_DEPENDENCY_PROXY_USERCI_DEPLOY_FREEZECI_DEPLOY_PASSWORDCI_DEPLOY_USERGitLab13.713.713.210.810.8RunnerallallallallallThe server for logging in to the Dependency Proxy. This isDescriptionequivalent to $CI_SERVER_HOST:$CI_SERVER_ username to pull images through the Dependency available if the pipeline runs during a . true when authentication password of the , if the project has authentication username of the , if the project has available if the job is executed in a disposable environmentCI_DISPOSABLE_ENVIRONMENTall10.1(something that is created only for this job and disposedof/destroyed after the execution - all executors except shelland ssh). true when _ENVIRONMENT_NAME8.15allThe name of the environment for this job. Available if is simplified version of the environment name, suitable forCI_ENVIRONMENT_SLUG8.15allinclusion in DNS, URLs, Kubernetes labels, and so on. Availableif is _ENVIRONMENT_URLCI_HAS_OPEN_REQUIREMENTSCI_JOB_IDCI_JOB_IMAGECI_JOB_JWTCI_JOB_MANUALCI_JOB_NAMECI_JOB_STAGECI_JOB_STATUS9.313.19.012.912.108.128.129.0allallallall12.9allallall0.513.5The URL of the environment for this job. Available if is available if the pipeline’s project has an open . true id运⾏job的容器的imageA RS256 JSON web token to authenticate with third partysystems that support JWT authentication, for example .job是否是⼈⼯执⾏的job名称The name of the job’s status of the job as each runner stage is executed. Usewith . Can be success, failed, or canceled.A token to authenticate with . The token is valid as long as thejob is job details UTC datetime when a job started, in available if the pipeline has a Kubernetes cluster availablefor deployments. true when index of the job in the job set. Only available if the job total number of instances of this job running in parallel. Setto 1 if the job does not use .A comma-separated list of up to four merge requests that usethe current branch and project as the merge request _JOB_TOKENCI_JOB_URLCI_JOB_STARTED_ATCI_KUBERNETES_ACTIVE9.011.113.1013.01.20.5allallCI_NODE_INDEX11.5allCI_NODE_TOTAL11.5allCI_OPEN_MERGE_REQUESTS13.8allOnly available in branch and merge request pipelines if thebranch has an associated merge request. For example, gitlab-org/gitlab!333,gitlab-org/gitlab-foss!_PAGES_DOMAINCI_PAGES_URL11.811.8allallThe configured domain that hosts GitLab URL for a GitLab Pages site. Always a subdomain ofCI_PAGES__PIPELINE_IDVariableCI_PIPELINE_IID8.10GitLab11.0allRunnerall流⽔线ID,gitlab实例内唯⼀Description流⽔线ID,项⽬内唯⼀How the pipeline was triggered. Can be push, web, schedule,CI_PIPELINE_SOURCE10.0allapi, external, chat, webide, merge_request_event,external_pull_request_event, parent_pipeline, .CI_PIPELINE_TRIGGEREDCI_PIPELINE_URLCI_PIPELINE_CREATED_ATCI_PROJECT_CONFIG_PATHall11.113.1013.8all0.5allalltrue if the job was .The URL for the pipeline UTC datetime when the pipeline was created, in format.(Deprecated) The CI configuration path for the project. inGitLab 13.10. for GitLab full path the repository is cloned to, and where the jobCI_PROJECT_DIRallallruns from. If the GitLab Runner builds_dir parameter is set, thisvariable is set relative to the value of builds_dir. For moreinformation, see the .CI_PROJECT_IDallallThe ID of the current project. This ID is unique across allprojects on the GitLab name of the directory for the project. For example if theCI_PROJECT_NAME8.100.5project URL is /group-name/project-1,CI_PROJECT_NAME is _PROJECT_NAMESPACECI_PROJECT_PATH_SLUGCI_PROJECT_PATHCI_PROJECT_REPOSITORY_LANGUAGES8.109.38.1012.30.5all0.5allThe project namespace (username or group name) of the job.$CI_PROJECT_PATH in lowercase with characters that are nota-z or 0-9 replaced with -. Use in URLs and domain project namespace with the project name included.A comma-separated, lowercase list of the languages used in therepository. For example ruby,javascript,html, root project namespace (username or group name) of theCI_PROJECT_ROOT_NAMESPACE13.20.5job. For example, if CI_PROJECT_NAMESPACE is root-group/child-group/grandchild-group,CI_PROJECT_ROOT_NAMESPACE is _PROJECT_TITLECI_PROJECT_URLCI_PROJECT_VISIBILITY12.48.1010.3all0.5allThe human-readable project name as displayed in the GitLabweb HTTP(S) address of the project visibility. Can be internal, private, or address of the project’s Container Registry. Only availableif the Container Registry is enabled for the password to push containers to the project’s GitLabCI_REGISTRY_IMAGE8.100.5CI_REGISTRY_PASSWORD9.0allContainer Registry. Only available if the Container Registry isenabled for the username to push containers to the project’s GitLabCI_REGISTRY_USER9.0allContainer Registry. Only available if the Container Registry isenabled for the address of the GitLab Container Registry. Only available ifCI_REGISTRY8.100.5the Container Registry is enabled for the project. This variableincludes a :port value if one is specified in the _REPOSITORY_URLCI_RUNNER_DESCRIPTION9.08.10all0.5The URL to clone the Git description of the leCI_RUNNER_EXECUTABLE_ARCHCI_RUNNER_IDCI_RUNNER_REVISIONGitLaball8.10allRunner10.60.510.6The OS/architecture of the GitLab Runner executable. MightDescriptionnot be the same as the environment of the unique ID of the runner being revision of the runner running the eight characters of the runner’s token used toCI_RUNNER_SHORT_TOKENall12.3authenticate new job requests. Used as the runner’s _RUNNER_TAGSCI_RUNNER_VERSIONCI_SERVER_HOSTCI_SERVER_NAMECI_SERVER_PORT8.10all12.1all12.80.510.6allallallA comma-separated list of the runner version of the GitLab Runner running the host of the GitLab instance URL, without protocol or example name of CI/CD server that coordinates port of the GitLab instance URL, without host or example protocol of the GitLab instance URL, without host or example revision that schedules base URL of the GitLab instance, including protocol andport. For example : major version of the GitLab instance. For example, if theCI_SERVER_PROTOCOLCI_SERVER_REVISIONCI_SERVER_URL12.8all12.7allallallCI_SERVER_VERSION_MAJOR11.4allGitLab version is 13.6.1, the CI_SERVER_VERSION_MAJOR minor version of the GitLab instance. For example, if theCI_SERVER_VERSION_MINOR11.4allGitLab version is 13.6.1, the CI_SERVER_VERSION_MINOR patch version of the GitLab instance. For example, if theCI_SERVER_VERSION_PATCH11.4allGitLab version is 13.6.1, the CI_SERVER_VERSION_PATCH _SERVER_VERSIONCI_SERVERallallallallThe full version of the GitLab ble for all jobs executed in CI/CD. yes when available if the job is executed in a shared environmentCI_SHARED_ENVIRONMENTall10.1(something that is persisted across CI/CD invocations, like theshell or ssh executor). true when _CIGITLAB_FEATURESGITLAB_USER_EMAILGITLAB_USER_IDGITLAB_USER_LOGINGITLAB_USER_NAMETRIGGER_PAYLOADall10.68.128.1210.010.013.9allallallallallallallAvailable for all jobs executed in CI/CD. true when comma-separated list of licensed features available for theGitLab instance and email of the user who started the ID of the user who started the username of the user who started the name of the user who started the webhook payload. Only available when a pipeline is .使⽤变量ShellUsagebash/shShellPowerShellWindows Batch$variable,${variable}Usage$env:variable (primary) or $variable%variable%, or !variable! for , which can be used for variables that contain white spaces or newlines.变量可以通过依赖job 来继承。关键词全局关键词before_scriptbefore_script 关键词是⽤于在每个任务之前执⾏的脚本,但是会在artifacts恢复之后执⾏。你可以这样定义⼀个全局的before_script,default: before_script: - echo "Execute this script in all jobs that don't already have a before_script section."也可以在⼀个任务中中单独定义job: before_script: - echo "Execute this script instead of the global before_script." script: - echo "This script executes after the job's `before_script`"任务中的before_script会覆盖全局的before_scriptafter_scriptafter_script与before_script类似,⽤于定义多⾏脚本,会在任务执⾏完成后执⾏,即使任务失败也会被执⾏。如果任务被取消或者超时,after_script就不会被执⾏了,可以定义全局的,也可以定义局部的default: after_script: - echo "Execute this script in all jobs that don't already have an after_script section."job1: script: - echo "This script executes first. When it completes, the global after_script executes."include使⽤include可以导⼊⼀个或多个额外的yaml⽂件到CI/CD配置⾥,这就可以将⼀个很长的流⽔线,分隔出来。使⽤include来引⼊。也可以将⼏个流⽔线中相同的配置,提取出来,公⽤。引⼊的⽂件扩展名 必须是.yaml或者.yml两种,其他的不⾏。include 关键词下,有四个可选性:local, 引⼊⼀个当前项⽬的⽂件file, 引⼊⼀个不同项⽬的⽂件remote, 引⼊⼀个公⽹⽂件,template, 引⼊⼀个由GitLab提供的模板include: - local: '/templates/.'---include: - project: 'my-group/my-project' #另外⼀个项⽬ file: '/templates/.' ref: master #master分⽀---include: - remote: '/awesome-project/raw/master/.'Stage关键词Job关键词script任务要执⾏的shell脚本内容,内容会被runner执⾏,在这⾥,你不需要使⽤git clone …克隆当前的项⽬,来进⾏操作,因为在流⽔线中,每⼀个的job的执⾏都会将项⽬下载,恢复缓存这些流程,不需要你再使⽤脚本恢复。你只需要在这⾥写你的项⽬安装,编译执⾏,如npm install 另外值得⼀提的是,脚本的⼯作⽬录就是当前项⽬的根⽬录,所有可以就像在本地开发⼀样。此外script可以是单⾏或者多⾏单⾏脚本:job: script: npm install多⾏脚本:job: script: - npm config set sass_binary_site /mirrors/node-sass/ - npm install --registry=***script***是⼀个job的必填内容,不可或缺。⼀个job最少有⼆个属性,⼀个是 job name, 任务名称, ⼀个就是script。image指定⼀个基础Docker镜像作为基础运⾏环境,经常⽤到的镜像有node, nginx ,dockerjob: image: node:latest script: npm installimage的作⽤就是给当前任务或者当前流⽔线设置⼀个基础环境,有可能是nodejs,也有可能是java, go, php,可以设置当前流⽔线的,也可以设置当前任务的。artifacts制品,⼀个成品,作⽤是将流⽔线过程中的⼀些⽂件,⽂件夹,打包压缩,提供⼀个外链供⼈下载,另外还能在后续的job中缓存。⽐如我们构建⼀个前端项⽬后将dist⽬录做成⼀个压缩包, build: script: - npm run build artifacts: paths: - dist/后⾯的任务可以使⽤⽣成的制品。paths 是⽤来指定将哪些⽂件,⽬录放⼊制品中, 也可以使⽤exclude关键词,将那些⽬录,⽂件排除,⽀持正则表达式。此外还有以下⼏个属性:paths :⽂件路径exclude: 排除的⽂件name :制品名称expose_as: 在UI页⾯导出的名称untracked :布尔类型,是否将git忽略的⽂件加到制品中when :何时上传制品,可选值:on_success;on_failure;alwaysexpire_in: 过期时间默认30天reports: 收集测试报告build: script: - npm run build artifacts: paths: - dist/ exclude: - binaries/**/*.o expose_as: 'artifact 1' name: "$CI_COMMIT_REF_NAME" untracked: false expire_in: 2 hrs 20 min when: on_failuretagstags 关键词是⽤于指定Runner。tags的取值范围是在该项⽬可见的runner tags中,可以在Setting =>CI/CD => Runner 中查看的到。不设置则默认使⽤公有Runner去执⾏流⽔线。每个任务可以指定⼀个Runner,可以指定多个标签,但runner却只能⼀个。以⼀个为准。tags是在注册Runner时配置的,后续也可以更改。install: tags: - hello-vue - docker script: - npm config set sass_binary_site /mirrors/node-sass/ - npm install --registry=he缓存是将当前⼯作环境⽬录中的⼀些⽂件,⼀些⽂件夹存储起来,⽤于在各个任务初始化的时候恢复。避免多个下载同样的包,能够⼤⼤优化流⽔线效率。在前端项⽬中,我们经常把node_modules缓存起来,这样⼀条流⽔线都可以使⽤这些下载好的包。在java项⽬中经常把maven下载的包缓存起来。以备后⽤cache下的参数有paths:当前⼯作环境下的⽬录key:存储的key,key不变不会重新⽣成缓存,prefix:使⽤⼀些⽂件制作成⽂件hash值,当做key的⼀部分,untracked :是否缓存git忽略的⽂件when :定义何时存储缓存,值 on_success;on_failure;alwayspolicy:缓存是否要在job完成后重新上传缓存可以设置流⽔线全局,也可以在job中设置cache: key: hello-vue-cache paths: - node_modules#####cache: key: files: - - paths: - vendor/ruby - node_modulesstagestage 是阶段的意思,⽤于归档⼀部分的job,按照定义的stage顺序来执⾏。默认的stage有build,test,deploy, 此外还有两个特殊的.pre 和 .post。以下执⾏顺序: job_1,job_0。stages: - build - test - deployjob_0: stage: test script: echo 'tets'job_1: stage: build script: echo 'build'whenwhen关键字是实现在发⽣故障或尽管发⽣故障时仍能运⾏的作业。⽐如你要在任务失败后需要触发⼀个job,或者你需要⼿动执⾏任务,或者当你⼀个任务执⾏成功后,执⾏另⼀个任务.on_success 所有任务执⾏成功后on_failure 当⾄少⼀个任务失败后always 执⾏作业,⽽不考虑作业在早期阶段的状态。manual ⼿动执⾏任务delayed 延迟执⾏任务never在rules中不排除执⾏的任务在workflow:rules不允许的流⽔线only/exceptonly/except 是规定当前job的可见状态,⼀个项⽬有很多分⽀,tag,我们的流⽔线,为了对特定的分⽀,特定的tag执⾏不同的job,这⾥就要使⽤only和except在任务上加上这⼀段代码,就表明当前任务只有在master分⽀可以运⾏ only: - master也可以根据当前的代码变动是合并,还是推送,还是使⽤API来触发的。如果⼀个任务没有only属性,那默认就是only: ['branches', 'tags'] 操作分⽀或者tags都会触发流⽔线。dependenciesdependencies关键词是定义特定的job运⾏规则。默认artifacts是从当前阶段产⽣,在后续的阶段都会被下载,但我们可以使⽤dependencies关键词来控制artifacts从哪⾥下载。build:osx: stage: build script: make build:osx artifacts: paths: - binaries/build:linux: stage: build script: make build:linux artifacts: paths: - binaries/test:osx: stage: test script: make test:osx dependencies: - build:osx #依赖test:linux: stage: test script: make test:linux dependencies: - build:linux #依赖deploy: stage: deploy script: make deploy任务test:osx 依赖build:osx。任务test:linux 依赖 build:linux。这样配置以后 任务test:linux 就不⽤等任务build:osx 执⾏完成在执⾏了,只需要等待任务build:linux完成extends这个关键词可以使⼀个任务继承另⼀个任务。.tests: script: rake test stage: test only: refs: - branchesrspec: extends: .tests script: rake rspec only: variables: - $RSPEC任务rspec 继承了.tests任务,在流⽔线中.tests是⼀个隐藏的任务,在流⽔线中,以点(.) 开头的任务名,都是隐藏的任务。不会被执⾏。 被rspec 继承后,相同的key会以rspec为准,rspec没有的,⽽.tests有的,则合并到rspec中。合并后的结果是:rspec: script: rake rspec stage: test only: refs: - branches variables: - $RSPEC使⽤这⼀个⼿段,可以写⼀个模板,只要稍微改改就能后使⽤。⾮常适合⼤批量编写流⽔线。triggertrigger 是应对那些更加复杂的CI/CD流程,如多流⽔线,⽗⼦流⽔线。使⽤它可以定义⼀个下游的流⽔线,配置了trigger的任务是不能跑脚本的,就是说不能定义script, before_script, 和 after_script.#流⽔线执⾏完test任务后就会去执⾏my/deployment项⽬的流⽔线rspec: stage: test script: bundle exec rspecstaging: stage: deploy trigger: my/deployment---#配置下游流⽔线式也可以执⾏分⽀rspec: stage: test script: bundle exec rspecstaging: stage: deploy trigger: project: my/deployment branch: stablezrulesrules是⽤于规定任务的执⾏规则,使⽤⼀个表达式,来规范那些任务执⾏,那些任务不执⾏.还可以在任务成功,或者失败后,触发另⼀个任务。docker build: script: docker build -t my-image:$CI_COMMIT_REF_SLUG . rules: #如果当前的分⽀是master分⽀则任务延迟3个⼩时执⾏,并且允许失败。 - if: '$CI_COMMIT_BRANCH == "master"' when: delayed start_in: '3 hours' allow_failure: truerules的下⾯可选属性if:使⽤if表达式 添加或移除⼀个任务, 类似

only:s:根据某些个⽂件是否改变来追加或移除⼀些任务。类似

only: :根据是否存在特定⽂件来追加或移除⼀些任务allow_failureallow_failure是⼀个布尔类型, true或false, 默认为false,表⽰当前任务是否允许失败。如果⼀个任务设置了allow_failure: true,并且这个任务报错了,那么它将会显⽰黄⾊警告。但有种情况任务失败了也会停⽌的, 那就是任务设置了when: manual,即⼿动操作的任务。⼿动启动的任务,报错了就会停⽌,不会继续执⾏后续任务,除⾮在rule设置报错的处理逻辑。coveragecoverage 是⽤于获取项⽬的代码覆盖率,这个配置项的值只能是⼀个正则表达式,官⽅有提供⼀些,在CI/CD的General pipelines⾥覆盖率可以添加到项⽬的readme上。pagespages是⼀项特殊的⼯作,⽤于将静态内容上传到GitLab,可⽤于为您的⽹站提供服务,其实就是可以托管你的⽹站。它具有特殊的语法,因此必须满⾜以下两个要求:任何静态内容都必须放在public/⽬录下。制品artifacts必须是⽬录public/,就是编译后的⽂件必须存放在public中下⾯的⽰例将所有⽂件从项⽬的根⽬录移⾄public/⽬录。这⾥必须先创建⼀个.public ⽬录,防⽌根⽬录下已经存在public了,导致循环复制。pages: stage: deploy script: - mkdir .public - cp -r * .public - mv .public public artifacts: paths: - public only: - masterreleaserelease关键词是⽤于创建⼀个release,即创建⼀个发布,可以配置这些内容tag_name: tag 名称description: 描述name :名称ref :提交的hash值milestones: 要关联的⾥程碑released_at: 创建时间resource_group有时在环境中同时运⾏多个作业或流⽔线时可能会导致在部署过程中出错。为了避免这些错误,resource_group可以使⽤该属性来确保运⾏程序不会同时运⾏某些任务。资源组的⾏为类似于其他编程语⾔中的信号灯。当⼀个任务设置了resource_group , 同⼀项⽬的不同管道之间任务的运⾏是互斥的。如果属于同⼀资源组的多个任务同时进⼊队列,则运⾏程序仅选择其中⼀个作业。其他作业将等到 resource_group释放。deploy-to-production: script: deploy resource_group: production在这种情况下,两个deploy-to-production单独流⽔线中的两个作业永远⽆法同时运⾏。最后的结果及时你可以确保永远不会在⽣产环境中发⽣并发部署。您可以为每个环境定义多个资源组。例如,当部署到物理设备时,您可能有多个物理设备。可以将每个设备部署到,但是在任何给定时间每个设备只能部署⼀个。resource_group值只能包含字母,数字,-, _, /, $, {, }, .,和空格。它不能以开头或结尾/。retryretry可以设置⼀个任务的重试次数,值的类型是数字 最⼤是2,如果设置2,就表明该任务最多可以执⾏3次,其中包括2次重试。对于⽹络不稳定的部署,⾮常有⽤。test: script: rspec retry: 2timeouttimeout是⽤于设置⼀个任务的超时时间build: script: timeout: 3 hours 30 minutestest: script: rspec timeout: 3h 30m参考gitlabci变量declare -x CI="true"declare -x CI_BUILDS_DIR="/builds"declare -x CI_BUILD_BEFORE_SHA="fc8c91ed7cb8f5eefe540786d48f9babd0b48155"declare -x CI_BUILD_ID="49"declare -x CI_BUILD_NAME="mvn_build_job"declare -x CI_BUILD_REF="e880f7c22eca83ac59eb263af097758a7a7f4f4a"declare -x CI_BUILD_REF_NAME="master"declare -x CI_BUILD_REF_SLUG="master"declare -x CI_BUILD_STAGE="package"declare -x CI_BUILD_TOKEN="xxxxxxxxxxxxxxxxxxxx"declare -x CI_COMMIT_DESCRIPTION=""declare -x CI_COMMIT_MESSAGE="更新 ."declare -x CI_COMMIT_REF_NAME="master"declare -x CI_COMMIT_REF_SLUG="master"declare -x CI_COMMIT_SHA="e880f7c22eca83ac59eb263af097758a7a7f4f4a"declare -x CI_COMMIT_TITLE="更新 ."declare -x CI_CONCURRENT_ID="1"declare -x CI_CONCURRENT_PROJECT_ID="1"declare -x CI_CONFIG_PATH="."declare -x CI_DISPOSABLE_ENVIRONMENT="true"declare -x CI_JOB_ID="49"declare -x CI_JOB_IMAGE="XXXXX/maven:3.6.3-openjdk-8"declare -x CI_JOB_NAME="mvn_build_job"declare -x CI_JOB_STAGE="package"declare -x CI_JOB_STATUS="running"declare -x CI_JOB_TOKEN="xxxxxxxxxxxxxxxxxxxx"declare -x CI_JOB_URL="xxxxx/base/demo-sample/-/jobs/49"declare -x CI_PIPELINE_ID="22"declare -x CI_PIPELINE_IID="11"declare -x CI_PIPELINE_SOURCE="push"declare -x CI_PIPELINE_URL="xxxxx/base/demo-sample/pipelines/22"declare -x CI_PROJECT_DIR="/builds/base/demo-sample"declare -x CI_PROJECT_DIR="/builds/base/demo-sample"declare -x CI_PROJECT_ID="226"declare -x CI_PROJECT_NAME="demo-sample"declare -x CI_PROJECT_NAMESPACE="base"declare -x CI_PROJECT_PATH="base/demo-sample"declare -x CI_PROJECT_PATH_SLUG="base-demo-sample"declare -x CI_PROJECT_URL="xxxxx/base/demo-sample"declare -x CI_PROJECT_VISIBILITY="private"declare -x CI_REGISTRY_PASSWORD="xxxxxxxxxxxxxxxxxxxx"declare -x CI_REGISTRY_USER="gitlab-ci-token"declare -x CI_REPOSITORY_URL="gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@xxxxx/base/"declare -x CI_RUNNER_DESCRIPTION="gitlab-runner-gitlab-runner-79fdddc45c-tznlg"declare -x CI_RUNNER_EXECUTABLE_ARCH="linux/amd64"declare -x CI_RUNNER_ID="4"declare -x CI_RUNNER_REVISION="54944146"declare -x CI_RUNNER_SHORT_TOKEN="32d85b65"declare -x CI_RUNNER_TAGS=""declare -x CI_RUNNER_VERSION="13.10.0"declare -x CI_SERVER="yes"declare -x CI_SERVER_NAME="GitLab"declare -x CI_SERVER_REVISION="63daf37"declare -x CI_SERVER_VERSION="11.1.4"declare -x DOCKER_TAG="1.0.0-RELEASE"declare -x FF_CMD_DISABLE_DELAYED_ERROR_LEVEL_EXPANSION="false"declare -x FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR="false"declare -x FF_ENABLE_BASH_EXIT_CODE_CHECK="false"declare -x FF_GITLAB_REGISTRY_HELPER_IMAGE="false"declare -x FF_NETWORK_PER_BUILD="false"declare -x FF_RESET_HELPER_IMAGE_ENTRYPOINT="true"declare -x FF_SHELL_EXECUTOR_USE_LEGACY_PROCESS_KILL="false"declare -x FF_SKIP_NOOP_BUILD_STAGES="true"declare -x FF_USE_DIRECT_DOWNLOAD="true"declare -x FF_USE_FASTZIP="false"declare -x FF_USE_GO_CLOUD_WITH_CACHE_ARCHIVER="true"declare -x FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY="true"declare -x FF_USE_WINDOWS_LEGACY_PROCESS_STRATEGY="true"declare -x GITLAB_CI="true"declare -x GITLAB_FEATURES=""declare -x GITLAB_USER_EMAIL="xxxx@"declare -x GITLAB_USER_ID="59"declare -x GITLAB_USER_LOGIN=""declare -x GITLAB_USER_NAME="xxxx"declare -x HOME="/root"declare -x HOSTNAME="runner-32d85b65-project-226-concurrent-1f625l"declare -x JAVA_HOME="/usr/local/openjdk-8"declare -x JAVA_VERSION="8u275"declare -x KUBERNETES_PORT="tcp://10.233.0.1:443"declare -x KUBERNETES_PORT_443_TCP="tcp://10.233.0.1:443"declare -x KUBERNETES_PORT_443_TCP_ADDR="10.233.0.1"declare -x KUBERNETES_PORT_443_TCP_PORT="443"declare -x KUBERNETES_PORT_443_TCP_PROTO="tcp"declare -x KUBERNETES_SERVICE_HOST="10.233.0.1"declare -x KUBERNETES_SERVICE_PORT="443"declare -x KUBERNETES_SERVICE_PORT_HTTPS="443"declare -x LANG="-8"declare -x MAVEN_CONFIG="/root/.m2"declare -x MAVEN_HOME="/usr/share/maven"declare -x MINIO_PORT="tcp://10.233.36.231:9000"declare -x MINIO_PORT_9000_TCP="tcp://10.233.36.231:9000"declare -x MINIO_PORT_9000_TCP_ADDR="10.233.36.231"declare -x MINIO_PORT_9000_TCP_PORT="9000"declare -x MINIO_PORT_9000_TCP_PROTO="tcp"declare -x MINIO_SERVICE_HOST="10.233.36.231"declare -x MINIO_SERVICE_PORT="9000"declare -x MINIO_SERVICE_PORT_9000_TCP="9000"declare -x OLDPWD="/"declare -x OLDPWD="/"declare -x PATH="/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"declare -x PWD="/builds/base/sample"declare -x SHLVL="1"

发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1688701729a163711.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信