标签: bitbucket-pipelines

如何连接到 Bitbucket 管道中的 docker 守护进程

我想在 Bitbucket 管道中运行 docker 容器。但我无法执行任何命令,因为它声称 docker 守护进程没有运行。但是,我没有找到任何方法来启动它。

INFO     Running command 'which docker' in '/opt/atlassian/pipelines/agent/build'
INFO     STDOUT b'/usr/bin/docker\n'
INFO     STDERR b''
INFO     Running command 'docker --version' in '/opt/atlassian/pipelines/agent/build'
INFO     STDOUT b'Docker version 19.03.15, build 99e3ed8\n'
INFO     STDERR b''
INFO     Running command 'systemctl start docker' in '/opt/atlassian/pipelines/agent/build'
INFO     STDOUT b''
INFO     STDERR b'/bin/sh: 1: systemctl: not found\n'
INFO     Running command 'sudo systemctl start docker' in '/opt/atlassian/pipelines/agent/build'
INFO     STDOUT b''
INFO     STDERR b'/bin/sh: 1: sudo: not found\n'
INFO     Trying to remove old Docker …
Run Code Online (Sandbox Code Playgroud)

docker bitbucket-pipelines

3
推荐指数
1
解决办法
5863
查看次数

在 bitbucket 管道中使用 glob 模式来匹配语义标签

我想通过匹配 Bitbucket 管道中的标签语义来触发不同的管道。通配符似乎仅适用于*匹配,但通配符模式的其他功能似乎不被采用:

+([0-9]).+([0-9]).+([0-9])

例如。这应该匹配每个标签,例如1.0.0,但不匹配其他任何标签。

关于如何实现这一目标有什么想法吗?

我不想触发任何管道,在管道脚本中进行检查并提前退出。

pipelines:
  tags:
    +([0-9]).+([0-9]).+([0-9]):
       name: Pipeline for new semantic tag
       script:
         - ...
Run Code Online (Sandbox Code Playgroud)

注意:我也尝试将 glob 放在 之间",但这也不起作用。

glob bitbucket bitbucket-pipelines

3
推荐指数
1
解决办法
1547
查看次数

Bitbucket 管道 - 安装预提交 ts-lint 时出错

我的管道中有一个步骤在 Bitbucket 上运行我们配置的预提交:

...
- step:
    name: Passing linters
    image: python:3.7-slim-stretch
    script:
      - pip3 install "pre-commit==2.17.0"
      - apt-get update && apt-get --assume-yes install git
      - pre-commit run --all-files

Run Code Online (Sandbox Code Playgroud)

没有进行任何更改,但它突然停止工作。

管道结果:

+ pre-commit run --all-files
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Initializing environment for https://github.com/psf/black:click==8.0.4.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/maximevast/pre-commit-tslint/.
[INFO] Initializing environment for https://github.com/maximevast/pre-commit-tslint/:tslint-react@4.1.0,tslint@5.20.1,typescript@4.0.2.
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] …
Run Code Online (Sandbox Code Playgroud)

bitbucket pre-commit pre-commit-hook bitbucket-pipelines pre-commit.com

3
推荐指数
1
解决办法
1826
查看次数

是否可以使用composer的存档功能在本地压缩项目?

是否可以使用composer的存档功能在本地压缩项目(类似于使用zip)?例如,我尝试过composer archive my-repo/project --format=zip --file test-archive。它的工作原理是创建一个名为 的 zip 文件test-archive,但 Composer 是通过首先转到我的 satis 存储库并下载该项目的副本来实现的。

我也在我的composer.json 中定义了这个

"archive": {
        "exclude": [
            ".*",
            "!.gitignore",
            "node_modules/",
            "vendor/",
            "www/",
            "composer/",
            "*.lst",
            "*.yml"
        ]
    }
Run Code Online (Sandbox Code Playgroud)

我想做的是将存档功能用作位桶管道构建过程的一部分。目标是压缩项目文件(不包括某些文件)并将它们传递到 bitbucket 存储库的下载页面。我有一个使用 zip 的工作步骤,但存档使用更好的语法来排除文件。

php bitbucket composer-php bitbucket-pipelines

2
推荐指数
1
解决办法
2145
查看次数

无法用红宝石宝石安装sass.无法构建gem原生扩展

尝试在位桶管道中安装sass docker实例并获取错误 Failed to build gem native extension

日志显示以下内容:

gem install sass --no-user-install
Successfully installed rb-fsevent-0.10.2
Building native extensions.  This could take a while...
ERROR:  Error installing sass:
    ERROR: Failed to build gem native extension.
Run Code Online (Sandbox Code Playgroud)

我正在使用图像 php:7.1.1

应该像我运行的脚本一样安装Ruby和Gem:

apt-get update && apt-get install -y unzip nodejs ruby-full
gem install sass --no-user-install
Run Code Online (Sandbox Code Playgroud)

提前致谢

ruby rubygems sass docker bitbucket-pipelines

2
推荐指数
1
解决办法
699
查看次数

如何阻止 Bitbucket 管道构建?

有什么办法可以阻止 Bitbucket 管道的构建?

该过程需要超过 25 分钟吗?

.yml 文件内容是:-

image: node:8.9.4
pipelines:
  default:
    - step:
        caches:
          - node
        script: # Modify the commands below to build your repository.
          - if [ $BITBUCKET_BRANCH == 'master' ]; then
          - npm install -g @angular/cli
          - npm install -g firebase-tools
          - npm install
          - ng build
          - firebase deploy --only hosting --token "$FIREBASE_TOKEN" --public dist
          - fi
Run Code Online (Sandbox Code Playgroud)

firebase firebase-hosting bitbucket-pipelines angular

2
推荐指数
1
解决办法
2320
查看次数

`eb init`使用pkg_resources.ContextualVersionConflict PyYAML 4.1失败

从bitbucket管道部署我的弹性beanstalk应用程序时遇到一些麻烦.同样的代码一直没有问题,所以我最好的猜测是某种依赖问题.

(awsebcli版本3.14.1)

管道的图像是python:3.5.2 ,这是失败的步骤:

- step:
      name: Test Deploy
      deployment: test
      caches:
        - pip
      script:
        - pip install awsebcli --upgrade
        - eb init myAppName -r us-east-1 -p Python  # This line started failing :'(
        - eb deploy myAppName-dev-1
Run Code Online (Sandbox Code Playgroud)

和错误输出:

eb init myAppName -r us-east-1 -p Python Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 570, in _build_master ws.require(__requires__) File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 888, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 779, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.ContextualVersionConflict: (PyYAML 4.1 …

python amazon-elastic-beanstalk bitbucket-pipelines

2
推荐指数
1
解决办法
598
查看次数

如果在Bitbucket Pipeline上阻塞,如何编写多行?

从这里我了解到Bitbucket Pipeline支持ifs语句。

我该如何在if语句中使用多行块?

这不计算:

    script:
      - if [ $BITBUCKET_BRANCH == "master" ];
        then;
          echo Line1
          echo line2
        fi;
Run Code Online (Sandbox Code Playgroud)

bitbucket-pipelines

2
推荐指数
2
解决办法
1429
查看次数

如何在Bitbucket管道中使用git子模块?

如何在Bitbucket管道中使用git子模块?

我正在使用Bitbucket管道来构建我的项目,并且在子模块中遇到问题,我可能没有正确配置SSH密钥。

我所做的:

  1. 在我的计算机上创建了SSH密钥对。
  2. 将相同的密钥对粘贴到“设置/ SSH密钥”下的两个存储库(将在其中运行构建的存储库和依赖项存储库中)中。

生成错误:

Submodule 'dependencies/my-dependency' (git@bitbucket.org:mycompany/my-dependency.git) registered for path 'dependencies/my-dependency'
Cloning into 'dependencies/my-dependency'...
Warning: Permanently added the RSA host key for IP address '18.205.93.2' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Clone of 'git@bitbucket.org:mycompany/my-dependency.git' into submodule path 'dependencies/my-dependency' failed
Run Code Online (Sandbox Code Playgroud)

我的yml文件

image:
  name: myuser/my-image-name
  username: $DOCKER_HUB_USERNAME
  password: $DOCKER_HUB_PASSWORD
  email: $DOCKER_HUB_EMAIL

pipelines:
  branches:
    pipelines-setup:
      - step: …
Run Code Online (Sandbox Code Playgroud)

git ssh git-submodules bitbucket-pipelines

2
推荐指数
3
解决办法
1295
查看次数

Github 功能,如 Bitbucket Pipeline

github.com 有没有像 Bitbucket Pipeline 一样的服务/功能?我实际上想将我的主分支推送到 FTP 服务器 (cpanel, apache) 。使用 Bitbucket Pipeline 真的很容易,但是在 Github 中有什么方法可以做到吗?

github bitbucket bitbucket-pipelines

2
推荐指数
1
解决办法
1036
查看次数