我想使用Open JDK 8和9运行我的Circle CI 2.0构建。是否有可用的YAML示例说明如何使用多个JDK版本构建Java项目?
目前,我正在尝试java-8
向我的建筑添加新工作。但是我不想重复默认Java 9 build
作业的所有步骤。有干的方法吗?
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:9-jdk
working_directory: ~/repo
environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx1g
TERM: dumb
steps:
- checkout
# Run all tests
- run: gradle check
java-8:
- image: circleci/openjdk:8-jdk
Run Code Online (Sandbox Code Playgroud) 我正在使用 circleCI 来部署生产或暂存环境。我想对与每个环境对应的每个分支的上下文使用相同的作业,因为我不喜欢为每个环境编写相同的代码。
我想像下面这样写。
version: 2
jobs:
deploy:
docker:
- image: google/cloud-sdk
steps:
- checkout
- run: <deploying commands>
workflows:
version: 2
deploy:
jobs:
- deploy:
filters:
branches:
only:
- master
context: production
- deploy:
filters:
branches:
only:
- develop
context: staging
Run Code Online (Sandbox Code Playgroud) 试图在CircleCi上运行构建,但测试失败。同样的东西在我的本地设备上运行完美。我的.babelrc配置:
{
"presets": [
"es2015",
"react",
"stage-2"
],
"plugins": [
"transform-class-properties",
"react-hot-loader/babel",
["babel-plugin-transform-builtin-extend", {
"globals": ["Error", "Array"]
}],
["transform-runtime", {
"polyfill": false,
"regenerator": true
}]
]
}
Run Code Online (Sandbox Code Playgroud)
我从circleCI获取错误:
yarn test v0.27.5
$ jest
FAIL src/utils/service-helper.test.js
? Test suite failed to run
ReferenceError: [BABEL] /home/circleci/repo/src/utils/service-helper.test.js: Unknown option: /home/circleci/repo/node_modules/react/index.js.Children. Check out http://babeljs.io/docs/usage/options/ for more information about options.
A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:
Invalid:
`{ presets: [{option: value}] …
Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用 CircleCI 持续集成平台的项目。我使用Python作为主要语言,使用Miniconda作为平台。我想在 CircleCI 上使用 Miniconda 测试多个 Python 和 NumPy 版本。
我尝试使用不同的 Python 映像,但它仅使用 Python 3.7,因为我安装了最新的 Miniconda 版本。你能告诉我如何使用多个版本吗?
下边是config.yml
:
version: 2.0
workflows:
version: 2
test:
jobs:
- py3.6-np1.15
- py3.5-np1.15
- py3.6-np1.14
- py3.5-np1.14
- py3.7-np1.15
- py3.5-np1.16
- py3.6-np1.16
- py3.7-np1.16
jobs:
py3.6-np1.15: &test-template
docker:
- image: circleci/python:3.6.8
environment:
NUMPY_VERSION: 1.15.2
CYTHON_VERSION: 0.29.2
working_directory: ~/repo
steps:
- checkout
- run:
name: Install System Dependencies
command: sudo apt-get update && sudo apt-get install -y libmpich12 libmpich-dev build-essential
# …
Run Code Online (Sandbox Code Playgroud) Rails团队使用一种称为凭证的新概念,引入了一种新的方式来处理应用程序中的秘密(http://weblog.rubyonrails.org/2017/9/23/this-week-in-rails-new-credentials-configuration-错误修正和更多/)。
要加密和解密凭据文件,您需要该master.key
文件。我正在使用CircleCI运行我的测试套件,但是master.key
github存储库中不提供,因此CircleCI无法正确构建应用程序。
在CircleCI中处理这种情况的最佳方法是什么?
在我circle.yml
添加的env:
标题中添加了我的 mysql 环境变量设置,我在一些在线示例中看到了这一点,它运行良好并且我的构建通过。但我收到此警告:
这就是我的样子 circle.yml
docker:
- image: elasticsearch:1.3.9
- image: circleci/mysql:5.6
env:
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_HOST=127.0.0.1
- MYSQL_ROOT_HOST=%
- MYSQL_DATABASE=MyDB
environment:
SBT_VERSION: 1.1.0
SBT_OPTS: "-Xms512M -Xmx1536M -Xss1M"
.....
Run Code Online (Sandbox Code Playgroud)
以前有人有这个吗?
我是 Circleci 的新手,我试图限制我的构建仅在特定分支上工作,我尝试了下面的配置文件,但是当我包含过滤器部分时,我收到以下错误:
Your config file has errors and may not run correctly:
2 schema violations found
required key [jobs] not found
required key [version] not found
Run Code Online (Sandbox Code Playgroud)
带过滤器的配置:
version: 2
jobs:
provisioning_spark_installation_script:
working_directory: ~/build_data
docker:
- image: circleci/python:3.6.6-stretch
steps:
- setup_remote_docker:
docker_layer_caching: true
- checkout
- run: &install_awscli
name: Install AWS CLI
command: |
sudo pip3 install --upgrade awscli
- run: &login_to_ecr
name: Login to ECR
command: aws ecr get-login --region us-east-1 | sed 's/-e none//g' | bash
workflows:
version: …
Run Code Online (Sandbox Code Playgroud) 我在构建中遇到以下错误:
#!/bin/sh -eo pipefail
# Error calling workflow: 'build-deploy'
# Error calling job: 'build_test_es'
# Error calling command: 'aws-s3/sync'
# Unexpected argument(s): arguments
#
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false
Exited with code 1
Run Code Online (Sandbox Code Playgroud)
这就是我的 config.yml 文件的样子,我抑制了一些部分。
version: 2.1
orbs:
aws-s3: circleci/aws-s3@1.0.0
jobs:
build_test_es:
docker:
- image: circleci/node:10.15
steps:
- checkout
- setup_remote_docker
- run:
name: NPM install
command: |
cd …
Run Code Online (Sandbox Code Playgroud) 我不想将 docker 构建映像推送到 DockerHub。有没有什么办法可以直接将一个 docker 镜像从 CircleCI 部署到 AWS/vps/vultr 而不必推送到 DockerHub?
circleci-2.0 ×9
circleci ×5
amazon-s3 ×1
babel-jest ×1
babeljs ×1
docker ×1
mysql ×1
python ×1