sudo yum install curl openssh-server openssh-clients postfix cronie sudo service postfix start sudo chkconfig postfix on
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce
sudo gitlab-ctl reconfigure
curl -sSL https://get.docker.com/ | sh
# Debian/Ubuntu curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash # RHEL/CentOS curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash
# Debian/Ubuntu sudo apt-get install gitlab-ci-multi-runner # RHEL/CentOS sudo yum install gitlab-ci-multi-runner
sudo gitlab-ci-multi-runner register Please enter the gitlab-ci coordinator URL (eg https://gitlab.com/ci ) http://domain.example.com/ci Please enter the gitlab-ci token for this runner bQ0nvkVJACDUrvQ9ttqx Please enter the gitlab-ci description for this runner my-runner INFO[0034] fcf5c619 Registering runner... succeeded Please enter the executor: shell, docker, docker-ssh, ssh? docker Please enter the Docker image (eg. ruby:2.1): centos:7 INFO[0037] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
sudo gitlab-ci-multi-runner start
registry_external_url 'https://domain.example.com' # Settings used by GitLab application gitlab_rails['registry_enabled'] = true gitlab_rails['registry_host'] = "domain.example.com" gitlab_rails['registry_port'] = "5000" gitlab_rails['registry_api_url'] = "http://localhost:5000" gitlab_rails['registry_key_path'] = "/var/opt/gitlab/gitlab-rails/certificate.key" gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry" # gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer" # Settings used by Registry application registry['enable'] = true registry['username'] = "registry" registry['group'] = "registry" # registry['uid'] = nil # registry['gid'] = nil registry['dir'] = "/var/opt/gitlab/registry" registry['log_directory'] = "/var/log/gitlab/registry" registry['log_level'] = "info" registry['rootcertbundle'] = "/var/opt/gitlab/registry/gitlab-registry.crt" registry['storage_delete_enabled'] = true
registry_nginx['ssl_certificate'] = "/path/to/certificate.pem" registry_nginx['ssl_certificate_key'] = "/path/to/certificate.key"
[Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network.target docker.socket Requires=docker.socket [Service] Type=notify ExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry domain.example.com MountFlags=slave LimitNOFILE=1048576 LimitNPROC=1048576 LimitCORE=infinity TimeoutStartSec=0 [Install] WantedBy=multi-user.target
systemctl daemon-reload
systemctl restart docker
docker login domain.example.com Username: root Password: Email: admin@example.com WARNING: login credentials saved in /root/.docker/config.json Login Succeeded
FROM centos:7 RUN yum -y update && yum -y install epel-release \ && yum -y install ansible python-pip RUN pip install ansible-lint # Default command CMD ["/bin/bash"]
docker build -t centos:7 .
docker tag centos:7 domain.example.com/<groupname>/<projectname> docker push domain.example.com/<groupname>/<projectname>
image: domain.example.com/root/my-repo stages: - test - deploy test_job: stage: test script: - ansible-lint playbook.yml - ansible-playbook --check playbook.yml tags: - ansible deploy_job: stage: deploy script: - ansible-playbook playbook.yml tags: - ansible
Source: https://habr.com/ru/post/306596/
All Articles