Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How can automation help with development practices

PaulRbr
December 06, 2017

How can automation help with development practices

PaulRbr

December 06, 2017
Tweet

More Decks by PaulRbr

Other Decks in Programming

Transcript

  1. WHO AM I? ⌨ + ⚙ + ⏸ So ware

    Developer ▶ Linux Infra & Ops @paulRb_r
  2. TL; DL · Local changes · Pull Request / Merge

    Request · Review · ✅ Integration testing · Merge Master · Ship
  3. GITLAB · source code · merge request · review ·

    CI build pipelines · Artifacts · Docker registry · ...much more
  4. .gitlab-ci.yml image: ruby:2.4 bundle: stage: build script: - bundle install

    --deployment artifacts: paths: [ '.bundle/', 'vendor/' ]
  5. .gitlab-ci.yml image: ruby:2.4 bundle: stage: build script: - bundle install

    --deployment artifacts: paths: [ '.bundle/', 'vendor/' ] test: stage: test script: - bundle exec rake test
  6. .gitlab-ci.yml image: ruby:2.4 bundle: stage: build script: - bundle install

    --deployment artifacts: paths: [ '.bundle/', 'vendor/' ] test: stage: test script: - bundle exec rake test lint: stage: test script: - bundle exec rubocop
  7. .gitlab-ci.yml image: ruby:2.4 # … security: stage: test script: -

    bundle exec brakeman bundle-audit: stage: test script: - bundle exec bundle-audit check --update
  8. .gitlab-ci.yml image: ruby:2.4 deploy:integration: stage: deploy script: - bundle exec

    rake deploy env=${CI_COMMIT_REF_NAME} only: - dev performance: stage: qa script: - bundle exec rake performance \ target="https://${CI_COMMIT_REF_NAME}.test.trainline.eu/" only: - dev
  9. .gitlab-ci.yml image: ruby:2.4 deploy:integration: stage: deploy script: - bundle exec

    rake deploy env=${CI_COMMIT_REF_NAME} only: - dev - master
  10. .gitlab-ci.yml image: ruby:2.4 deploy:integration: stage: deploy script: - bundle exec

    rake deploy env=${CI_COMMIT_REF_NAME} only: - dev - master deploy:production: stage: deploy script: - bundle exec rake deploy env=production only: - master when: manual # ← Manual button to trigger Job
  11. Thank you! QUESTIONS? · Slides → · Demo CI →

    https://paulrbr.gitlab.io/talks/dev-workflow.html https://gitlab.com/paulrbr/ruby-ci