尝试使用 Angular CLI 设置管道并在调用ng build.
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm --version
- npm install
- ng build
Run Code Online (Sandbox Code Playgroud)
angular-cli 是我的 package.json 中的一个开发依赖项,但找不到 ng。
bash: ng: command not found
Run Code Online (Sandbox Code Playgroud)
我错过了什么步骤或做错了什么?谢谢
我们的服务器中有一个应用程序帐户,我们为其生成了 ssh 密钥。我们需要将应用程序帐户公钥上传到我的 bit-bucket 项目中的所有存储库。我的项目中有太多的存储库,我们无法在每次生成新密钥时手动在每个存储库中上传密钥。那么我们是否有任何自动化的方法来做到这一点?
bitbucket bitbucket-api bitbucket-server bitbucket-pipelines
我正在尝试使用来自 bitbucket 的新工具管道。我有多个 .NET 控制台应用程序(不是 Core 应用程序),而不是我想要构建和下载的。我发现这个页面说我可以使用单声道来构建我的项目。我使用这个 .yml 文件来构建它。
image: mono
pipelines:
default:
- step:
script:
- nuget restore
- MONO_IOMAP=case xbuild /t:Build /p:Configuration="Release" /p:Platform="Any CPU" Solution.sln
Run Code Online (Sandbox Code Playgroud)
构建成功,但现在我坚持下载我的应用程序(带有所有 dll 的 exe)。我在这里发现我可以使用 bitbucket 下载。但是如何下载我的部署文件夹?在这里我发现我可以压缩一些文件,然后把它放到 bitbucket 下载中。但是我如何将它与单声道一起使用,以及如何压缩整个文件夹,然后下载它?我不介意使用其他的东西,比如单声道。
我们正在尝试将 Bitbucket Pipelines (Cloud) 与 SonarQube (6.4) 集成。
特别是,如果 SonarQube 分析在我们的Java代码中检测到一些质量门违规,我们希望管道构建失败。
目前,我们正在使用 Jenkins(多分支项目),由于waitForQualityGate()Jenkinsfile 文件(我在其中定义了要执行的管道)中包含的命令,我们设法实现了这种行为。
现在,我们想尝试一下 Bitbucket Pipelines 功能,因为我们的 Git 存储库托管在Bitbucket Cloud 中,并继续使用我们当前的 SonarQube 服务器实例。
为了完整起见,我们的项目是用 Java 编写并由 maven 管理的;我们还在构建过程中使用声纳扫描仪插件。
谁能给我一个提示?或者有没有人知道如何实现这种行为?
我知道声纳插件在 BitBucket 中创建报告作为拉取请求的评论,但这不是我们需要的。
在此先感谢您的帮助。
所以我有一个具有某种结构的项目。每当我将更改推送到任何文件管道时都会运行。但我希望它仅在特定目录发生更改时运行。甚至有可能吗?
我正在使用 bitbucket-pipelines 为我公司的 mulesoft API 设置部署管道。由于与 Jira 的内置集成,这项技术对我们很有吸引力。问题是我们正在使用域项目。所有其他依赖项都是从 anypoint exchange 下载的,但域项目不能托管在那里,所以我收到这个错误:
[ERROR] Failed to execute goal on project sourceControlDemo: Could not resolve dependencies for project com.mycompany:sourceControlDemo:mule-application:1.0.0-SNAPSHOT: Could not find artifact com.mycompany:[mycompany]-domain:jar:mule-domain:1.0.0 in anypoint-exchange (https://maven.anypoint.mulesoft.com/api/v1/maven) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project sourceControlDemo: Could not resolve dependencies for project com.mycompany:sourceControlDemo:mule-application:1.0.0-SNAPSHOT: Could not find artifact com.mycompany:[mycompany]-domain:jar:mule-domain:1.0.0 in anypoint-exchange (https://maven.anypoint.mulesoft.com/api/v1/maven)
Run Code Online (Sandbox Code Playgroud)
在我们当前的过程中,涉及在本地构建项目,域项目包含在工作区中,不会发生此错误。
似乎这里有一些策略: * 创建一个包含依赖项的自定义 docker 映像 - 这个选项似乎有点过分,对我来说是最大的技能差距,因为我从未使用过 docker。* 将域项目托管在要在依赖项目 pom.xml 中引用的私有 Maven 存储库上 - 这似乎是执行此操作的“正常”方式。然而,对于一个依赖项来说,这似乎又是一种矫枉过正。* 在管道文件中克隆域项目存储库,自动将项目安装在本地存储库中 - 这是我非常喜欢的选项。我已经成功克隆了 repo …
我已经了解了使用 bitbucket 的管道,我想制作一个新的管道来上传我的 React 应用程序(使用 create-react-app 引导)并上传到 Amazon S3 存储桶。
我做了一个bitbucket-pipelines.yml这样的文件
image: node:10.15.3
pipelines:
default:
- step:
name: Installing dependencies
caches:
- node
script: # Modify the commands below to build your repository.
- rm -rf package-lock.json
- rm -f node_modules
- yarn add
- step:
name: Build
script:
- yarn build
Run Code Online (Sandbox Code Playgroud)
当 Bitbucket 运行它时,它会向我显示下一条错误消息
env-cmd -f .env.production.local react-scripts build
Error: Unable to locate env file at location (.env.production.local)
Run Code Online (Sandbox Code Playgroud)
这是因为在我的 package.json 中,我使用 env-cmd 来读取构建脚本的环境变量。
"scripts": {
"start": "env-cmd …Run Code Online (Sandbox Code Playgroud) 我正在使用 Atlassian 管道构建 docker 镜像并将其推送到 AWS ECR,但构建正在被拆除并显示以下消息。
信息:正在执行 aws-ecr-push-image 管道...
信息:在环境变量中找到凭据。
信息:成功登录到https://XXXXXXX.dkr.ecr.us-east-1.amazonaws.com
? 找不到图像:404 客户端错误:未找到(“没有这样的图像:图像测试:没有这样的图像:图像测试:最新”)
这是我的 bitbucket-pipelines.yml 代码:
- step:
name: docker build running
services:
- docker
script:
- docker build -t image-test .
artifacts:
- Image_Test.zip
- step:
name: Updating docker image
script:
- pipe: atlassian/aws-ecr-push-image:1.0.2
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
IMAGE_NAME: image-test
TAGS: '${BITBUCKET_TAG} latest'
Run Code Online (Sandbox Code Playgroud)
我确认此映像存在于我的 ECR 存储库中。
bitbucket amazon-web-services bitbucket-pipelines amazon-ecr
我第一次使用 BitBucket Pipelines 通过 SSH 连接到开发服务器,并git pull origin branch在推送到上述分支时执行。这很简单,一切都按预期进行。当合并伴随着 pull 出现并且需要用户输入来提交合并时,就会出现问题。我在失败的构建日志中收到以下消息:
* branch feature/development -> FETCH_HEAD
d2c27a5f..63d74c8f feature/development -> origin/feature/development
error: Terminal is dumb, but EDITOR unset
Not committing merge; use 'git commit' to complete the merge.
Run Code Online (Sandbox Code Playgroud)
我只想绕过这个用户输入要求,在必要时提交并继续。
这是我的构建配置:
image: php:7.1.29
pipelines:
default:
- step:
name: Deploy to dev
deployment: dev
# trigger: manual # Uncomment to make this a manual deployment.
script:
- echo "Deploying to dev..."
- pipe: atlassian/ssh-run:0.2.5
variables:
SSH_USER: 'root'
SERVER: '82.xxx.xx.xx5'
MODE: 'command' …Run Code Online (Sandbox Code Playgroud) 我正在运行我所有的测试用例,其中一些用例有时会失败,管道检测到它并使步骤和构建失败。这会阻止要执行的下一步(压缩报告文件夹)。我想将该 zip 文件作为电子邮件附件发送。
这是我的 bitbucket-pipelines.yml文件
custom: # Pipelines that can only be triggered manually
QA2: # The name that is displayed in the list in the Bitbucket Cloud GUI
- step:
image: openjdk:8
caches:
- gradle
size: 2x # double resources available for this step to 8G
script:
- apt-get update
- apt-get install zip
- cd config/geb
- ./gradlew -DBASE_URL=qa2 clean BSchrome_win **# This step fails**
- cd build/reports
- zip -r testresult.zip BSchrome_winTest
after-script: # On test …Run Code Online (Sandbox Code Playgroud) bitbucket ×4
maven ×2
.net ×1
amazon-ecr ×1
angular-cli ×1
c# ×1
git ×1
java ×1
mono ×1
mulesoft ×1
pipeline ×1
quality-gate ×1
reactjs ×1
sonarqube ×1
yaml ×1