除了结构之外,我对buildspec.yml
和文件之间的区别感到相当困惑。appspec.yml
我的构建规范中的阶段命令似乎对部署环境没有太大影响,并且在运行过程(例如安装)时使用哪个 appspec 挂钩之间也存在类似的模糊性。只要该过程发生在需要它的阶段之前,我就看不到阶段之间的差异。(我已阅读规范参考文档;他们大多确认这些阶段的标题是出于其目的,但并不是真正的目的。)
举个例子,为什么每次我必须进行部署时,我不直接使用 Packer 烘焙自己的 AMI,然后启动一个新主机并附加 AMI?
Android、Azure Devops 在运行管道时出现错误##[错误]错误:进程“/Users/runner/work/1/s/gradlew”失败,退出代码为 1
在语言环境系统中,生成了所有工作 apk,但在 azure devops 上运行管道时,它显示错误
FAILURE: Build failed with an exception.
* Where: Build file '/Users/runner/work/1/s/app/build.gradle' line: 2
* What went wrong: An exception occurred applying plugin request [id:
'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
Run Code Online (Sandbox Code Playgroud)
我已经在使用 Java 11
我搜索了相同的内容但没有得到任何解决方案。
我在 gitlab 中有现有的项目仓库。由于 gitlab 在服务器中运行,因此我们在某个目录中有 lfs 对象。我的疑问是 AWS Codecommit 没有单独的服务器来将任何 lfs 配置存储为 gitlab 或 bitbucket。我必须在 AWS CodeCommit 中配置 lfs 目录。我的问题是“AWS CodeCommit 支持 Git LFS 吗?”。如果是,有人可以解释如何使用 Git LFS 配置 AWS CodeCommit 吗?
尝试将 gitlab 中的项目转换为 docker 镜像。gitlab 是自托管的。这是我得到的错误:
Running with gitlab-runner 13.12.0 (7a6612da)
on test -KnwQXuT
Preparing the "docker" executor
ERROR: Failed to remove network for build
ERROR: Preparation failed: Got permission denied while trying to connect to the Docker daemon
socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/info: dial
unix /var/run/docker.sock: connect: permission denied (docker.go:858:0s)
Run Code Online (Sandbox Code Playgroud)
我添加了一个跑步者,注册了它,使用 docker 模板创建了一个 gitlab-ci.yml ,我没有修改它。作为解决方案,我chmod 666 /var/run/docker.sock
在添加跑步者之前和之后尝试过,但它不起作用。我还在运行和注册 docker runner 之前添加了 sudo 但仍然没有成功。我找到了另一个选项将我的 docker 用户添加到 docker 组,但我的所有用户都在 docker 组中。docker runner 作为 docker 镜像运行。我不知道该怎么办...请帮忙。我尝试了大约 10 天,但没有成功...提前致谢
我想在 Github Actions 中运行数据库迁移。数据库位于堡垒后面。
我的解决方案是通过堡垒将 Postgres 端口 5432 转发到数据库主机。
我尝试了下面的脚本,但似乎不起作用。
mkdir ~/.ssh
ssh-keyscan -H <bastion_ip> >> ~/.ssh/known_hosts
echo "${{secrets.BASTION_SSH_KEY}}" >> key
chmod 600 ./key
ssh -T -i ./key -L 5432:<db_host_url>:5432 user@<bastion_ip> &
make migrate
rm ./key
Run Code Online (Sandbox Code Playgroud)
make migrate
针对 运行迁移localhost:5432
。
当我运行管道时出现以下错误
Error: AssertionError [ERR_ASSERTION]: ifError got unwanted exception: connect ECONNREFUSED 127.0.0.1:5432
Run Code Online (Sandbox Code Playgroud)
无论如何要修复它吗?我对其他方式持开放态度。
我正在开始使用 CI/CD 和 Docker,我想在工作流程文件中将连接字符串传递给 docker。
deploy:
runs-on: ubuntu-latest
needs: publish
steps:
- name: deploy to server
uses: appleboy/ssh-action@master
env:
CONN_STRING: ${{ secrets.CONN_STRING }}
with:
host: ${{ secrets.SECRET_IP }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
port: 22
script: docker stop *** && docker rm **** && docker pull **** && docker run --env CONN_STRING=$CONN_STRING -d --name ******
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,我创建了一个名为“CONN_STRING”的环境,它从我的 github 秘密中获取连接字符串。之后我想通过“CONN_STRING=$CONN_STRING”将其传递到dockerscript中。然而,自从我添加了这个之后,我的泊坞窗一直崩溃。有人知道我做错了什么吗?**** 只是我的项目的名称,我想保密。
我在保存工件时遇到问题。该项目分为3个模块,其中一个被保存,另外两个不被保存。
克隆项目: 克隆到 '/home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis/../project-root 克隆到 '/home/gitlab-runner/builds/Gso-uWvA/0 /www/project-infoserwis/../project-core
artifacts:
paths:
- /home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis
- /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root
expire_in: 10 min
Run Code Online (Sandbox Code Playgroud)
日志管道:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=24943
revision=54944146 version=13.10.0
/home/gitlab-runner/builds/Gso-uWvA/0/www/project-infoserwis: found 2240
matching files and directories
WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root: not
supported: outside build directory
WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root/pom.xml:
not supported: outside build directory
WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root/src: not
supported: outside build directory
WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-root/src/main:
not supported: outside build directory
WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-
root/src/main/resources: not supported: outside build directory
WARNING: /home/gitlab-runner/builds/Gso-uWvA/0/www/project-
root/src/main/resources/application.properties: not supported: outside build
directory
Run Code Online (Sandbox Code Playgroud)
哪里有问题?
我正在尝试使用 Trivy 进行 docker 扫描并将其集成到 GitLab 中,管道已通过。\n但是作业失败了,不确定作业失败的原因。\ndocker 映像有效。\n启用共享运行程序后更新了新错误
\ngitlab.yml
\nTrivy_container_scanning:\n stage: test\n image: docker:stable-git\n variables:\n # Override the GIT_STRATEGY variable in your `.gitlab-ci.yml` file and set it to `fetch` if you want to provide a `clair-whitelist.yml`\n # file. See https://docs.gitlab.com/ee/user/application_security/container_scanning/index.html#overriding-the-container-scanning-template\n # for details\n GIT_STRATEGY: none\n IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"\n allow_failure: true\n before_script:\n - export TRIVY_VERSION=${TRIVY_VERSION:-v0.20.0}\n - apk add --no-cache curl docker-cli\n - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY\n - curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin ${TRIVY_VERSION}\n …
Run Code Online (Sandbox Code Playgroud) 一切都很顺利,今天早上之前,我对 CICD 和类似的事情完全陌生,所以我写这篇文章是为了将我的应用程序部署到 Heroku
`'API deploy':
stage: deploy back
image: ruby:latest
script:
- apt-get update -qy
- apt-get install -y ruby-dev
- gem install dpl
- cd back
- dpl --provider=heroku --app=$HEROKU_BACK --api-key=$HEROKU_API_KEY --skip_cleanup
only:
refs:
- main
changes:
- back/**/*
- .gitlab-ci.yml`
Run Code Online (Sandbox Code Playgroud)
我收到这个:
An attempt to run a request with a Faraday::Connection without adapter has been made. (RuntimeError)
Please set Faraday.default_adapter or provide one when initializing the connection.
Run Code Online (Sandbox Code Playgroud)
我真的不知道该怎么做,正如我昨天所说的,一切都很好。
更新:这似乎是由于当前更新 Faraday-2.0.0
我在尝试使用 gitlab ci/cd 部署脚本时遇到这个问题:
Initialized empty Git repository in C:/builds/Tri.BuiV/test-gitlab-cicd/.git/
fatal: detected dubious ownership in repository at 'C:/builds/Tri.BuiV/test-gitlab-cicd'
'C:/builds/Tri.BuiV/test-gitlab-cicd' is owned by:
'S-1-5-83-1-1989435290-1148643240-1709935003-3943614564'
but the current user is:
'S-1-5-93-2-1'
To add an exception for this directory, call:
git config --global --add safe.directory C:/builds/Tri.BuiV/test-gitlab-cicd
Run Code Online (Sandbox Code Playgroud)
我试过:
git config --global --add safe.directory C:/builds/Tri.BuiV/test-gitlab-cicd
Run Code Online (Sandbox Code Playgroud)
但是同样的错误,为什么呢?
我试过:
git config --global --add safe.directory C:/builds/Tri.BuiV/test-gitlab-cicd
Run Code Online (Sandbox Code Playgroud)
但遇到同样的问题。