开发者社区> 问答> 正文

gitlab CI / CD在构建之前失败

我是gitlab的新手,在尝试构建时遇到问题。

这是我到gitlab的网址:http:// localhost / root / mytest,我在Linux虚拟机中安装了gitlab。

这是我的gitlab-ci.yml

image: maven:3.3.9-jdk-8

variables:
    MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
    MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
    SERVER_PASSWORD: ""
stages:
    - build
    - test
    - deploy

cache:
  paths:
    - .m2/repository/
    - target/


build:
    stage: build
    tags: 
        - my_tags
    script:
        - "mvn -X clean"
        - "mvn -X install"
        - echo "Building"
        - mkdir build
    artifacts:
        paths:
            - ./target/*.war
    only:
        - master



deploy_staging:
    stage: deploy
    tags: 
        - my_tags
    script:
        - echo "Deploy to staging server"
        - "mvn -X install tomcat7:deploy"
    environment:
        name: staging
        url: http://localhost:88
    artifacts:
        paths:
            - target/*.war    
    only:
        - master

这是工作cmd

1 Running with gitlab-runner 12.6.0 (ac8e767a)

2   on runner i7kvHx2T

3 Using Docker executor with image maven:3.3.9-jdk-8 ... 00:08

4 Pulling docker image maven:3.3.9-jdk-8 ...

5 Using docker image sha256:9997d8483b2fc521a4159feab922546dda0c5c22b5084f86dfab48f123ae4364 
 formaven:3.3.9-jdk-8 ...

7 Running on runner-i7kvHx2T-project-2-concurrent-0 via localhost.localdomain...
00:02

9
Fetching changes with git depth set to 50...
00:02
10 Reinitialized existing Git repository in /builds/project-2/.git/
11 error: cannot run ssh: No such file or directory
12 fatal: unable to fork
15 ERROR: Job failed: exit code 1

我真的不明白为什么失败,为什么是/builds/project-2/.git/而不是/builds/root/mytest.git。

非常感谢你。

展开
收起
垚tutu 2019-12-26 21:17:03 2662 0
1 条回答
写回答
取消 提交回答
  • 精于基础,广于工具,熟于业务。

    找不打此文件,建议您根据官网介绍在调试一下自己的配置文件。

    2019-12-27 17:04:22
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
基于Jenkins的CI/CD探索之路 立即下载
Alibaba Cloud CodePipeline 基于Jenkins的CI / CD探索之路 立即下载
基于ACK One和ACR构建CI/CD流水线最佳实践 立即下载

相关实验场景

更多