我在存储库下创建了一个 bitbucket 管道,并且生成了 SSH 密钥并更新了主机中的 authorized_keys 文件。交付部分由 rsync 承载,在部署阶段我收到以下错误。
rsync -zrSlh --stats --exclude-from=deployment-exclude-list.txt $BITBUCKET_CLONE_DIR/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH;
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2]
Run Code Online (Sandbox Code Playgroud)
我的 bitbucket-pipelines.yml 如下,
image: php:7.2.1-fpm
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update
- apt-get install git -y
- export APP_ENV=testing
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- step:
name: Deploy to test …Run Code Online (Sandbox Code Playgroud) pipeline bitbucket continuous-deployment bitbucket-pipelines
我是 BitBucket 管道的新手,因为我使用 Webhook 将我的更改部署到 FTP。
我已经设置了 reccommended atlassian/ftp-deploy:0.2.0 管道并且它工作正常,但我想设置只获取更改的文件并将其发送到 FTP。
image: node:10.15.3
pipelines:
default:
- step:
name: FTP Deploy
script: # Modify the commands below to build your repository.
- pipe: atlassian/ftp-deploy:0.2.0
variables:
USER: 'myFTPusername'
PASSWORD: 'myFTPpass'
SERVER: 'myFTPserver'
REMOTE_PATH: 'myFTPpath'
- step:
name: Deploy message
deployment: test
script:
- echo "Deploying to main environment"
Run Code Online (Sandbox Code Playgroud)
任何帮助如何设置它以便它只将更改的文件发送到 FTP?
预期输出是bitbucket-pipelines.yml 的代码
我有一个Angular项目,当我在本地运行“ng test”时,一切正常,但是在 bitbucket 管道中我遇到了这个错误。
src/app/services/user-store/user.service.ts:7:22 中出现错误 - 错误 TS2307:找不到模块“../../models/user”或其相应的类型声明。7 从 '../../models/user' 导入 { User };
我的 tsconfig.base
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
}
}
Run Code Online (Sandbox Code Playgroud)
我的 tsconfig.spec.json
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
Run Code Online (Sandbox Code Playgroud)
我认为与我的 tsconfig.base 中的“目标”相关,但我不确定,也许我的 yaml …
pipeline bitbucket ecmascript-5 typescript bitbucket-pipelines
我正在使用 BitBucket Pipelines 尝试自动部署暂存和生产编译的代码。暂存工作正常,生产工作在我的本地服务器上工作正常,但在管道上则不然。失败的日志如下,我不知道为什么会失败:
"build:prod": "ng build --prod"
+ npm run build:prod
> mobile-app@1.1.2 build:prod /opt/atlassian/pipelines/agent/build
> ng build --prod
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
<--- Last few GCs --->
[67:0x3002f10] 220826 ms: Mark-sweep 2014.9 (2069.4) -> 2004.8 (2071.6) MB, 908.6 / 0.1 ms (average mu = 0.172, current mu = 0.096) allocation failure scavenge might not succeed
[67:0x3002f10] 222095 ms: Mark-sweep 2016.7 (2071.6) -> 2011.3 (2074.4) MB, 1215.6 / 0.1 ms (average mu = …Run Code Online (Sandbox Code Playgroud) 我是在 bitbucket 上创建管道以在合并后自动构建特定分支的新手。该项目是用C++编写的,具有以下结构:
PROJECT FOLDER
- .devcontainer/
- devcontainer.json
- bin/
- doc/
- lib/
- src/
- CMakeLists.txt
- ...
- CMakeLists.txt
- clean.sh
- compile.sh
- configure.sh
- DockerFile
- bitbucket-pipelines.yml
Run Code Online (Sandbox Code Playgroud)
我们创建了一个 DockerFile,其中包含构建项目所需的所有设置。有什么方法可以将 bitbucket-pipeline.yml 上的 docker 映像从存储库引用到 DockerFile 吗?
我已经能够将 docker 映像上传到我的 docker hub 上,并通过定义以下内容将其与我的凭据一起使用:
image:
name: <dockerhubname>/<dockername>
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
email: $DOCKER_HUB_EMAIL
Run Code Online (Sandbox Code Playgroud)
但我不确定如何执行此操作,bitbucket 从存储库中获取 DockerFile 并使用它来构建映像,如果这样做,构建时间将会增加。
提前致谢!
我在通过运行 bitbucket 管道描述 ecs 任务定义时遇到问题。
我面临的问题如下,
调用DescribeTaskDefinition操作时发生错误(ClientException)
我用来通过 bitbucket 管道中的 shell 脚本执行的命令如下,
LATEST_TASK_DEFINITION=$(aws ecs describe-task-definition --task-definition ${TASK_FAMILY})
echo $LATEST_TASK_DEFINITION \
| jq '{containerDefinitions: .taskDefinition.containerDefinitions, volumes: .taskDefinition.volumes}' \
| jq '.containerDefinitions[0].image='\"${DOCKER_IMAGE}\" \
> /tmp/tmp.json
Run Code Online (Sandbox Code Playgroud)
aws ecs register-task-definition --family ${TASK_FAMILY} --cpu 256 --memory 512 --network-mode awsvpc --requires-compatibilities "FARGATE" --task-role-arn arn:aws:iam::xxxxxxx:role/ECSTaskExecutionRole --execution-role-arn arn:aws:iam::xxxxxxx:role/ECSTaskExecutionRole --cli-input-json file:///tmp/tmp.json
Run Code Online (Sandbox Code Playgroud)
但是当我从 Linux 终端运行相同的命令时,它就会运行。
有人面临这样的问题吗?
提前致谢。
我在运行 yaml 脚本的 Bitbucket Pipelines 上有一个暂存和生产服务器设置;
image: samueldebruyn/debian-git
name: Staging - Upload FTP
script:
- apt-get update
- apt-get -qq install git-ftp
- git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD -v ftp://$FTP_HOST/$FTP_STAGING_PATH
- echo "Completed upload"
Run Code Online (Sandbox Code Playgroud)
该脚本运行良好,并以相同的格式在线广泛用于其他使用管道的人。
我在 Debian 11 发布并成功构建之前 5-10 分钟提交到我的临时服务器,然后发布 Debian 11 发布所有后续版本我已经推送到临时版本,或者生产导致构建失败并出现以下错误...
Ign:1 http://security.debian.org/debian-security stable/updates InRelease
Get:2 http://deb.debian.org/debian stable InRelease [113 kB]
Err:3 http://security.debian.org/debian-security stable/updates Release
404 Not Found [IP: 151.101.250.132 80]
Get:4 http://deb.debian.org/debian stable-updates InRelease [40.1 kB]
Get:5 http://deb.debian.org/debian stable/main amd64 Packages [8178 kB]
Reading …Run Code Online (Sandbox Code Playgroud) 我正在尝试为我的 Angular 应用程序运行管道,但当涉及到“npm run build”部分时,它崩溃了,失败原因是“容器“Build”超出了内存限制。” 我尝试修改 yml 文件中的内存设置,例如添加“size 2x”并更改分配给 docker 的内存量。
位桶管道.yml:
image: node:14.17.0
options:
docker: true
size: 2x
pipelines:
custom:
prod-deployment:
- step:
name: Build angular app
caches:
- node
services:
- docker
size: 2x # Double resources available for this step.
script:
- mv .npmrc_config .npmrc
- npm install --unsafe-perm
- npm install -g @angular/cli@12.2.6
- free -m
- npm run dashboard:build
- wget "censored for security"
artifacts:
- dist/**
- step:
name: Deploy artifacts using SCP to …Run Code Online (Sandbox Code Playgroud) 我正在使用 BitBucket 管道通过 pylint 执行 linting 检查。几个小时前还运行良好。尽管最终分数远远超过了最低标准(8.0),但我一直面临以下错误:
您的代码的评分为 9.43/10
Traceback (most recent call last):
File "/usr/local/bin/pylint-fail-under", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/pylint_fail_under/__main__.py", line 42, in main
score = results.linter.stats["global_note"]
TypeError: 'LinterStats' object is not subscriptable
Run Code Online (Sandbox Code Playgroud) 我目前正在尝试构建一个 bitbucket 管道,该管道应该在部署之前运行 docker-compose 文件来测试微服务。docker compose 文件应该构建我的微服务映像并运行它。
这一切似乎在本地工作正常,但是,当我将东西移动到管道时,我不断收到此错误:
#1 [internal] booting buildkit
#1 pulling image moby/buildkit:buildx-stable-1
#1 pulling image moby/buildkit:buildx-stable-1 2.4s done
#1 creating container buildx_buildkit_default 0.0s done
#1 ERROR: Error response from daemon: authorization denied by plugin pipelines: --privileged=true is not allowed
------
> [internal] booting buildkit:
------
Error response from daemon: authorization denied by plugin pipelines: --privileged=true is not allowed
Run Code Online (Sandbox Code Playgroud)
Dockerfile
FROM node:12-alpine
WORKDIR /app/playground
RUN npm install npm@7.1.2
RUN rm -rf /usr/local/lib/node_modules/npm
RUN mv node_modules/npm /usr/local/lib/node_modules/npm
COPY …Run Code Online (Sandbox Code Playgroud) bitbucket ×8
pipeline ×4
docker ×2
angular ×1
angular-cli ×1
debian ×1
ecmascript-5 ×1
ftp ×1
node.js ×1
npm ×1
pylint ×1
pylintrc ×1
python ×1
typescript ×1