小编Nao*_*dgi的帖子

JavaScript - 根据依赖关系树排序

我必须展示一组相互依赖的图像.例如

 Image A depends on no one
 Image B depends on A
 Image C depends on A and B
 Image D depends on F
 Image E depends on D and C
 Image F depends on no one
Run Code Online (Sandbox Code Playgroud)


我有一个像这样的javascript对象:

const imageDependencies = {
    A: [],
    B: ['A'],
    C: ['A', 'B'],
    D: [F],
    E: ['D', 'C'],
    F: []
}
Run Code Online (Sandbox Code Playgroud)


我需要通过依赖项来获取所有图像名称.此示例的结果可能是以下任何一个:

//   so first yo get the value of A. Once you have it you can get the value of B. Once you …
Run Code Online (Sandbox Code Playgroud)

javascript arrays sorting topological-sort typescript

7
推荐指数
3
解决办法
338
查看次数

如何降级 gitlab-runner 或使用特定版本运行?

将 gitlab-runner 升级到版本 11.11.0 后,我无法运行本地作业,例如gitlab-runner exec docker job_setup. 总是,我收到一个错误:

$ gitlab-runner exec docker job_setup

Runtime platform                                    arch=amd64 os=darwin pid=1688 revision=6c154264 version=11.11.0
Running with gitlab-runner 11.11.0 (6c154264)
Using Docker executor with image ubuntu:16.04 ...
Pulling docker image ubuntu:16.04 ...
Using docker image sha256:2a697363a8709093834e852b26bedb1d85b316c613120720fea9524f0e98e4a2 for ubuntu:16.04 ...
Running on runner--project-0-concurrent-0 via HappyMeal2.local...
DEPRECATION: this GitLab server doesn't support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab
Cloning repository...
fatal: repository '/Users/rui/(...)/helm-deploy-service-example' does not exist
ERROR: Job …
Run Code Online (Sandbox Code Playgroud)

homebrew gitlab-ci-runner

6
推荐指数
1
解决办法
1977
查看次数

GitlabCI 使用通配符在特定分支上运行管道

我想在每次当前里程碑分支发生变化时触发一个管道,它可以与硬编码的 milistone 编号一起正常工作,问题是我们每两周增加一次里程碑编号,并且 gitlab runner 不会解析.gitlab-ci.yml通配符,因此类似的事情不起作用

job:
  only:
    - milestone-*
Run Code Online (Sandbox Code Playgroud)

我还按照 Makoto Emura 在评论中的建议尝试了正则表达式

java:
  only:
    - /^mileston-.*$/
Run Code Online (Sandbox Code Playgroud)

现在我以这种方式使用它并.gitlab-ci.yml在创建新的里程碑后 更新我的

job:
  only:
    - milestone-10
Run Code Online (Sandbox Code Playgroud)

我尝试寻找目标分支的环境变量但没有找到任何

有谁知道解决方案吗?

yaml pipeline gitlab gitlab-ci gitlab-ci-runner

5
推荐指数
1
解决办法
5973
查看次数

如何仅在GitlabCi Runner中的HEAD commit上运行管道?

我们的存储库中有一个CI管道,托管在gitlab中

我们在本地机器上设置gitlab-runner

管道运行4个步骤

  • 建立

  • 单元测试

  • 整合测试
  • 质量测试

所有这些流水线需要将近20分钟

并在每次推送到分支时触发管道

有没有一种配置gitlab-runner的方法,如果当前运行的运行器所在的分支的HEAD发生变化,管道将自动取消运行?因为最新版本很重要

例如,在此运行中,不需要较低的运行

在此处输入图片说明

gitlab-ci.yml

stages:
  - build
  - unit_tests
  - unit_and_integration_tests
  - quality_tests

build:
  stage: build
  before_script:
    - cd projects/ideology-synapse
  script:
    - mvn compile


unit_and_integration_tests:
  variables:
    GIT_STRATEGY: clone
  stage: unit_and_integration_tests
  only:
    - /^milestone-.*$/
  script:
    - export RUN_ENVIORMENT=GITLAB_CI
    - export MAVEN_OPTS="-Xmx32g"
    - mvn test
    - "cat */target/site/jacoco/index.html"
  cache: {}
  artifacts:
    reports:
      junit:
        - "*/*/*/target/surefire-reports/TEST-*.xml"


unit_tests:
  variables:
    GIT_STRATEGY: clone

  stage: unit_tests
  except:
    - /^milestone-.*$/
  script:
    - export MAVEN_OPTS="-Xmx32g"
    - mvn test
    - "cat …
Run Code Online (Sandbox Code Playgroud)

continuous-integration continuous-deployment gitlab gitlab-ci gitlab-ci-runner

5
推荐指数
1
解决办法
247
查看次数

Kotlin在最后一个空间中分裂了弦乐

我有一个字符串,我想拆分它,并删除最后一部分.

例如,类似于此输入的内容:

var example = "Long string to split in the last space"
Run Code Online (Sandbox Code Playgroud)

我想达到这个结果

var result = "Long string to split in the last"
Run Code Online (Sandbox Code Playgroud)

kotlin

2
推荐指数
1
解决办法
92
查看次数