{"id":20140660,"url":"https://github.com/goffinet/gitlab-ci","last_synced_at":"2026-03-19T14:05:07.775Z","repository":{"id":48019379,"uuid":"180234287","full_name":"goffinet/gitlab-ci","owner":"goffinet","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-03T05:25:30.000Z","size":30907,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T23:28:34.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goffinet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-08T21:16:47.000Z","updated_at":"2021-01-06T21:06:57.000Z","dependencies_parsed_at":"2023-01-23T04:16:22.977Z","dependency_job_id":null,"html_url":"https://github.com/goffinet/gitlab-ci","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/goffinet/gitlab-ci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goffinet%2Fgitlab-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goffinet%2Fgitlab-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goffinet%2Fgitlab-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goffinet%2Fgitlab-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goffinet","download_url":"https://codeload.github.com/goffinet/gitlab-ci/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goffinet%2Fgitlab-ci/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30098090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T22:49:54.894Z","status":"ssl_error","status_checked_at":"2026-03-04T22:49:48.883Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T21:53:03.362Z","updated_at":"2026-03-04T23:02:01.723Z","avatar_url":"https://github.com/goffinet.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intégration continue avec GitLab CI\n\nAuteur : {{ book.author }}\n\nDate de fabrication : {{ gitbook.time }}, v1.0\n\n\u003c!--\nTéléchargements des supports\n\n* [PDF](https://gitlab-ci.goffinet.org/pdf.html)\n* [MOBI](https://gitlab-ci.goffinet.org/mobi.html)\n* [EPUB](https://gitlab-ci.goffinet.org/epub.html)\n\n![Page de garde](cover_small.jpg)\n--\u003e\n\n## Téléchargements des supports\n\n* [PDF](https://gitlab-ci.goffinet.org/gitlab-ci.goffinet.org.pdf)\n* [MOBI](https://gitlab-ci.goffinet.org/gitlab-ci.goffinet.org.mobi)\n* [EPUB](https://gitlab-ci.goffinet.org/gitlab-ci.goffinet.org.epub)\n* [PPT](https://gitlab-ci.goffinet.org/gitlab-ci.goffinet.org-ppt.pdf)\n\n![Page de garde](cover_small.jpg)\n\n\u003c!-- toc --\u003e\n\n## 1. Introduction à GitLab\n\n### 1.1. Projet Gitlab\n\n[GitLab](https://gitlab.com/) est un outil de gestion du cycle de vie DevOps basé Web qui intègre un gestionnaire de référentiel Git avec des fonctionnalités wiki, de suivi des problèmes et de pipeline CI/CD. Il est développé sous licence open-source par GitLab Inc.\n\n![Logo Gitlab](/images/gitlab-logo-gray-rgb.png)\n\nLe logiciel se décline en quatre produits :\n\n* GitLab CE (Community Edition) - auto-hébergé et gratuit, support communautaire.\n* GitLab EE (Enterprise Edition) - auto-hébergé et payant, fonctionnalités supplémentaires.\n* GitLab.com - SaaS, gratuit ou avec abonnement.\n* GitLab.io - Instance privée gérée par GitLab Inc.\n\nLes outils comparables sont par exemple [GitHub](https://github.com/) ou [Bitbucket](https://bitbucket.org/).\n\n### 1.2. Introduction à DevOps avec GitLab CI\n\nLa documentation de GitLab CI sur trouve à l'adresse [https://docs.gitlab.com/ee/ci/README.html](https://docs.gitlab.com/ee/ci/README.html).\n\n![Stages of the DevOps lifecycle](/images/devops-lifecycle.png)\n\nUn cycle de vie DevOps se compose de différentes étapes en boucle : \"Plan\", \"Create\", \"Verify\", \"Package\", \"Release\", \"Monitor\". De manière transversale \"Manage\" et \"Secure\" s'intéressent à toutes les étapes du cycle.\n\n![Stages of the DevOps lifecycle](/images/devops-stages.png)\n\n| DevOps Stage | Description |\n| --- | --- |\n| [Manage](https://docs.gitlab.com/ee/README.html#manage) | Statistiques et fonctions d'analyse. |\n| [Plan](https://docs.gitlab.com/ee/README.html#plan) | Planification et gestion de projet. |\n| [Create](https://docs.gitlab.com/ee/README.html#create) | Fonctions SCM (Source Code Management) |\n| [Verify](https://docs.gitlab.com/ee/README.html#verify) | Tests, qualité du code et fonctions d'intégration continue. |\n| [Package](https://docs.gitlab.com/ee/README.html#package) | Registre des conteneurs Docker. |\n| [Release](https://docs.gitlab.com/ee/README.html#release) | Release et de livraison de l'application. |\n| [Configure](https://docs.gitlab.com/ee/README.html#configure) | Outils de configuration d'applications et d'infrastructures. |\n| [Monitor](https://docs.gitlab.com/ee/README.html#monitor) | Fonctions de surveillance et de métrique des applications. |\n| [Secure](https://docs.gitlab.com/ee/README.html#secure) | Fonctionnalités de sécurité. |\n\n### 1.3. Points forts de Gitlab\n\nSes points forts sont les suivants, de manière non exhaustive :\n\n- Modèle commercial Open Source\n- Fonctionnalités et intégrations avancées\n- Documentation ouverte\n- Installation et maintenance aisées\n- Modèle de déploiement très diversifié, évolutif\n- Ergonomie pour un usage quotidien\n- Permet de migrer ses référentiels Git à partir de nombreux concurrents\n- Permet d'être très satisfait sans budget\n- Bien d'autres sans doute\n\n### 1.4. Points faibles de Gitlab\n\nSon point faible est d'être moins populaire que GitHub.\n\n### 1.5. Mises en guarde sur l'usage de Gitlab\n\nSi l'on désire en faire un usage plutôt public ou dans le nuage ([gitlab.com](https://gitlab.com)), Gitlab offre déjà gratuitement des fonctionnalités très avancées.\n\nDans tous les cas, si les utilisateurs consomment un certain seuil de ressources, il est normal d'en payer le prix, le vrai prix, souvent moins jamais plus.\n\nDans cette perspective une solution auto-hébergée demandera un minimum de ressources [**recommandées** selon Gitlab](https://github.com/jimmidyson/gitlab-ce/blob/master/doc/install/requirements.md) :\n\n- CPU : 4\n- RAM : 4 GB\n- du stockage en conséquence\n\n\u003eIl est fortement déconseillé de faire fonctionner les Gitlab-runners (exécutants CI/CD) sur la même machine que le serveur Gitlab.\n\n## 2. Commencer avec Gitlab\n\n[git - petit guide, juste un petit guide pour bien démarrer avec git. no deep shit ;)](http://rogerdudler.github.io/git-guide/index.fr.html)\n\n### 2.1. Informations de départ\n\nPrenez un compte.\n\n[Get started with GitLab](https://docs.gitlab.com/ce/intro/)\n\n### 2.2. Organize\n\nCreate projects and groups.\n\n- [Create a new project](https://docs.gitlab.com/ce/gitlab-basics/create-project.md)\n- [Create a new group](https://docs.gitlab.com/ce/user/group/index.md#create-a-new-group)\n\n### 2.3. Prioritize\n\nCreate issues, labels, milestones, cast your vote, and review issues.\n\n- [Create an issue](https://docs.gitlab.com/ce/user/project/issues/managing_issues.md#create-a-new-issue)\n- [Assign labels to issues](https://docs.gitlab.com/ce/user/project/labels.md)\n- [Use milestones as an overview of your project's tracker](https://docs.gitlab.com/ce/user/project/milestones/index.md)\n- [Use voting to express your like/dislike to issues and merge requests](https://docs.gitlab.com/ce/user/award_emojis.md)\n\n### 2.4. Collaborate\n\nCreate merge requests and review code.\n\n- [Fork a project and contribute to it](https://docs.gitlab.com/ce/user/project/repository/forking_workflow.md)\n- [Create a new merge request](https://docs.gitlab.com/ce/user/project/merge_requests/creating_merge_requests.md)\n- [Automatically close issues from merge requests](https://docs.gitlab.com/ce/user/project/issues/managing_issues.md#closing-issues-automatically)\n- [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ce/user/project/merge_requests/merge_when_pipeline_succeeds.md)\n- [Revert any commit](https://docs.gitlab.com/ce/user/project/merge_requests/revert_changes.md)\n- [Cherry-pick any commit](https://docs.gitlab.com/ce/user/project/merge_requests/cherry_pick_changes.md)\n\n### 2.5. Test and Deploy\n\nUse the built-in continuous integration in GitLab.\n\n- [Get started with GitLab CI/CD](https://docs.gitlab.com/ce/ci/quick_start/README.md)\n\n### 2.6. Install and Update\n\nInstall and update your GitLab installation.\n\n- [Install GitLab](https://about.gitlab.com/install/)\n- [Update GitLab](https://about.gitlab.com/update/)\n- [Explore Omnibus GitLab configuration options](https://docs.gitlab.com/omnibus/settings/configuration.html)\n\n## 3. Projet de départ GitLab CI avec Pages\n\nGitLab Pages est une fonctionnalité qui permet de publier des sites web statiques directement à partir d'un référentiel dans GitLab. La documentation de départ est accessible à partir de cette page : [Creating and Tweaking GitLab CI/CD for GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_four.html).\n\nUn cycle d'intégration continue dans Gitlab CI est défini à partir d'un fichier de configuration écrit en YAML. Le fichier est placé à la racine du projet sous le nom réservé de `.gitlab-ci.yml`.\n\nUn \"pipeline\" est une suite de \"stages\", soit un flux d'étapes. Un \"stage\" exécute des jobs. Ceux-ci sont définit par des variables, des commandes et la génération d'\"artifacts\". Un \"artifacts\" est le résultats d'une exécution gardé en mémoire pour traitement dans le \"pipeline\".\n\nL'exécution des jobs sont réalisées dans des conteneurs Docker sur n'importe quel machine ou Pod K8s (Kubernetes) enregistrés comme \"Gitlab Runner\".\n\n[GitLab CI/CD Pipeline Configuration Reference](https://docs.gitlab.com/ee/ci/yaml/README.html)\n\nUn \"job\" spécial nommé \"pages\" génère tous les \"artifacts\" d'un site web dans le dossier spécial `public`.\n\n[Job spécial Pages et dossier `public/`](https://docs.gitlab.com/ee/ci/yaml/#pages)\n\n### 3.1. Essai local avec un exemple Gitlab\n\nRéférentiel à importer : [Example GitBook site using GitLab Pages](https://gitlab.com/pages/gitbook.git)\n\n\n```bash\nyum -y install git\n```\n\n```bash\ngit clone https://gitlab.com/pages/gitbook.git\ncd gitbook\nls -la\n```\n\n```bash\ndocker run -it -p 4000:4000 -v $PWD:/gitbook node:latest bash\n```\n\n```bash\ncd /gitbook\nnpm install gitbook-cli -g\ngitbook install\ngitbook serve\n```\n\n### 3.2. Pipeline GitLab CI\n\nFichier .gitlab-ci.yml\n\n```yaml\n# requiring the environment of NodeJS 10\nimage: node:10\n\n# add 'node_modules' to cache for speeding up builds\ncache:\n  paths:\n    - node_modules/ # Node modules and dependencies\n\nbefore_script:\n  - npm install gitbook-cli -g # install gitbook\n  - gitbook fetch 3.2.3 # fetch final stable version\n  - gitbook install # add any requested plugins in book.json\n\ntest:\n  stage: test\n  script:\n    - gitbook build . public # build to public path\n  only:\n    - branches # this job will affect every branch except 'master'\n  except:\n    - master\n\n# the 'pages' job will deploy and build your site to the 'public' path\npages:\n  stage: deploy\n  script:\n    - gitbook build . public # build to public path\n  artifacts:\n    paths:\n      - public\n    expire_in: 1 week\n  only:\n    - master # this job will affect only the 'master' branch\n```\n\n\n## 4. CI/CD Gitbook\n\n### 4.1. Pipeline GitLab CI\n\nRéférentiel à importer : [Gitbook Publication](https://github.com/goffinet/gitbook-publication)\n\n![Pipeline Gitlab pour gitbook](/images/pipeline-gitlab-gitbook-publication.jpg)\n\nFichier `gitlab-ci.yml` :\n\n```yaml\n# This pipeline run three stages Test, Build and Deploy\nstages:\n  - test\n  - build\n  - deploy\n\nimage: goffinet/gitbook:latest\n\n# the 'gitbook' job will test the gitbook tools\ngitbook:\n  stage: test\n  image: registry.gitlab.com/goffinet/gitbook-gitlab:latest\n  script:\n    - 'echo \"node version: $(node -v)\"'\n    - gitbook -V\n    - calibre --version\n  allow_failure: false\n\n# the 'lint' job will test the markdown syntax\nlint:\n  stage: test\n  script:\n    - 'echo \"node version: $(node -v)\"'\n    - echo \"markdownlint version:\" $(markdownlint -V)\n    - markdownlint --config ./markdownlint.json README.md\n    - markdownlint --config ./markdownlint.json *.md\n  allow_failure: true\n\n# the 'html' job will build your document in html format\nhtml:\n  stage: build\n  dependencies:\n    - gitbook\n    - lint\n  script:\n    - gitbook install # add any requested plugins in book.json\n    - gitbook build . book # html build\n  artifacts:\n    paths:\n      - book\n    expire_in: 1 day\n  only:\n    - master # this job will affect only the 'master' branch\n  allow_failure: false\n\n# the 'pdf' job will build your document in pdf format\npdf:\n  stage: build\n  dependencies:\n    - gitbook\n    - lint\n  before_script:\n    - mkdir ebooks\n  script:\n    - gitbook install # add any requested plugins in book.json\n    - gitbook pdf . ebooks/${CI_PROJECT_NAME}.pdf # pdf build\n  artifacts:\n    paths:\n      - ebooks/${CI_PROJECT_NAME}.pdf\n    expire_in: 1 day\n  only:\n    - master # this job will affect only the 'master' branch\n\n# the 'epub' job will build your document in epub format\nepub:\n  stage: build\n  dependencies:\n    - gitbook\n    - lint\n  before_script:\n    - mkdir ebooks\n  script:\n    - gitbook install # add any requested plugins in book.json\n    - gitbook epub . ebooks/${CI_PROJECT_NAME}.epub # epub build\n  artifacts:\n    paths:\n      - ebooks/${CI_PROJECT_NAME}.epub\n    expire_in: 1 day\n  only:\n    - master # this job will affect only the 'master' branch\n\n# the 'mobi' job will build your document in mobi format\nmobi:\n  stage: build\n  dependencies:\n    - gitbook\n    - lint\n  before_script:\n    - mkdir ebooks\n  script:\n    - gitbook install # add any requested plugins in book.json\n    - gitbook mobi . ebooks/${CI_PROJECT_NAME}.mobi # mobi build\n  artifacts:\n    paths:\n      - ebooks/${CI_PROJECT_NAME}.mobi\n    expire_in: 1 day\n  only:\n    - master # this job will affect only the 'master' branch\n\n# the 'pages' job will deploy your site to your gitlab pages service\npages:\n  stage: deploy\n  dependencies:\n    - html\n    - pdf\n    - mobi\n    - epub # We want to specify dependencies in an explicit way, to avoid confusion if there are different build jobs\n  script:\n    - mkdir .public\n    - cp -r book/* .public\n    - cp -r ebooks/* .public\n    - mv .public public\n  artifacts:\n    paths:\n      - public\n  only:\n    - master\n```\n\n### 4.2. Déploiement sur Netlify\n\n...\n\n## 5. CI/CD Jekyll\n\n### 5.1. Pipeline GitLab CI\n\nRéférentiel à importer : [Jekyll good-clean-read](https://github.com/goffinet/good-clean-read)\n\nFichier `gitlab-ci.yml` :\n\n```yaml\nimage: ruby:2.3\n\nvariables:\n  JEKYLL_ENV: production\n  LC_ALL: C.UTF-8\n\nbefore_script:\n  - bundle install\n\npages:\n  stage: deploy\n  script:\n  - bundle exec jekyll build -d public\n  artifacts:\n    paths:\n    - public\n  only:\n  - gitlab\n```\n\n## 6. CI/CD Mkdocs\n\n### 6.1. Pipeline GitLab CI\n\nRéférentiel à importer : [mkdocs-material-boilerplate](https://github.com/goffinet/mkdocs-material-boilerplate)\n\nFichier `gitlab-ci.yml` :\n\n```yaml\nimage: python:3.6-alpine\n\nbefore_script:\n  - pip install --upgrade pip \u0026\u0026 pip install -r requirements.txt\n\npages:\n  script:\n    - mkdocs build\n    - mv site public\n  artifacts:\n    paths:\n    - public\n  only:\n  - master\n```\n\n### 6.2. Déploiement sur Netlify\n\n[![Deployer sur Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/goffinet/mkdocs-material-boilerplate)\n\n## 7. CI/CD Maven - Apache Tomcat\n\n[Artifactory and Gitlab](https://docs.gitlab.com/ee/ci/examples/artifactory_and_gitlab/)\n\n### 7.1. Premier exemple\n\nExemple CI/CD avec Maven, lecture de l'exemple et application selon le document [Maven in five minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html).\n\nCréer un dépôt sur Gilab et le cloner localement.\n\nImporter une clé SSH.\n\nImage Docker maven.\n\nPipeline :\n\n- test\n- build\n\n#### Essai local\n\n```bash\nmvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false\ncd my-app\ndocker run -it -v $PWD/my-app:/my-app maven bash\nexit\n```\n\n#### Pipeline GitLab CI\n\nFichier `.gitlab-ci.yml`\n\n```yaml\nimage: maven:latest\n\nbuild:\n  stage: build\n  script:\n  - mvn package\n  artifacts:\n    paths:\n    - target\n\ntest:\n  stage: test\n  script:\n  - java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App\n```\n\n#### Initialisation d'un repo gitlab\n\n```bash\ngit init\ngit add *\necho \"target\" \u003e\u003e .gitignore\ngit add .gitignore\ngit remote add origin https://gitlab.com/account/project.git\ngit push -u origin master\n```\n\n### 7.2. Second exemple\n\nCette fois ci avec l'archétype Maven \"Webapp\" et une phase/job \"deploy\"\n\n- test\n- build\n- deploy\n\n#### Déploiement sur Tomcat\n\n...\n\nMéthodes | Authentification\n--- | ---\nSSH et Bash | clé secrète\nSCP | clé secrète\nText Manager avec curl | login/mot de passe\n\n#### Variables cachées\n\n...\n\n#### Gitlab Runner\n\nExécution sur un Gitlab-Runner qui héberge le serveur applicatif.\n\n...\n\n#### Avertissement Slack\n\n...\n\n#### Pipeline GitLab CI\n\n...\n\n## 8. Projets PHP\n\n[Test PHP projects using the Docker executor](https://docs.gitlab.com/ee/ci/examples/php.html#test-php-projects-using-the-docker-executor)\n\n[PHP (PHP.gitlab-ci.yml)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/PHP.gitlab-ci.yml)\n\n```yaml\n# Select image from https://hub.docker.com/_/php/\nimage: php:latest\n\n# Select what we should cache between builds\ncache:\n  paths:\n    - vendor/\n\nbefore_script:\n  - apt-get update -yqq\n  - apt-get install -yqq git libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev\n  # Install PHP extensions\n  - docker-php-ext-install mbstring mcrypt pdo_pgsql curl json intl gd xml zip bz2 opcache\n  # Install \u0026 enable Xdebug for code coverage reports\n  - pecl install xdebug\n  - docker-php-ext-enable xdebug\n  # Install and run Composer\n  - curl -sS https://getcomposer.org/installer | php\n  - php composer.phar install\n\n# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service\n# See http://docs.gitlab.com/ee/ci/services/README.html for examples.\nservices:\n  - mysql:5.7\n\n# Set any variables we need\nvariables:\n  # Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)\n  MYSQL_DATABASE: mysql_database\n  MYSQL_ROOT_PASSWORD: mysql_strong_password\n\n# Run our tests\n# If Xdebug was installed you can generate a coverage report and see code coverage metrics.\ntest:\n  script:\n    - vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never\n\n```\n\n## 9. Installation d'un serveur GitLab CE\n\nOn trouve plusieurs modes d'installation d'un serveur Gitlab :\n\n- Installation par \"Omnibus\"\n- Installation par les sources\n- Déploiement avec Docker\n\nNous évoquons ici uniquement une installation par \"Omnibus\".\n\n### 9.1. Omnibus\n\n[Omnibus GitLab](https://docs.gitlab.com/omnibus/README.html) est un Fork personnalisée du projet Omnibus de Chef qui utilise des composants de Chef comme les cookbooks et les recipes pour exécuter la tâche de configuration d'un serveur GitLab sur un ordinateur. Le dépôt Omnibus GitLab sur GitLab.com héberge tous les composants nécessaires à Omnibus. Cela comprend les parties d'Omnibus qui sont nécessaires pour construire le paquet, comme les configurations et les métadonnées du projet, et les composants liés à Chef qui seront utilisés sur l'ordinateur après l'installation.\n\n![Omnibus GitLab Architecture and Components](/images/gitlab-components.png)\n\nSource de l'image : [Omnibus GitLab Architecture and Components](https://docs.gitlab.com/omnibus/architecture/README.html)\n\n### 9.2. Installation par Omnibus\n\nNous choisissons [une installation par Omnibus](https://docs.gitlab.com/omnibus/manual_install.html).\n\nLe variable `${EXTERNAL_URL}` décide l'usage de HTTP ou HTTPS.\n\nOn installe un packet rpm sur Centos 7.\n\n```bash\n#tls=no\nmkdir tmp ; cd tmp\nexport PUBLIC_IPV4=$(curl -s ipinfo.io/ip)\nexport DNSDOMAIN=\"gitlab.${PUBLIC_IPV4}.nip.io\"\nif [[ \"$tls\" == \"no\" ]] ; then\nexport EXTERNAL_URL=\"http://${DNSDOMAIN}\"\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 1000 -nodes -subj '/CN=$DNSDOMAIN'\nelse\nexport EXTERNAL_URL=\"https://${DNSDOMAIN}\"\nfi\nexport GITLAB_VERSION=\"13.7.1\"\nyum -y install policycoreutils-python\nyum -y install wget\nwget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-${GITLAB_VERSION}-ce.0.el7.x86_64.rpm/download.rpm\nexport LC_ALL=\"en_US.UTF-8\"\necho 'export LC_ALL=\"en_US.UTF-8\"' \u003e\u003e .bashrc\nrpm -Uvh gitlab-ce-${GITLAB_VERSION}-ce.0.el7.x86_64.rpm\n```\n\nA la première connexion sur l'interface Web, vous décidez d'un mot de passe `root`. Par défaut, les utilisateurs peuvent s'auto-enregistrer. Un compte comme `root` admet ces nouvelles demandes et octroie les droits aux utilisateurs. Ce comportement peut facilement être diminué ou être augmenté en terme de sécurité.\n\n```\nNotes:\nIt seems you haven't specified an initial root password while configuring the GitLab instance.\nOn your first visit to  your GitLab instance, you will be presented with a screen to set a\npassword for the default admin account with username `root`.\n\ngitlab Reconfigured!\n\n       *.                  *.\n      ***                 ***\n     *****               *****\n    .******             *******\n    ********            ********\n   ,,,,,,,,,***********,,,,,,,,,\n  ,,,,,,,,,,,*********,,,,,,,,,,,\n  .,,,,,,,,,,,*******,,,,,,,,,,,,\n      ,,,,,,,,,*****,,,,,,,,,.\n         ,,,,,,,****,,,,,,\n            .,,,***,,,,\n                ,*,.\n\n\n\n     _______ __  __          __\n    / ____(_) /_/ /   ____ _/ /_\n   / / __/ / __/ /   / __ `/ __ \\\n  / /_/ / / /_/ /___/ /_/ / /_/ /\n  \\____/_/\\__/_____/\\__,_/_.___/\n\n\nThank you for installing GitLab!\n```\n\nEn cas de problème : [How to reset your root password](https://docs.gitlab.com/12.10/ee/security/reset_root_password.html)\n\n### 9.3. Mise-à-jour\n\nLa [mise à jour](https://docs.gitlab.com/omnibus/update/README.html#update-using-a-manually-downloaded-package) consiste à installer un nouveau packet dans la nouvelle version.\n\n```bash\nexport GITLAB_VERSION=\"13.7.2\"\nyum -y install policycoreutils-python\nyum -y install wget\nwget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-${GITLAB_VERSION}-ce.0.el7.x86_64.rpm/download.rpm\nexport LC_ALL=\"en_US.UTF-8\"\necho 'export LC_ALL=\"en_US.UTF-8\"' \u003e\u003e .bashrc\nrpm -Uvh gitlab-ce-${GITLAB_VERSION}-ce.0.el7.x86_64.rpm\n```\n\n### 9.4. Post-installation\n\n- Mail : installation postfix 'Internet Site' ou [configure an external SMTP server](https://docs.gitlab.com/omnibus/settings/smtp.html)\n- [LDAP](https://docs.gitlab.com/ce/administration/auth/ldap/index.html#general-ldap-setup)\n- [Stocker les données dans des autres emplacements](https://docs.gitlab.com/omnibus/settings/configuration.html#storing-git-data-in-an-alternative-directory) ou encore sur [Stackoverflow](https://stackoverflow.com/questions/19902417/change-the-data-directory-gitlab-to-store-repos-elsewhere)\n- [Démarrer les services après les points de montage](https://docs.gitlab.com/omnibus/settings/configuration.html#only-start-omnibus-gitlab-services-after-a-given-file-system-is-mounted)\n- [Les emplacements des données](https://docs.gitlab.com/ee/administration/repository_storage_paths.html)\n- [Configurer la timezone](https://docs.gitlab.com/ee/administration/timezone.html)\n- [Modifier le logo](https://docs.gitlab.com/ee/user/admin_area/appearance.html#navigation-bar)\n\n### 9.5. Modèle AWS CloudFormation\n\n...\n\n## 10. Administration d'un serveur GitLab\n\n[Tâches de maintenance](https://docs.gitlab.com/omnibus/maintenance/README.html)\n\n### 10.1. Emplacement des fichiers\n\n- L'emplacement par défaut des données : `/var/opt/gitlab/git-data`\n- Fichier de configuration du serveur : `/etc/gitlab/gitlab.rb`\n\n### 10.2. Gestion du serveur\n\n- Reconfiguration du serveur : `gitlab-ctl reconfigure`\n- Statut du serveur : `gitlab-ctl status`\n- [Tail sur les logs](https://docs.gitlab.com/omnibus/settings/logs.html) : `gitlab-ctl tail`\n- Démarrer, arrêter ou redémarrer le serveur ou des services : `gitlab-ctl start|stop|restart`\n\n### 10.3. Backups\n\n- [Backup des configs et des datas](https://docs.gitlab.com/omnibus/settings/backups.html)\n\n## 11. Installation et configuration de Gitlab Runner\n\n### 11.1. Installation\n\nTéléchargement des dépôts de paquetage Gitlab: [Install GitLab Runner](https://docs.gitlab.com/runner/install/)\n\nPour Debian/Ubuntu :\n\n```bash\ncurl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash\n```\n\nPour RHEL/CentOS/Fedora\n\n```bash\ncurl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash\n```\n\nInstallation de Gitlab Runner.\n\n```bash\nsudo apt-get install gitlab-runner || sudo yum install gitlab-runner\n```\n\n### 11.2. Enregistrement auprès du serveur Gitlab\n\nPour que votre instance devienne un noeud d'exécution Gitlab, veuillez vous rendre sur la page Settings/CI CD/Runners du projet Gitlab. Vous y trouverez le token qui permettra à votre instance de se faire connaître auprès du projet Gitlab.\n\n```bash\nsudo gitlab-runner register \\\n  --non-interactive \\\n  --url \"https://gitlab.com/\" \\\n  --registration-token \"$PROJECT_REGISTRATION_TOKEN\" \\\n  --executor \"docker\" \\\n  --docker-image alpine:3 \\\n  --description \"docker-runner\" \\\n  --tag-list \"docker,aws\" \\\n  --run-untagged \\\n  --locked=\"false\"\n```\n\nUn fichier de configuration sera créé à l'endroit `/etc/gitlab-runner/config.toml`.\n\nEnsuite, démarrer le logiciel.\n\n```bash\nsudo gitlab-runner start\n\n```\n\nEn revenant sur la page Settings/CI CD/Runners du projet Gitlab, on devrait y trouver la liste des \"runners\" avec l'instance.\n\n![Runners dans Gitlab CI](/images/gitlab-runners.jpg)\n\n## 12. Scénario de vie / Orchestration\n\n### 12.1. Approvisionnement automatique du runner\n\n#### Installation, enrigistrement et démarrage de gitlab runner\n\nVeuillez vérifier tous les paramètres.\n\n```bash\n#!/bin/bash\n\n# Gitlab runner installation\nPROJECT_REGISTRATION_TOKEN=$1\napt-get update \u0026\u0026 apt-get -y upgrade\napt-get -y install curl\ncurl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash\napt-get -y install gitlab-runner\ngitlab-runner register \\\n  --non-interactive \\\n  --url \"https://gitlab.com/\" \\\n  --registration-token \"$PROJECT_REGISTRATION_TOKEN\" \\\n  --executor \"docker\" \\\n  --docker-image alpine:3 \\\n  --description \"AWS docker-runner\" \\\n  --tag-list \"docker,aws\" \\\n  --run-untagged \\\n  --locked=\"false\"\ngitlab-runner start\n```\n\n#### Installation de Docker CE\n\n```bash\n# Docker installation\napt-get -y install \\\n  apt-transport-https \\\n  ca-certificates \\\n  curl \\\n  gnupg2 \\\n  software-properties-common\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\nadd-apt-repository \\\n    \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \\\n    $(lsb_release -cs) \\\n    stable\"\napt-get update\napt-get -y install docker-ce\n\n```\n\n### 12.2. Approvisionnement d'instance via cloud-init\n\n...\n\n### 12.3. Approvisionnement d'instances via Kubernetes\n\n...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoffinet%2Fgitlab-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoffinet%2Fgitlab-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoffinet%2Fgitlab-ci/lists"}