Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
Breaking Bad habits
with GitLab CI
Ivan Nemytchenko | RubyConf Taiwan | December 2, 2016
Ivan
Nemytchenko
→ Russian, live in Serbia
→ Ruby developer since 2006
→ Co-found 2 outsource agencies
→ Team lead, Projec...
RailsHurts.com
How to Stop being Rails
developer
Why talk about GitLab?
→ big monolythic RoR application
→ open source
→ monthly releases
→ open processes (google for GitL...
GitLab
has been started as an attempt to build
open source alternative to GitHub
Breaking Bad with GitLab CI
Breaking Bad Habits with GitLab CI
Habit of not automating
routine operations
CatGrep Sophisticated Technologies inc.
→ file1.txt
→ file2.txt
CatGrep Sophisticated Technologies inc.
The code is on GitLab.com
Requirement #1
Concatenation result should contain
"Hello world"
cat file1.txt file2.txt | grep -q "Hello world"
Run first test inside CI
Run first test inside CI
.gitlab-ci.yml
Run first test inside CI
test:
script: cat file1.txt file2.txt | grep -q 'Hello world'
Run first test inside CI
Run first test inside CI
Requirement #2
Package code before sending it to customer
Package code
test:
script: cat file1.txt file2.txt | grep -q 'Hello world'
package:
script: cat file1.txt file2.txt | gzip...
Package code
Make results of your build downloadable
Make results of your build downloadable
Make results of your build downloadable
Make results of your build downloadable
test:
script: cat file1.txt file2.txt | grep -q 'Hello world'
package:
script: cat...
Run jobs sequentially
Run jobs sequentially
Speeding up the build
Removing Duplication
Learning what Docker image to use
Learning what Docker image to use
Learning what Docker image to use
image: alpine
Learning what Docker image to use
Learning what Docker image to use
Requirement #3
ISO instead of GZIP
Dealing with complex scenarios
Dealing with complex scenarios
script:
- apk add -U cdrkit
- mkisofs -o ./packaged.iso ./compiled.txt
→ 3 stages
→ passing files between stages
→ downloadable artifacts
→ optimized execution time
→ custom pipeline
Requirement #4
Publish a website, containing packages
Publish a website
aws s3 cp ./ s3://yourbucket/ --recursive
Publish a website
Publish a website
First Automated Deployment
→ awscli can be installed using pip
→ pip goes together with python
First Automated Deployment
s3:
image: python
stage: deploy
script:
- pip install awscli
- aws s3 cp ./ s3://yourbucket/ --...
First Automated Deployment
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
First Automated Deployment
Keeping Secret Things Secret
Keeping Secret Things Secret
Settings → Variables
Keeping Secret Things Secret
s3:
image: python
stage: deploy
script:
- pip install awscli
- aws s3 cp ./ s3://yourbucket/ ...
Keeping Secret Things Secret
Requirement #5
Two developers on the project
Two developers on the project
Two developers on the project
Requirement #6
Need a separate place
for testing
Separate place for testing
GitLab Pages
Host website using GitLab Pages
→ your job should be named "pages"
→ put your files into "public" folder
→ specify "artifac...
Host website using GitLab Pages
http://<username>.gitlab.io/<projectname>
Host website using GitLab Pages
pages:
stage: deploy
image: alpine
script:
- mkdir -p ./public && cp ./*.* ./public/
artif...
Separate place for testing
s3:
image: python
stage: deploy
script:
- pip install awscli
- aws s3 cp ./ s3://yourbucket/ --...
Separate place for testing
Separate place for testing
Separate place for testing
Using Environments
Using Environments
Using Environments
Requirement #7
Do not mess up production
Do not mess up production
Do not mess up production
You can afford CI even for
small projects!
Why no ruby?
Questions?
@inem
ivan@gitlab.com
→ bit.ly/gitlab-ci
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
Próxima SlideShare
Cargando en…5
×

Breaking Bad Habits with GitLab CI

528 visualizaciones

Publicado el

Short story demonstrating features of GitLab CI

Publicado en: Tecnología

Breaking Bad Habits with GitLab CI

  1. 1. Breaking Bad habits with GitLab CI Ivan Nemytchenko | RubyConf Taiwan | December 2, 2016
  2. 2. Ivan Nemytchenko → Russian, live in Serbia → Ruby developer since 2006 → Co-found 2 outsource agencies → Team lead, Project manager, etc → Coorganized 2 IT conferences → Developer advocate at GitLab → inem.at → @inem
  3. 3. RailsHurts.com
  4. 4. How to Stop being Rails developer
  5. 5. Why talk about GitLab? → big monolythic RoR application → open source → monthly releases → open processes (google for GitLab handbook) → 140 people (all remote) → 100.000+ companies use it → GitLab.com is free
  6. 6. GitLab has been started as an attempt to build open source alternative to GitHub
  7. 7. Breaking Bad with GitLab CI
  8. 8. Breaking Bad Habits with GitLab CI
  9. 9. Habit of not automating routine operations
  10. 10. CatGrep Sophisticated Technologies inc. → file1.txt → file2.txt
  11. 11. CatGrep Sophisticated Technologies inc. The code is on GitLab.com
  12. 12. Requirement #1 Concatenation result should contain "Hello world"
  13. 13. cat file1.txt file2.txt | grep -q "Hello world"
  14. 14. Run first test inside CI
  15. 15. Run first test inside CI .gitlab-ci.yml
  16. 16. Run first test inside CI test: script: cat file1.txt file2.txt | grep -q 'Hello world'
  17. 17. Run first test inside CI
  18. 18. Run first test inside CI
  19. 19. Requirement #2 Package code before sending it to customer
  20. 20. Package code test: script: cat file1.txt file2.txt | grep -q 'Hello world' package: script: cat file1.txt file2.txt | gzip > package.gz
  21. 21. Package code
  22. 22. Make results of your build downloadable
  23. 23. Make results of your build downloadable
  24. 24. Make results of your build downloadable
  25. 25. Make results of your build downloadable test: script: cat file1.txt file2.txt | grep -q 'Hello world' package: script: cat file1.txt file2.txt | gzip > packaged.gz artifacts: paths: - packaged.gz
  26. 26. Run jobs sequentially
  27. 27. Run jobs sequentially
  28. 28. Speeding up the build
  29. 29. Removing Duplication
  30. 30. Learning what Docker image to use
  31. 31. Learning what Docker image to use
  32. 32. Learning what Docker image to use image: alpine
  33. 33. Learning what Docker image to use
  34. 34. Learning what Docker image to use
  35. 35. Requirement #3 ISO instead of GZIP
  36. 36. Dealing with complex scenarios
  37. 37. Dealing with complex scenarios script: - apk add -U cdrkit - mkisofs -o ./packaged.iso ./compiled.txt
  38. 38. → 3 stages → passing files between stages → downloadable artifacts → optimized execution time → custom pipeline
  39. 39. Requirement #4 Publish a website, containing packages
  40. 40. Publish a website aws s3 cp ./ s3://yourbucket/ --recursive
  41. 41. Publish a website
  42. 42. Publish a website
  43. 43. First Automated Deployment → awscli can be installed using pip → pip goes together with python
  44. 44. First Automated Deployment s3: image: python stage: deploy script: - pip install awscli - aws s3 cp ./ s3://yourbucket/ --recursive
  45. 45. First Automated Deployment AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  46. 46. First Automated Deployment
  47. 47. Keeping Secret Things Secret
  48. 48. Keeping Secret Things Secret Settings → Variables
  49. 49. Keeping Secret Things Secret s3: image: python stage: deploy script: - pip install awscli - aws s3 cp ./ s3://yourbucket/ --recursive
  50. 50. Keeping Secret Things Secret
  51. 51. Requirement #5 Two developers on the project
  52. 52. Two developers on the project
  53. 53. Two developers on the project
  54. 54. Requirement #6 Need a separate place for testing
  55. 55. Separate place for testing GitLab Pages
  56. 56. Host website using GitLab Pages → your job should be named "pages" → put your files into "public" folder → specify "artifacts" section with this "public" folder
  57. 57. Host website using GitLab Pages http://<username>.gitlab.io/<projectname>
  58. 58. Host website using GitLab Pages pages: stage: deploy image: alpine script: - mkdir -p ./public && cp ./*.* ./public/ artifacts: paths: - public except: - master
  59. 59. Separate place for testing s3: image: python stage: deploy script: - pip install awscli - aws s3 cp ./ s3://yourbucket/ --recursive only: - master pages: image: alpine stage: deploy script: - mkdir -p ./public && cp ./*.* ./public/ artifacts: paths: - public except: - master
  60. 60. Separate place for testing
  61. 61. Separate place for testing
  62. 62. Separate place for testing
  63. 63. Using Environments
  64. 64. Using Environments
  65. 65. Using Environments
  66. 66. Requirement #7 Do not mess up production
  67. 67. Do not mess up production
  68. 68. Do not mess up production
  69. 69. You can afford CI even for small projects!
  70. 70. Why no ruby?
  71. 71. Questions? @inem ivan@gitlab.com → bit.ly/gitlab-ci

×