diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa0cf1bd0436538f6bdc0d4381765fa350c6c98f..bfbd8bb691a064fe45fda6f9534a3089b41edeb1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,6 @@ #### variables: - FAULT_SECTIONS: nshm-fault-sections - FAULT_SECTIONS_GIT: https://gitlab-ci-token:${CI_JOB_TOKEN}@code.usgs.gov/ghsc/nshmp/${FAULT_SECTIONS}.git JACOCO_HTML_DIR: ${REPORTS_DIR}/jacoco/test/html JUNIT_FILES: build/test-results/test/TEST-*.xml REPORTS_DIR: build/reports @@ -20,12 +18,14 @@ stages: #### # Git clone nshm-fault-sections #### -.fault-sections: +.ssh-key: before_script: - - cd .. - - rm -rf ${FAULT_SECTIONS} - - git clone ${FAULT_SECTIONS_GIT} - - cd ${CI_PROJECT_NAME} + - eval $(ssh-agent -s) + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "${SSH_PRIVATE_KEY}" >> ~/.ssh/id_rsa + - chmod 0600 ~/.ssh/id_rsa + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config #### # GitLab runner tags @@ -47,7 +47,7 @@ stages: #### Build Project: extends: - - .fault-sections + - .ssh-key - .gradle - .tags stage: test @@ -115,7 +115,7 @@ Spotbugs Test: #### Unit Tests: extends: - - .fault-sections + - .ssh-key - .gradle - .tags stage: test