标签: bitbucket-pipelines

使用Bitbucket管道从docker实例SSH到staging机器

使用新的Bitbucket管道功能,如何从它旋转的docker容器SSH到我的分段盒?

我的管道中的最后一步是.sh在登台时部署必要代码的文件,但由于我的登台框使用公钥认证而不知道docker容器,因此SSH连接被拒绝.

无论如何不通过SSH使用密码身份验证来解决这个问题(通过不断选择通过公钥进行身份验证,这也导致了我的问题.)?

authentication ssh public-key docker bitbucket-pipelines

8
推荐指数
1
解决办法
2850
查看次数

如何以编程方式使Bitbucket Pipeline的缓存无效?

我的Bibucket管道中有一个node_modules缓存,并添加了新模块(例如yarn add react-modal)-如何使Bitbucket管道检测到新的yarn.lock并使它的缓存无效?

caching bitbucket continuous-deployment bitbucket-pipelines

8
推荐指数
1
解决办法
764
查看次数

如何在Bitbucket Pipelines中缓存APT包?

我正在尝试使用 gradle、jdk 8 构建一个项目并使用 ansible 进行部署。

我找不到包含所有这些的最新 docker 映像,因此我正在即时安装 ansible。

据称 Bitbucket 管道能够创建自定义缓存,但它似乎没有缓存 apt 目录

image: java:8

pipelines:
  default:
    - step:
        caches:
          - gradle
          - apt
        script:
          - echo 'deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main' >> /etc/apt/sources.list
          - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
          - apt-get update && apt-get install -y ansible
          - bash ./gradlew clean bootJar
definitions:
  caches:
    apt: /var/cache/apt/archives
Run Code Online (Sandbox Code Playgroud)

结果是

Dependency caches
gradle: ~/.gradle/caches        158.37 MB   06 Apr 2018 
apt:    /var/cache/apt/archives 151 Bytes   06 Apr 2018 
Run Code Online (Sandbox Code Playgroud)

编辑:我添加了一个步骤来列出目录,不仅那里什么都没有,我在整个系统上找不到任何 deb 文件

find …
Run Code Online (Sandbox Code Playgroud)

apt docker bitbucket-pipelines

7
推荐指数
1
解决办法
847
查看次数

有没有办法在 bitbucket 管道中缓存 DockerHub 图像?

我正在使用来自 dockerhub 的外部 docker 图像。

在每一步中,dockerimage 都会一次又一次地从 dockerhub 中拉取。是的,这是理想的工作流程。

我的问题是我们可以缓存这个图像,这样它就不会在每一步都从 dockerhub 拉取吗?这个 DockerImage 不会经常更改,因为它只预装了节点和流星。

那么可以缓存docker镜像吗?

原来的 bitbucket-pipeline.yml

image: tasktrain/node-meteor-mup

pipelines:
  branches:
    '{develop}':
      - step:
          name: "Client: Install Dependencies"
          caches:
            - node
          script:
            - npm install
            - npm run setup-meteor-client-bundle
          artifacts:
            - node_modules/**
      - step:
          name: "Client: Build for Staging"
          script:
            - npm run build-browser:stag
          artifacts:
            - dist/**
      - step:
          name: "Client: Deploy to Staging"
          deployment: staging
          script:
            - pipe: atlassian/aws-s3-deploy:0.2.2
              variables:
                AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
                AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
                AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
                S3_BUCKET: $S3_STAGING_BUCKET_NAME
                LOCAL_PATH: …
Run Code Online (Sandbox Code Playgroud)

bitbucket bitbucket-pipelines

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

审查 Bitbucket 管道中的应用程序?

我正在研究 DevOps 工作流程,我们可以用它来替换当前的 DevOps 实施。我们使用 Bitbucket 云来托管我们的存储库。

在研究过程中,我偶然发现了 GitLab CI/CD 的“审查应用程序”功能。

使用 Bitbucket 管道是否可以实现类似的目标?

bitbucket-pipelines

7
推荐指数
0
解决办法
457
查看次数

bitbucket 管道错误 - 容器“docker”超出内存限制

我看到 bitbucket 管道错误 - 运行 bitbucket 管道时容器“docker”超出了内存限制。我尝试按照以下文档使用所有可能的服务内存限制,但问题未解决。 https://confluence.atlassian.com/bitbucket/use-services-and-databases-in-bitbucket-pipelines-874786688.html#UseservicesanddatabasesinBitbucketPipelines-Servicememorylimits

你能帮助解决问题吗?

docker bitbucket-pipelines

7
推荐指数
3
解决办法
8304
查看次数

如何将正确的项目路径传递到bitbucket管道?

我想aws lamda .net core project使用部署bit bucket pipeline

我已经创建bitbucket-pipelines.yml如下,但构建运行后出现错误 -

MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.

文件代码-

image: microsoft/dotnet:sdk

pipelines:
  default:
    - step:
        caches:
          - dotnetcore
        script: # Modify the commands below to build your repository.
          - export PROJECT_NAME=TestAWS/AWSLambda1/AWSLambda1.sln
          - dotnet restore
          - dotnet build $PROJECT_NAME
          - pipe: atlassian/aws-lambda-deploy:0.2.1
            variables:
              AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
              AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
              AWS_DEFAULT_REGION: 'us-east-1'
              FUNCTION_NAME: 'my-lambda-function'
              COMMAND: 'update' …
Run Code Online (Sandbox Code Playgroud)

bitbucket amazon-web-services continuous-deployment aws-lambda bitbucket-pipelines

7
推荐指数
1
解决办法
1万
查看次数

YAML 锚定在 bitbucket 管道中

我正在尝试编写 bitbucket 管道并使用YAML 锚点来减少重复。

这就是我想做的例子:

---

definitions:
  steps:
    - step: &build-test-alpine
        image: php:7.4-alpine
        caches:
          - composer
        script:
          - apk add unzip curl
          - curl -sS https://getcomposer.org/installer | php -- --install-dir='/usr/local/bin' --filename='composer'
          - composer --no-ansi -n install
          - composer --no-ansi -n test

pipelines:
  custom:
    deploy:
      - step:
          name: Build and deploy application
          <<: *build-test-alpine
          script:
            - Some other command to execute

  default:
    - step:
        <<: *build-test-alpine
        name: PHP 7.4
    - step:
        <<: *build-test-alpine
        image: php:7.3-alpine
        name: PHP 7.3

... …
Run Code Online (Sandbox Code Playgroud)

yaml bitbucket-pipelines

7
推荐指数
1
解决办法
6335
查看次数

使用 paketo 进行 Spring-Boot docker 构建在 Bitbucket 管道上失败

我的 spring-boot projekts 使用 spring-boot-maven-plugin 及其构建映像目标在 bitbucket.org 上构建其 docker 映像。在管道上,我们总是收到以下 Maven 错误:

Docker API call to 'localhost:2375/v1.24/containers/create' failed with status code 403 "Forbidden"
Run Code Online (Sandbox Code Playgroud)

在docker日志中我发现了以下内容

time="2021-03-25T11:30:59Z" level=info msg="Container create request." ArgsEscaped=false AttachStderr=false AttachStdin=false AttachStdout=false ExposedPorts="map[]" Healthcheck="<nil>" Labels="map[author:spring-boot]" MacAddress= NetworkDisabled=false OnBuild="[]" OpenStdin=false StdinOnce=false StopSignal= StopTimeout="<nil>" Tty=false plugin=pipelines

time="2021-03-25T11:30:59Z" level=info msg="Container create request." AutoRemove=false BlkioDeviceReadBps="[]" BlkioDeviceReadIOps="[]" BlkioDeviceWriteBps="[]" BlkioDeviceWriteIOps="[]" BlkioWeight=0 BlkioWeightDevice="[]" CPUCount=0 CPUPercent=0 CPUPeriod=0 CPUQuota=0 CPURealtimePeriod=0 CPURealtimeRuntime=0 CPUShares=0 CapAdd="[]" CapDrop="[]" Capabilities="[]" Cgroup= CgroupParent= ConsoleSize="[0 0]" ContainerIDFile= CpusetCpus= CpusetMems= DNS="[]" DNSOptions="[]" DNSSearch="[]" DeviceCgroupRules="[]" Devices="[]" ExtraHosts="[]" …
Run Code Online (Sandbox Code Playgroud)

buildpack spring-boot spring-boot-maven-plugin bitbucket-pipelines paketo

7
推荐指数
0
解决办法
590
查看次数

纱线构建 - 错误命令失败,退出代码为 137 - Bitbucket 管道内存不足 - 使用最大内存 8192mb

我们的 React 应用程序配置为使用 CRA 脚本和 Bitbucket Pipelines 进行构建和部署。

我们的大多数构建都因运行而失败,yarn build并出现以下错误:

error Command failed with exit code 137.
Run Code Online (Sandbox Code Playgroud)

这是内存不足错误。

我们尝试将 GENERATE_SOURCEMAP=false 设置为部署环境变量,但这并没有解决问题https://create-react-app.dev/docs/advanced-configuration/

我们还尝试通过运行以下命令来设置步骤的最大可用内存:

node --max-old-space-size=8192 scripts/build.js

增加到最大内存并不能解决问题。

这阻碍了我们的发展,我们不知道如何解决这个问题。

我们可以转向新的 CI/CD 服务,但这比预期的工作量要多得多。

还有其他解决方案可以解决这个问题吗?

下面是bitbucket-pipelines.yml文件

error Command failed with exit code 137.
Run Code Online (Sandbox Code Playgroud)

node.js reactjs bitbucket-pipelines yarnpkg

7
推荐指数
1
解决办法
1万
查看次数