Commit e810f8c8 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Merge branch 'tests' into 'documentation'

Tests

See merge request !3
parents a00fc500 ccd0f640
Pipeline #19611 failed with stage
in 11 seconds
......@@ -13,7 +13,7 @@ input_data_folder="/tmp/hasa"
if [ $(sudo docker images | grep ${runner_iname} | wc -l) == 0 ]
then
# build docker image
sudo docker build -f ${context_dir}/${dockerfile} -m 20G -t ${runner_tag} ${context_dir}
sudo docker build --network=host -f ${context_dir}/${dockerfile} -m 20G -t ${runner_tag} ${context_dir}
else
echo "It already exists a Docker image with the name ${runner_tag}!!!"
fi
#!/usr/bin/env bash
context_dir="./context"
dockerfile="hasa.docker"
runner_version="latest"
runner_tag="hasa_ci:$runner_version"
gitlab_runner="hasa_gitlab_CI_runner"
echo "#### Build runner docker image"
docker rmi ${runner_tag}
docker build --network=host -f ${context_dir}/${dockerfile} -m 20G -t ${runner_tag} ${context_dir}
echo "#### Create gitlab-runner (daemon) container"
docker stop ${gitlab_runner}
docker rm ${gitlab_runner}
docker run -d --name ${gitlab_runner} --network host --restart always -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest
echo "#### Register container at gitlab"
read -p "Please enter gitlab token: " token
echo ""
read -p "Please enter gitlab runner name: " runner_name
echo "${runner_tag}"
docker exec -it ${gitlab_runner} /bin/bash -c "export RUNNER_EXECUTOR=docker && gitlab-ci-multi-runner register -n \
--url 'https://git.gfz-potsdam.de' \
--registration-token '${token}' \
--run-untagged=true \
--docker-network-mode='host' \
--locked=true \
--tag-list hasa \
--docker-pull-policy='never' \
--description '${runner_name}' \
--docker-image '${runner_tag}' "
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment