考虑一个带有prebuild和build阶段的虚拟 gitlab 作业。
stages:
- prebuild
- build
Run Code Online (Sandbox Code Playgroud)
该阶段的唯一工作prebuild是为后续阶段创建和缓存依赖项。prebuild仅当 python 文件发生更改时才会触发该阶段requirements.txt。该build阶段有一个cache:policyof pull,这意味着它遵循prebuild缓存。例如,假设缓存由共享的单个文件组成sharedfile:
prebuild_job:
cache:
policy: pull-push
rules:
- changes:
- requirements.txt
paths:
- sharedfile
script:
- echo "FOOBAR" > sharedfile
build_job:
cache:
policy: pull
paths:
- sharedfile
script:
- cat sharedfile
Run Code Online (Sandbox Code Playgroud)
这就是我想要的——仅在更改并使用其输出prebuild时触发(在本例中但实际上是一个完整的 python 虚拟环境)。这非常有效,直到通过Clear Runner Caches按钮在 gitlab 上手动清除缓存,然后我们必须手动重新运行预构建步骤,否则构建将继续失败,因为预构建在缓存清除后从未重新触发。requirements.txtbuildsharedfile
我们如何设置规则或解决方法,以便prebuild_job …
当我了解天蓝色管道时,我几乎到处都会
遇到术语“编译时”和“运行时”。
但是,我仍然没有找到关于它们的明确解释。
我在微软的文档中找到了这个页面,但它并没有非常清楚地解释这些术语。
如果有人可以在Azure Pipelines 的整个运行顺序的上下文中解释这些术语,我会很高兴。
谢谢!
我有一个包含通常阶段的发布管道
开发 -> 测试 -> 预生产 -> 生产
我想知道是否有一种方法可以确保只有主分支可以一直升级到生产,以避免从功能发布和开发分支在生产环境中结束。
我需要在 Dockerfile 中传递一个环境变量作为 LABEL,我的 Dockerfile 如下所示:
FROM nginx
LABEL maintainer="blabla"
ENV GROUP="default"
#Checking if Label values can be set from ENV Variables
LABEL group="${GROUP}"
Run Code Online (Sandbox Code Playgroud)
下面的命令传递构建并运行 docker 文件环境变量:
docker build -t nginx:test_label .
Run Code Online (Sandbox Code Playgroud)
docker run -d -e GROUP="mygroup" nginx:test_label
Run Code Online (Sandbox Code Playgroud)
但是在检查容器时,它给了我标签值而default不是 mygroup。
我究竟做错了什么?
我正在查看天蓝色触发器文档,但仍然无法找到合适的解决方案。在管道 1 执行过程中,如何触发管道 2,等待其成功完成或失败,并根据管道 2 的结果继续执行管道 1 或失败?
azure devops azure-devops azure-pipelines azure-pipelines-release-pipeline
我们已经使用 docker-compose 一年了,没有遇到任何问题。在过去的一周里,我们每个人都开始遇到与权限相关的奇怪错误
at internal/main/run_main_module.js:17:47 : Error: EPERM: operation not permitted, open <PATH TO FILE>
仅当我切换分支时才会发生
组成结构:
version: "2.4"
# template:
x-base: &base-service-template
env_file:
- ./.env
working_dir: /app/
volumes:
- ./src:/app/src:cached
services:
service1:
image: service1
<<: *base-service-template
service2:
image: service2
<<: *base-service-template
Run Code Online (Sandbox Code Playgroud)
我们都在 OSX 上工作。我们尝试授予 docker 对文件系统的权限,但仍然不起作用。
但有一些东西是有效的。重新启动守护进程。但我不想每次切换分支时都重新启动守护进程
附加信息:
每个服务的 docker 文件库如下所示
FROM node:12-alpine as builder
ENV TZ=Europe/London
RUN npm i npm@latest -g
RUN mkdir /app && chown node:node /app
WORKDIR /app
RUN apk add --no-cache python3 make g++ …Run Code Online (Sandbox Code Playgroud) 由于凭证超时,我在可靠地运行云构建触发器时遇到问题。
我已在 Google Cloud Build 中设置了 Google Cloud DevOps 项目,并使用我的私有 GitHub 存储库对触发器进行了身份验证。我的私有 GitHub 存储库具有 Cloud Build GitHub 应用程序集成。
我的 Cloud Build 触发器工作了一段时间,无论自动运行还是手动运行都运行良好。
几个小时后,我开始在触发器执行中遇到错误:
...
FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com...
Run Code Online (Sandbox Code Playgroud)
为了尝试解决此问题,我使用 Cloud Build 触发器页面断开连接,然后重新连接并使用我的私有 GitHub 存储库重新进行身份验证。存储库管理页面显示重新身份验证成功,但在运行触发器时仍然收到“无效的用户名或密码”错误。
我对私有存储库身份验证的工作方式有什么遗漏吗?我是否缺少其他自动刷新 Cloud Build 身份验证的设置?
我已遵循作业和条件工作流程中的条件步骤中描述的指南,并为我的 CircleCI 管道编写了以下代码。
version: 2.1
workflows:
version: 2.1
workflowone:
when:
condition: false
jobs:
- samplejob:
workflowtwo:
when:
condition: true
jobs:
- jobone
jobs:
samplejob:
docker:
- image: buildpack-deps:stable
steps:
- run:
name: Sample Job in WF 1
command: |
echo "This job is in workflowone and the workflow should not run"
jobone:
docker:
- image: buildpack-deps:stable
steps:
- run:
name: Sample Job in WF 2
command: |
echo "This job is in workflowtwo and the workflow should run"
Run Code Online (Sandbox Code Playgroud)
当我运行上面的代码时,输出不是预期的。第一个工作流不应运行,因为条件为假。当管道触发时,两个工作流程都开始运行。谁能指出这里缺少的部分吗?
我正在尝试基于 Azure DevOps 中的旧存储库在 Azure DevOps 中创建新存储库,但传输不起作用。
新的存储库属于新的项目和组织。当我创建它并转到 Repos 时,我看到了以下内容:
似乎我有两种选择将旧存储库导入到此存储库:
当我尝试从命令行推送现有存储库时,我将其提供的命令复制并粘贴到本地计算机上项目目录的根目录中的命令行 (PowerShell)(其中 .git 文件夹和 .sln文件是)。命令是:
git remote add origin https://holland-and-barnes@dev.azure.com/holland-and-barnes/Holland%20and%20Barnes/_git/Holland%20and%20Barnes
Run Code Online (Sandbox Code Playgroud)
运行这个命令,它告诉我:
usage: git remote add [<options>] <name> <url>
-f, --fetch fetch the remote branches
--tags import all tags and associated objects when fetching
or do not fetch any tag at all (--no-tags)
-t, --track <branch> branch(es) to track
-m, --master <branch>
master branch
--mirror[=(push|fetch)]
set up remote as a mirror to push to or fetch from
Run Code Online (Sandbox Code Playgroud)
...进而: …
devops ×10
azure-devops ×4
azure ×3
docker ×2
azure-pipelines-release-pipeline ×1
circleci ×1
circleci-2.0 ×1
dockerfile ×1
git ×1
gitlab ×1
kubectl ×1
kubernetes ×1
minikube ×1
node.js ×1
pipeline ×1
repository ×1