본문 바로가기

Develop/GitLab

Make runner jobs with another job You can make gitlab runner jobs with another job. That means we can define jobs like a function in programming. It's cool function, when we have very similar jobs repeatedly Here's some examples. When we have many servers to deploy, we wrote .gitlab-ci.yml file like this. deploy1: script: # send local files to remote server - rsync -artlp --ignore-existing --exclude-from='.rsyncignore' ./ "$USER.. 더보기
.gitlab-ci.yml image: jsrjsr0040/centos-apm-sshvariables: STAGING_SERVER: 123.123.123.123 DEPLOY_SERVER: 123.123.123.123 STAGING_TAGS: 'staging-' DEPLOY_TAGS: 'real-' GITID: 'gitid' GITPASS: 'gitpath' stages: - build - test - deploy before_script: - echo "Before Script" - mkdir -p ~/.ssh - chmod 700 ~/.ssh - eval $(ssh-agent -s) - echo "$SSH_KEY"| ssh-add - - ssh-keyscan -p 9022 $STAGING_SERVER > ~/.ssh/known_.. 더보기
GitLab Runner 처음 gitlab runner를 접하고 꽤나 혼동 스러웠음.runner는 기본적으로 서버상에서 구동되는 것이 아니라 사용자가 환경을 설정하는 식임.오픈소스 프로젝트의 특성상 개인들이 이런 것들을 해야한다는 점을 생각해보면 당연한 이치인데..전혀 생각조차 안해본 것처럼.. local docker에 간단하게 runner를 설정해 줄 수 있음.]$ docker run -it -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest이렇게 해주게되면 gitlab 에서 제공해주는 run.. 더보기