我在将 docker 映像推送到我的私有 GCP 注册表时遇到问题。我从 Google Cloud Platform 创建了一个具有所有者角色的新服务帐户。然后,我创建了一个服务密钥,并将 json 文件的内容(从服务帐户下载)复制到 Gitlab CI/CD 变量的 $GCP_SERVICE_KEY 变量中。
这是我的.gitlab-ci.yaml文件:
image: python:3.6
stages:
- push
before_script:
- mkdir -p $HOME/.docker
- echo "$GCP_SERVICE_KEY" >> "$HOME/.docker/config.json"
dockerpush:
stage: push
image: docker:stable
services:
- docker:dind
script:
- docker build --build-arg MONGODB_URI=$MONGODB_URI -t my_image_name .
- docker login -u _json_key --password-stdin https://gcr.io < $HOME/.docker/config.json
- docker tag my_image_name eu.gcr.io/my_project_id/my_image_name
- docker push eu.gcr.io/my_project_id/my_image_name
Run Code Online (Sandbox Code Playgroud)
当我检查控制台日志时,我看到“登录成功”。但我无法推送到我的 GCP 注册表。我检查了项目 ID、用户的角色,一切似乎都正常。但为什么我仍然看到“未经授权”的错误?
$ docker login -u _json_key -p "$GCP_SERVICE_KEY" …Run Code Online (Sandbox Code Playgroud) continuous-integration push docker google-cloud-platform gitlab-ci
我对 CI 很陌生,正在尝试 Azure DevOps。
我想在 CI 管道中使用自动化测试工具,该工具使用 Bash 脚本和在 CI 管道内运行的 PowerShell 脚本来触发测试工具。
如何将 Bash 或 PowerShell 脚本添加到 Azure DevOps 中的管道中,以便脚本运行并触发测试工具?
我尝试连接到 bitbucket 管道中的数据库并使用文档中所述的服务定义,但出现以下错误:
+ mysql -h 127.0.0.1 -u root -ptest_user_password -e "SHOW DATABASES"
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")
Run Code Online (Sandbox Code Playgroud)
这是我的bitbucket-pipelines.yaml:
image: debian:stretch
pipelines:
pull-requests:
'*':
- step:
script:
- apt-get update && apt-get install -y mysql-client
- mysql -h 127.0.0.1 -u root -ptest_user_password -e "SHOW DATABASES"
definitions:
services:
mysql:
image: mysql:5.7
variables:
MYSQL_DATABASE: 'pipelines'
MYSQL_ROOT_PASSWORD: 'test_user_password'
Run Code Online (Sandbox Code Playgroud)
有什么想法我做错了吗?
我目前正在尝试通过 GitLab 为 Firebase 上托管的 React 应用程序设置 CI。我正在努力克服这一点。还有其他一些帖子建议使用 sudo 但控制台告诉我找不到该命令。
\n\n任何帮助将不胜感激。感谢您。
\n\n这是我当前的配置:
\n\ngitlab-ci.yml 配置文件
\n\nimage: node:10.15.3\r\n\r\ncache:\r\n paths:\r\n - node_modules/\r\n\r\nstages:\r\n - build\r\n - deploy\r\n \r\ndeploy_dev:\r\n stage: deploy\r\n script:\r\n - echo "Deploying to staging environment"\r\n - npm install -g firebase-tools\r\n - firebase deploy --token $FIREBASE_DEPLOY_KEY --project $CI_ENVIRONMENT_NAME\r\n environment:\r\n name: dev\r\n only:\r\n - masterRun Code Online (Sandbox Code Playgroud)\r\n包.json
\n\n{\r\n "name": "react-app",\r\n "version": "0.1.0",\r\n "private": true,\r\n "dependencies": {\r\n "bootstrap": "^4.4.1",\r\n "firebase": "^6.6.2",\r\n "firebase-functions": "^3.3.0",\r\n …Run Code Online (Sandbox Code Playgroud)continuous-integration continuous-deployment gitlab firebase reactjs
pipeline文档比较分散,如何使用circle ci语言中的概念有点难以理解?另外,管道和管道变量的意义是什么?
以下文档很有用,但还不足以让我弄清楚它们的实际工作原理:
[root@###~]# yum install jenkins 加载的插件:fastestmirror、product-id、search-disabled-repos、subscription-manager
该系统未向授权服务器注册。您可以使用订阅管理器进行注册。
从缓存的主机文件加载镜像速度
配置的存储库之一失败(Jenkins-stable),并且 yum 没有足够的缓存数据来继续。此时 yum 能做的唯一安全的事情就是失败。有几种方法可以“修复”这个问题:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过下一个命令在 Docker 容器中启动 Android 模拟器(又名 AVD)
docker run -it img_emulator:v1
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
emulator: CPU Acceleration: DISABLED
emulator: CPU Acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded
Run Code Online (Sandbox Code Playgroud)
事实上,我的笔记本电脑上有 Linux 18.04 虚拟化。我在 Bios 中启用了它并通过下一个命令检查它:
kvm-ok
Run Code Online (Sandbox Code Playgroud)
系统报告:
INFO: /dev/kvm exists
KVM acceleration can …Run Code Online (Sandbox Code Playgroud) 这是我的动作脚本:
name: Build
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: |
whoami
sudo mkdir /first_org
sudo chmod -R 777 /first_org
cd /first_org
git clone https://github.com/first_org/site
sudo rm -rf /first_org/site/.git
sudo mkdir /second_org
sudo chmod -R 777 /second_org
cd /second_org
git clone https://github.com/second_org/site
cp -a /first_org/site/. /second_org/site
cd /second_org/site
sudo apt-get update
sudo apt install nodejs
npm build
Run Code Online (Sandbox Code Playgroud)
这/first_org/site是一个公共回购,但这/second_org/site是一个私人回购。
我不使用action/checkout@v2,因为它不允许我们指定要克隆到的绝对路径。因此我不得不使用纯 shell 命令。
这个动作属于/second_org/site回购协议,因此基于文档,我可以用来 …
我正在尝试使用 Github Actions 自动发布包,dart pub publish但为此我需要登录。登录工作流程需要用户交互(通过 Google 登录),因此不能在 CI 上使用。
根据https://github.com/dart-lang/pub/issues/2227似乎没有一个简单的方法,但有人提到:
必须将路径设置为 run:
echo ${{secrets.PUB_CREDENTIALS}} > /opt/hostedtoolcache/flutter/1.9.1-hotfix.2-stable/x64/.pub-cache/credentials.json并不是很好维护。
这个的格式credentials.json已知吗?
编辑:在 Windows 上,the credentials.json文件并不C:\Users\<USER>\AppData\Roaming\Pub\Cache\credentials.json如博客文章中所示,它现在位于C:\Users\<USER>\AppData\Roaming\dart\pub-credentials.json。
有没有办法将 Github / Gitlab 页面与 monorepo 一起使用?我有 1 个 Gitlab 存储库,其中有 3 个项目:
我将使用付费的 Heroku dyno 来部署后端。我也可以使用(事实上,我正在使用)heroku 来部署两个前端项目的 dist 文件夹。但是因为我们模块化了很多应用程序,而且免费的 Heroku dynos 并不是特别快,所以我想知道 Github / Gitlab 页面是否更快。我使用过一次 Gitlab 页面,但用于 1 个使用 Gitlab CI 的项目。有谁知道是否可以执行每个分支一个页面之类的操作,或者我可以用来部署我的 2 个前端应用程序的操作?