近一个月来,我一直在为这个问题而苦苦挣扎。我只是无法解决它...\n我的 gitlab CI 管道失败,总是出现相同的错误,说找不到我的存储库之一...
\n The project you were looking for could not be found or you don't have permission to view it.\nfatal: repository 'https://gitlab.in2p3.fr/xemis/xemis_2/logiciel/bibliotheques/x2_can_port/' not found\nfatal: clone of 'https://gitlab-ci-token:[MASKED]@gitlab.in2p3.fr/xemis/xemis_2/logiciel/bibliotheques/x2_can_port' into submodule path '/builds/xemis/xemis_2/logiciel/x2_calibration/src/lib/x2_can_port' failed\nFailed to clone 'src/lib/x2_can_port'. Retry scheduled\nRun Code Online (Sandbox Code Playgroud)\n我的所有子模块都添加了相对 url,它们都位于同一个 gitlab 服务器上,它们都是私有的,我拥有所有这些存储库。
\n所有这些子模块之间的唯一区别是,有些子模块有一个主分支(x2_can_port 和 x2_logger),而所有其他子模块都有一个主分支......
\n当然,当我在本地克隆项目时,它工作得很好。
\n在这里,您可以找到我的 gitlab ci 文件,以及我的 git 子模块文件
\n非常感谢您的帮助
\n问候,
\n奥利维尔
\nstages:\n - build\n - style\n \nbuild:\n stage: build\n image: gitlab-registry.in2p3.fr/xemis/xemis_2/logiciel/x2_calibration\n variables:\n GIT_SUBMODULE_STRATEGY: recursive\n GIT_SUBMODULE_DEPTH: 1\n …Run Code Online (Sandbox Code Playgroud) 我正在使用 GitLab CI/CD,并且有一个管道,其中包含来自单独配置文件的作业,该管道似乎工作正常。它看起来像这样:
.gitlab-ci.yml:
stages:
- triggers
- build
- test
- deploy
trigger_infra:
stage: triggers
trigger:
include: src/infra/.gitlab-ci.yml
rules:
- changes:
- src/infra/lib/spa-stack.ts
Run Code Online (Sandbox Code Playgroud)
src/infra/.gitlab-ci.yml:
deploy_spa:
stage: deploy
script:
- cd src/spa
Run Code Online (Sandbox Code Playgroud)
然而,我最近遇到了以下场景:
spa-stack.ts文件的代码;构建已触发并通过合并构建的错误消息是“无法创建下游管道,管道不会为选定的触发器运行。规则配置阻止将任何作业添加到管道中。”
我在这里缺少什么?下游作业没有规则配置,所以我觉得它应该总是运行,不问任何问题。
continuous-integration continuous-deployment gitlab gitlab-ci gitlab-ci-runner
我有一个功能性的 gitlab 管道来将代码发布到 AWS 服务器。它突然开始失败,没有任何原因。我收到以下错误。有人可以给我一些线索吗?我无法发布整个代码,因为它很长。
** [WARNING]: - geerlingguy.docker was NOT installed successfully: missing
required 'current_version' from server response
(https://galaxy.ansible.com/api/)
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
ERROR: Job failed: exit code 1**
Run Code Online (Sandbox Code Playgroud) 我想知道是否可以在我的 gradle 文件的 DefaultConfig 中使用 versionName 变量:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "app"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
Run Code Online (Sandbox Code Playgroud)
在我的 gitlab-ci 文件中:
stages:
- build
release:
stage: build
only:
- release
script:
- ./gradlew assembleRelease
# Here I need to use the value of versionName in my gradle file.
Run Code Online (Sandbox Code Playgroud)
有没有一种简单的方法可以做到这一点?
我需要由 gitlab-ci.yml(运行 Ubuntu 14.04)创建的 VM 来安装打包程序,然后访问和下载我的整个私有 gitlab 存储库,或者只是来自该存储库的单个文件。
首先,我尝试在我的脚本中创建一个 ssh 密钥来创建容器和虚拟机,然后将 .pub 远程添加到 gitlab 存储库。但是我忘记了在构建完成后会丢弃新创建的容器。这意味着每次创建容器时都会生成新的密钥。
无论如何,我可以动态添加和删除私有 GitLab 存储库的密钥吗?
我目前正在使用GitLab-CI来将我的项目的暂存分支刻录到Google Firebase。每个部署都会获得带有PipelineID和Build ID的特殊注释。
firebase deploy -m "Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive --token $FIREBASE_DEPLOY_KEY
Run Code Online (Sandbox Code Playgroud)
为了易于使用,当在Firebase控制台中回滚提交时,我想将提交消息包括到部署注释中。
我搜索了文档,但没有找到一个变量。我弄错了,还是真的不可能?
谢谢你的帮助!
我正在通过Kubernetes引擎在Google Cloud Platform上使用docker和kubernetes。我有在app.yaml文件中配置的机密,如下所示:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: app
namespace: $CI_COMMIT_REF_SLUG
labels:
app: app
spec:
replicas: 1
template:
metadata:
labels:
app: app
spec:
containers:
- name: app
image: gcr.io/engagement-org/app:$CI_COMMIT_SHA
imagePullPolicy: Always
ports:
- containerPort: 9000
env:
- name: MAILJET_APIKEY_PUBLIC
valueFrom:
secretKeyRef:
name: mailjet
key: apikey_public
- name: MAILJET_APIKEY_PRIVATE
valueFrom:
secretKeyRef:
name: mailjet
key: apikey_private
Run Code Online (Sandbox Code Playgroud)
每次我按下一个新分支时,都会通过gitlab-ci文件中的部署创建一个新的名称空间。秘密是这样创建的:
- kubectl create secret generic mailjet --namespace=$CI_COMMIT_REF_SLUG --from-literal=apikey_public=$MAILJET_APIKEY_PUBLIC --from-literal=apikey_private=$MAILJET_APIKEY_PRIVATE || echo 'Secret already exist';
Run Code Online (Sandbox Code Playgroud)
现在,我已经更新了mailjet api密钥,并希望对所有名称空间进行更改。我可以通过在Pod上获得外壳并运行来编辑每个命名空间上的秘密kubectl edit secret mailjet --namespace=<namespace_name>
我想要的是将新的秘密值发送到将来将要创建的新容器中。当我部署一个新值时,它仍然使用旧值。
据我了解,gitlab-ci文件使用app.yaml文件将环境变量替换为值。但是我不明白app.yaml在哪里找到原始值。
谢谢您的帮助。
它正在使用 java 8,但我更改为 java 10(我关注了这篇文章:无法使用 Maven 编译简单的 Java 10 项目)
我收到此错误:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:47 min
[INFO] Finished at: 2018-09-26T20:15:28Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project importparcoursup: Fatal error compiling: invalid flag: --release -> [Help 1]
[ERROR]
Run Code Online (Sandbox Code Playgroud)
gitlab-ci.yml
image: maven:latest
stages:
- build
build:
stage: build
script:
- mvn install:install-file -Dfile=lib/ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar compile
Run Code Online (Sandbox Code Playgroud)
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nc.unc</groupId>
<artifactId>importparcoursup</artifactId> …Run Code Online (Sandbox Code Playgroud) hosts在 GitLab CI/CD 管道期间,我们必须在 Spring Boot 应用程序的动态生成的 Elastic Beanstalk 实例中自定义文件。为此,我们需要提供一个.ebextensions包含如下配置文件的目录:
commands:
01_add_hosts:
command: echo 123.12.12.123 myhost.com >> /etc/hosts
Run Code Online (Sandbox Code Playgroud)
由于我们有一个spring boot应用程序,我们必须.ebextensions在我们的fat jar的根级别进行打包。所以,基本上我们解压缩 jar,添加 ebextensions 目录并将其压缩回来。这样我们就成功地在我们的 Gitlab 管道中实现了 Beanstalk 定制。
但是,要进行此过程,我们可以maven-antrun-plugin这样使用:
<!-- Bundle .ebextensions inside jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>prepare</id>
<phase>package</phase>
<configuration>
<tasks>
<unzip src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.directory}/${project.build.finalName}" />
<copy todir="${project.build.directory}/${project.build.finalName}/" overwrite="false">
<fileset dir="./" includes=".ebextensions/**"/>
</copy>
<zip compress="false" destfile="${project.build.directory}/${project.build.finalName}.jar" basedir="${project.build.directory}/${project.build.finalName}"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
问题是这maven-antrun-plugin是 2014 年的旧插件,这看起来不是实现此捆绑 …
我正在尝试在容器内使用docker命令。我使用此命令挂载/var/run/docker.sock并运行容器
docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在容器内使用docker(gitlab-runner)时出现错误
docker: not found
Run Code Online (Sandbox Code Playgroud)
主办:
srw-rw---- 1 root docker 0 Mar 23 15:13 docker.sock
Run Code Online (Sandbox Code Playgroud)
容器:
0 srw-rw---- 1 root gitlab-runner 0 Mar 23 15:13 docker.sock
Run Code Online (Sandbox Code Playgroud)
在我删除旧容器并创建新容器之前,此方法工作正常,现在我无法在容器中运行docker。请帮忙。
我正在尝试使用 docker 镜像 mcr.microsoft.com/dotnet/core/sdk:2.2 使用 Angular 为 ASP.NET Core Web 应用程序编写 .gitlab-ci.yml 文件
构建失败并出现错误,指出缺少 Nodejs。该项目需要节点下载依赖项并构建嵌入其中的 Angular 应用程序。
.gitlab-ci.yml
image: mcr.microsoft.com/dotnet/core/sdk:2.2
stages:
- build
- test
variables:
test: "testcases"
before_script:
- "cd src"
- "dotnet restore"
build:
stage: build
script:
- "dotnet build"
test:
stage: test
script:
- "cd $test"
- "dotnet test"
Run Code Online (Sandbox Code Playgroud) 我是 docker 和 jenkins 的新手。但是最终我在 jenkins 中创建了一个作业,以便我可以删除存储在我们的 linux 机器(CentOS7)中的 gitlab-runner 的卷缓存
为了实现这一点,我每 6 小时在 jenkins 中使用以下命令创建一个定期作业:
docker volume prune -f
Run Code Online (Sandbox Code Playgroud)
但是它根本不清理空间。这是詹金斯工作的输出:
Started by timer
Running as SYSTEM
Building remotely on buildbng17 (gitlab) in workspace /mnt/data0/jenkins/workspace/gitlab-cleanup
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
[gitlab-cleanup] $ /bin/sh -xe /tmp/jenkins3799570002967825583.sh
+ find /mnt/data0/gitlab/data/backups/ -name '*.tgz' -mtime +30
/mnt/data0/gitlab/data/backups/etc-gitlab-1611415968.tgz
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of …Run Code Online (Sandbox Code Playgroud) 我有 .gitlab-ci.yml 文件,其中包含作业(使用 Win Runner,但在我的问题中并不重要):
runWin:
stage: runOnWin
tags: ['WinRunner']
rules:
- if: $CI_COMMIT_BRANCH == $jobbranch
script: |
echo "WinRunner job started %CI_JOB_NAME%"
dir
Run Code Online (Sandbox Code Playgroud)
它工作正常,但是 gitlab-runner 从 git 下载源代码,但实际上我根本不需要它。我可以写一些命令或关键字来阻止它吗?
gitlab-ci ×13
gitlab ×7
docker ×3
java ×2
maven ×2
amazon-ec2 ×1
angular ×1
ansible ×1
asp.net-core ×1
git ×1
gradle ×1
java-10 ×1
jenkins ×1
kubernetes ×1
packer ×1
spring-boot ×1