gitlab | runner | ci/cd ansible | ci/cd www | ci/cd laravel | ci/cd react | sast
from your workstation
trigger a test-run
git clone PROJECT-URL cd PROJECT/ vi .gitlab-ci.yml
stages: - deploy deploy prod: stage: deploy script: - echo TEST OK - ansible --version - ansible-community --version only: #- master - main tags: - runner1
git add .gitlab-ci.yml git commit -m "test ci/cd" git push
when using private repository or self-hosted gitlab, we need a user to grab the code, but we don’t have a user for the runner, and we would like to avoid using adding runner’s pubkey to our very own profile. workaround is to grab and send a tarball, – all we need to check is basic stuff anyhow, no need to keep the repo in sync.
from workstation
scp repo-name-master.tar.gz gitlab-runner-server:~/dev/
from runner
cd ~/dev/ tar xzf repo-name-master.tar.gz cd repo-name-master/