diff options
author | Phil Burton <phil@d3r.com> | 2019-02-25 13:37:59 +0000 |
---|---|---|
committer | Phil Burton <phil@d3r.com> | 2019-02-25 13:37:59 +0000 |
commit | 3431e667a5c6475043ebfd97b43a3fdc4b078596 (patch) | |
tree | cd9eb1249e42de8ee1c7e99fd83cb7f091637b7c /day2/from-dev-to-prod-with-gitlab-ci.txt | |
parent | 4e8368f4d847e5c1352302fc53658dfab2c72a9b (diff) |
Diffstat (limited to 'day2/from-dev-to-prod-with-gitlab-ci.txt')
-rw-r--r-- | day2/from-dev-to-prod-with-gitlab-ci.txt | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/day2/from-dev-to-prod-with-gitlab-ci.txt b/day2/from-dev-to-prod-with-gitlab-ci.txt new file mode 100644 index 0000000..f7e25ba --- /dev/null +++ b/day2/from-dev-to-prod-with-gitlab-ci.txt @@ -0,0 +1,124 @@ +# Dev to prod with GitLab CI + +https://talks.bitexpert.de/phpuk19-gitlabci/ +Stephan Hockdorfer + +## Overview +- Stefan +- bitExpert AG (Germany) + +## Gitlab +Old wikipedia description: + Web based git repo manager with wiki and issue tracking +## Beyond CI/CD + - Dev, Ops, CD/CO + +## Installation +Lots of ways. +Docker. +- Use a registry +- Sonatype Nexus +- Nexus installation for repo manager +- Reverse proxy for routing, and running multiple instances + +### Traefik +Simple to configure +Configure +Can listen to socket, and other things +Can do lets encrypt stuff + + +## Crating projects +Magento as an example +Slightly more difficult to install +Has some complication + +1. Composer install +2. Add to git and push +3. Need a git lab runner (Can host the runners or use SASS offering) + (docker container for runner) + +(Gitlab instance and runner installed via docker) + +Access runner overview page and grab registration token +Create runner instance +gitlab-runner gitlab-runner register + - token + - description + - tags + - run untagged builds? + - current project? + - executor? (docker, shell,.. etc) (more control if we use docker) + - default docker image +-- This creates the runner config file +-- Edit and amend, e.g. add volumes of shared composer stuff ***Should we do this at d3r?*** + +## Managing Secrets +add to project, can use in groups + +## Add .gitlab-ci.yaml (similar to travis) + -- define Image + -- define job scripts + +## http-basic auth via composer +What is this? + + +## Gitlab services +Multiple images should spin up first, then jobs can run +Health checks built in, cheks exposed ports +Spins up second container waiting for ports to be available then spins down +(Gitlab says you cant 100% trust this to coinfirm all is working) + +### add mysql service +1. Define image, define variables (passowrd) +2. define things it needs + +## Build piplines +- test +- build +- build staging + - define where in "data center" the staging stuff is + - Define git registration + - dine staging url +- Build creates tar file ready for deploy +- deploy! +- when manual trigger - Dont auto build and deploy everything to staging and production, Allow us to test te staging +env first and then manually kick off the deployment for production + + +## Problem with this set-up +- Multi developers means we're not sure of staging set-up +- Staging per developer? +- What about a staging per feature branch? + - yes + - Review Apps + - documentation not great + - Dynamically create staging environments + - make sure on_stop + - only run for merge_requests (fairly new, used to have to do "all branches but not master") + - define stop_review to pull down containers + +1. Create merge request +2. Test and build begins +3. It then gives you the urls for testing +4. Merge. Then staging is deployed +5. Then manually hit up production + + + +## Questions +Create a standard web app +Can Import from github!!! +Auto dev ops? + - Auto turned on + - Not sure how good it is + - maybe we just disable +Can we lock down how things get deployed + - Role based auth is bad + - Don't have fine grain control (most of the team need maintainer role) + +# Useful links +https://www.sonatype.com/ +https://traefik.io/ +https://talks.bitexpert.de/phpuk19-gitlabci/ |