gitlab CI / CD在构建之前失败

时间:2019-12-26 09:25:06

标签: java maven gitlab

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

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

这是我的gitlab-ci.yml

import * as RNIap from 'react-native-iap';

const itemSkus = Platform.select({
  ios: ['productid1', 'productid2'],
  android: ['productid1', 'productid2'],
});

...
componentDidMount() {
  RNIap.initConnection().then(conn => {
    // conn is true
    RNIap.getProducts(itemSkus)
      .then(res => {
        // res is []
      })
      .catch(err => {
        // no err
      });
  });
}
...

这是工作cmd

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

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

非常感谢您。

0 个答案:

没有答案