我想在YAML中合并数组,并通过ruby加载它们 -
some_stuff: &some_stuff
- a
- b
- c
combined_stuff:
<<: *some_stuff
- d
- e
- f
Run Code Online (Sandbox Code Playgroud)
我想将组合数组作为 [a,b,c,d,e,f]
我收到错误:在解析块映射时没有找到预期的键
如何在YAML中合并数组?
我有一个关于 Gitlab CI 的非常不寻常的用例,但我找不到满足我需求的解决方案。
我有一个 Gitlab 存储库,它使用其他存储库共享的子模块。我想实现一个运行器来为这个应用程序构建一个 Docker 容器镜像。为此,我按如下方式配置了我的 ci(使用 docker-in-docker 方法):
image: docker:stable
variables:
# When using dind service we need to instruct docker, to talk with the
# daemon started inside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using Kubernetes executor, the variable should …Run Code Online (Sandbox Code Playgroud)