diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff2aa95..d00b577 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,6 @@ variables: REFERENCE_SOLUTION: $CI_PROJECT_NAMESPACE/solutions/solutions JPLAG_PATH: /app/jplag.jar CI_REPO_HOST: $CI_REGISTRY - SSH_PUBLIC_KEY: deploy_key.pub stages: - test @@ -15,6 +14,7 @@ stages: before_script: ## get ssh private key from secret variable + - echo "$SSH_PUBLIC_KEY" | tr -d '\r' > deploy_key.pub - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh @@ -79,7 +79,7 @@ create_projects: - abgabesystem script: - - abgabesystem projects -c $CI_PROJECT_NAMESPACE -d $SSH_PUBLIC_KEY + - abgabesystem projects -c $CI_PROJECT_NAMESPACE -d deploy_key.pub only: - master diff --git a/README.md b/README.md index 197a6b1..47e71e4 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ You can also [automate this](https://docs.gitlab.com/ce/ci/docker/using_docker_b Proceed by creating an API token that has access to the group of the course. Add this token as `PRIVATE_API_TOKEN` to the [secret variables](https://docs.gitlab.com/ce/ci/variables/) of the forked abgabesystem project. -Then generate an SSH deploy key and add the private part as `SSH_PRIVATE_KEY` to the secret variables. +Then generate an SSH deploy key and add the private part as `SSH_PRIVATE_KEY` and the public key as `SSH_PUBLIC_KEY` to the secret variables. The key will be used by the CI script to fetch from the student projects. Set up the the student projects using