[submodule "backtest_task"]
path = project_name
url = git@ip_or_host:group_name/project_name.git
add ssh private key for accessing submodules repo in your gitlab-runner machine
mkdir -p ~/.ssh
cd ~/.ssh
echo "${SSH_PRIVATE_KEY}" > id_rsa
chmod 600 id_rsa
ssh-keyscan -t rsa ip_or_host -p port >> known_hosts
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_UPDATE_FLAGS: --jobs 4
script:
- mkdir build
- cd build
- cmake ..
- make
unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
script:
- echo "Code coverage is 90%"
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
environment: production
script:
- cp build/backtest_factor /root/data