标签: cicd

我可以只安排一项特定的 GitLab CI/CD 作业吗?

gitlab-ci.yaml目前,我在管道中配置了几个 CI/CD 作业。例如,我在一个分支中配置了构建和部署。其中一项工作是创建备份。

我只想每天晚上安排备份工作。但是,在 GitLab CI/CD 的计划部分中,我只能选择一个分支或一个标签。这将导致所有阶段/作业被触发,而我只想触发备份。

我已经看到了配置rulesexcepts仅在特定上下文中触发作业的选项。然而,这感觉有点像补丁解决方案。是否有另一种方法可以在 Gitlab CI/CD 调度程序中仅触发单个作业?

continuous-integration gitlab gitlab-ci cicd

9
推荐指数
1
解决办法
2568
查看次数

GitHub Actions 上传工件未从 npm run build 中找到提供的路径

我正在尝试使用 CICD 原则建立一个 React 网站。我可以在本地运行它,使用“npm run build”获取构建文件夹,并且当我手动将文件推送到 S3 时,网站运行良好。但是,当我尝试通过 github 操作运行构建和部署时,upload-artifacts 步骤会给出以下警告:“警告:在提供的路径中找不到文件:构建”。不会上传任何工件。” 显然,部署作业会失败,因为它找不到任何要下载的工件。究竟为什么会发生这种情况?自从在构建后运行 ls 将其列为当前工作目录中的文件夹之一以来,肯定会创建构建文件夹。

name: frontend_actions
on:
  workflow_dispatch:
  push:
    paths:
      - 'frontend/'
      - '.github/workflows/frontend_actions.yml'
    branches:
      - master
defaults:
  run:
    working-directory: frontend
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2
    - name: npm install
      run: npm install
    - name: npm build
      run: npm run build
      env:
        CI: false
    - name: Upload Artifact
      uses: actions/upload-artifact@master
      with:
        name: build
        path: build
  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: …
Run Code Online (Sandbox Code Playgroud)

npm github-actions cicd

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

构建在本地工作但在 Codemagic 上失败 | 任务“:app:stripDebugDebugSymbols”执行失败

我正在尝试实现一个持续部署系统来构建我的应用程序并使用 codemagic 部署到 Google Play。在本地进行构建工作正常,但在 Codemagic 上远程构建失败。

错误总结:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> 1 exception was raised by workers:
  org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/usr/local/share/android-sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip''
Run Code Online (Sandbox Code Playgroud)

完整日志:

== Building for Android ==

> flutter build appbundle --debug
Running "flutter pub get" in My_Project...                     1,655ms

 Building with sound null safety 

Running Gradle task 'bundleDebug'...                            
[flutter_background_geolocation] Purging debug resources in release build
Note: Some input files use or override a …
Run Code Online (Sandbox Code Playgroud)

continuous-deployment flutter codemagic cicd

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

如何将工件从子作业返回到父管道?

使用触发器动态选择测试作业

prepare_test:
  image: $CI_REGISTRY/platform/docker-images/vault:1.8
  variables:
    CONTEXT_TEST: |
      include:
      # PRODUCT
        - project: 'gitlabci/integration-test'
          ref: dev_v2
          file: 
            - 'spark/.base_integration_test.yml'
            - 'spark/.base_integration_test_with_kafka.yml'   
      integration_test:
        variables:
          COVERAGE_SOURCE: "./src"  
    INTEGRATION_TEST: |
      $CONTEXT_TEST
        extends: .base_integration_test
    INTEGRATION_TEST_WITH_KAFKA: |
      $CONTEXT_TEST 
        extends: .base_integration_test_with_kafka  
  stage: prepare_test
  script:
    - export CICD_KAFKA_HOST=$(cat test/fixtures.py | grep KAFKA_HOST)
    - >
      if [ "$CICD_KAFKA_HOST" != "" ]; then
        export CICD_KAFKA_HOST="true"
        echo "$INTEGRATION_TEST_WITH_KAFKA" >> test.yml
      else
        export CICD_KAFKA_HOST="false"
        echo "$INTEGRATION_TEST" >> test.yml
      fi
    - env | sort -f
  artifacts:
    paths:
      - test.yml
    expire_in: 6000 seconds


# …
Run Code Online (Sandbox Code Playgroud)

continuous-deployment continuous-delivery gitlab-ci cicd

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

如何在 GitHub Actions 上安装 docker

在 GitHub Actions 上安装 Docker 的官方/推荐方式是什么?

特别是,我需要在 GitHub Actions 上运行自定义脚本,除其他任务外,该脚本还调用docker builddocker push.

我不想要构建/推送的预制操作,我想要访问该docker命令。

我应该怎么办?

我能找到的唯一官方操作使用 Docker Buildx 而不是普通的 docker:https://github.com/marketplace/actions/build-and-push-docker-images

除此之外,我可以找到此操作(https://github.com/marketplace/actions/setup-docker),但我不知道我是否可以信任该来源,因为它不是官方的。

有什么建议吗?如何docker在 GitHub Actions 上安装该命令?

docker github-actions cicd

8
推荐指数
0
解决办法
8118
查看次数

GitFlow:如何维护以前的版本?

我目前正在为我的团队制定工作流程。我们收到的建议是使用 GitFlow 方案。该方案可以放在图表上如下:

吉特流

但是,我有一个关于如何管理特定案例的问题。由于我们的活动,我们必须维护客户可能仍在使用的以前版本,并且由于各种原因不想更新。

在 GitFlow 方案中,主干应该是发布发生的地方。主干中的提交是可能可交付的产品,并且应该收到版本标签。

那么...我怎样才能回到过去,为旧版本生成修复程序并将其合并回主干以生成该版本?

已发布分支上的 GitFlow 修补程序

另一个问题是我是否不想将该修复程序带回后备箱?

在我看来,这种工作流程更适合不断向客户推送新版本的软件,例如移动应用程序,但不适用于工业产品,即使它们是从 CI 构建的。但也许我在这里遗漏了一些东西,因此我的问题

git continuous-integration git-flow cicd

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

如何在github操作中从自托管运行器访问环境变量

我正在将 EC2 作为自托管运行器运行。我已将 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 导出到 EC2,我可以看到它们是用printenv命令设置的。

这样做的原因是我不想将 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 保存在 github 秘密中。

有什么方法可以在我的 github 操作工作流程中访问和使用环境变量(AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY)?

continuous-integration amazon-ec2 devops github-actions cicd

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

在 GitHub Actions 中获取“参数列表太长”

我正在遵循 HashiCorp 的学习指南,了解如何设置 GitHub Actions 和 terraform。除了使用 Terraform 计划更新 PR 的步骤之外,一切都运行良好。

\n

我遇到以下错误:

\n
\nAn error occurred trying to start process \'/home/runner/runners/2.287.1/externals/node12/bin/node\' with working directory \'/home/runner/work/ccoe-aws-ou-scp-manage/ccoe-aws-ou-scp-manage\'. Argument list too long\n\n
Run Code Online (Sandbox Code Playgroud)\n

我正在使用的代码是:

\n
    - uses: actions/github-script@0.9.0\n      if: github.event_name == \'pull_request\'\n      env:\n        PLAN: "terraform\\n${{ steps.plan.outputs.stdout }}"\n      with:\n        github-token: ${{ secrets.GITHUB_TOKEN }}\n        script: |\n          const output = `#### Terraform Format and Style \\`${{ steps.fmt.outcome }}\\`\n          #### Terraform Initialization \xe2\x9a\x99\xef\xb8\x8f\\`${{ steps.init.outcome }}\\`\n          #### Terraform Plan \\`${{ steps.plan.outcome }}\\`\n          <details><summary>Show Plan</summary>\n          \\`\\`\\`${process.env.PLAN}\\`\\`\\`\n          </details>\n          *Pusher: …
Run Code Online (Sandbox Code Playgroud)

github terraform github-actions cicd

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

buildspec、appspec 和滚动我自己的 AMI 之间有什么区别?

除了结构之外,我对buildspec.yml和文件之间的区别感到相当困惑。appspec.yml我的构建规范中的阶段命令似乎对部署环境没有太大影响,并且在运行过程(例如安装)时使用哪个 appspec 挂钩之间也存在类似的模糊性。只要该过程发生在需要它的阶段之前,我就看不到阶段之间的差异。(我已阅读规范参考文档;他们大多确认这些阶段的标题是出于其目的,但并不是真正的目的。)

举个例子,为什么每次我必须进行部署时,我不直接使用 Packer 烘焙自己的 AMI,然后启动一个新主机并附加 AMI?

packer aws-code-deploy aws-codepipeline aws-codestar cicd

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

当我尝试重用 PNPM 存储时,我在 GitLab CI 上的 Docker 构建中收到“不允许跨设备链接”

我正在尝试将 pnpm 存储与 docker buildkit 内联缓存重用。当我进行本地构建时它工作正常,但在 gitlab ci 上它会抛出cross-device link not permitted错误。

\n

错误

\n
...\n#12 2.257 \xe2\x80\x89WARN\xe2\x80\x89 EXDEV: cross-device link not permitted, link \'/root/.local/share/pnpm/store/v3/files/68/31d9850g49ag49cc526af456f4a19a0f76eb85a79b6b311f09df7dd62a2a4d0f5c83de4eb5c6648f8bff155c82edce40a4e6c61cvb71127e1cb93c3cb8ab0f\' -> \'/usr/app/node_modules/.pnpm/on-exit-leak-free@0.2.0/node_modules/_tmp_1_58b64396e8cfdcdv7a5b403e046a9203/LICENSE\'\n#12 2.257 Falling back to copying packages from store\n#12 2.316 \xe2\x80\x89WARN\xe2\x80\x89 EXDEV: cross-device link not permitted, link \'/root/.local/share/pnpm/store/v3/files/6b/416bd4d9c57a078ff0a54c56f32039bb01aa5b3a3f07bev60d8ecc6eaa830db5ac4192943d693baaa1fc09b7891306db00055f3805ee6cc02ff353d8477f5c\' -> \'/usr/app/node_modules/.pnpm/pino-abstract-transport@0.5.0/node_modules/_tmp_1_ae5f485297e737f5f3943671v7fd357d/.github/dependabot.yml\'\n#12 2.316 Falling back to copying packages from store\n#12 2.741 \xe2\x80\x89WARN\xe2\x80\x89 EXDEV: cross-device link not permitted, link \'/root/.local/share/pnpm/store/v3/files/ba/80df1a5d3176e962200ca4d1304c02617df7ba747736cada94d29e94883f71f4b3231ee0a02c33886ba454215f65ff4320e0cc49f22fb431383f88c483cb9e\' -> \'/usr/app/node_modules/.pnpm/stack-chain@1.3.7/node_modules/_tmp_1_c0e9a25e81dg99592va167a1v86c382s/package.json\'\n#12 2.741 Falling back to copying packages from store\n#12 3.174 Progress: resolved 624, reused …
Run Code Online (Sandbox Code Playgroud)

node.js gitlab docker pnpm cicd

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