Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Serious deployment: unlimited environments!

207 views

Published on

Whatever git flow you may be following (git flow, github flow, gitlab flow, ...): At the time you deploy your branch to some environment you usually need to answer the question: “Which environment?” Typically the number of available environments is limited which will result in a number of different constraints that obstruct your deployment pipeline. What if you could eliminate this limitation by relying on an potential unlimited number of environments? The talk will detail on how to achieve this scenario relying on the cloud and tools such as AWS cloudformation.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Serious deployment: unlimited environments!

  1. 1. Serious Deployment: Unlimited Environments Dr. Gunnar Wrobel, JobMatchMe GmbH
  2. 2. Disrupting the employment market for non-academic professionals
  3. 3. Business
  4. 4. Revisiting github flow https://guides.github.com/introduction/flow/
  5. 5. Revisiting github flow
  6. 6. Revisiting github flow
  7. 7. Revisiting github flow Where to?
  8. 8. https://softwareengineering.stackexchange.com/questions/362072/in-github-flow-why-is-it-important-to-deploy-after-push-to-master … This is a very lightweight process, so it is assumed that you do not have to perform extensive QA before release. Your deployment process should perform automated tests, and once the feature is live you are supposed to validate it in production. If there's a problem, you just re-deploy the current state of the master branch. In my opinion this process is so lightweight that it is almost meaningless. It seems to be most suitable for small teams working on early-stage products where failures in production are acceptable. …
  9. 9. What if ... … you could get an environment per branch? ENTER THE CLOUD ….
  10. 10. .gitlab-ci.yml Frontend packages/aws-setup/.gitlab-ci.yml Backend packages/api/.gitlab-ci.yml
  11. 11. template.yaml Backend packages/api/.gitlab-ci.yml
  12. 12. Cloudformation https://aws.amazon.com/cloudformation/
  13. 13. View Tables JmmApiProjectionsFunction projections.js template.yaml Backend packages/api/.gitlab-ci.yml JmmApiLambdaFunction index.js JmmDbEventsTable JMM${__Stage__}EventsTable TruckJobsFrontendDistribution JmmApi JmmApiAuthFunction auth.js JmmApiMessengerFunction messengerQueue.js JmmApiPipedriveFunction pipe.js AWS SES Pipedrive Command POST Query GET
  14. 14. Orchestration - .gitlab-ci.yml ############################### # deploy # ############################### variables: DEV_STAGE: https://$CI_COMMIT_REF_SLUG.truck-jobs.com presetup:dev:api: stage: presetup only: refs: - merge_requests script: - DEV_STAGE=$CI_COMMIT_REF_SLUG yarn run deploy:dev - STAGE=$CI_COMMIT_REF_SLUG yarn seedData
  15. 15. Orchestration - package.json ... "package:dev": " aws cloudformation package --template-file template.yaml --output-template-file deploy.yaml --s3-bucket cloudformation-deploymentbucket-backend --s3-prefix $DEV_STAGE", "deploy:dev": " yarn run build && yarn run package:dev && aws cloudformation deploy --stack-name backend-$DEV_STAGE --template-file deploy.yaml --s3-bucket cloudformation-deploymentbucket-backend --s3-prefix $DEV_STAGE --parameter-overrides Stage=$DEV_STAGE --region eu-central-1", ...
  16. 16. Orchestration - template.yaml: Deriving the stage name from the branch ... AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > JobMatchMe Backend The full API of the JobMatchMe GmbH Parameters: Stage: Type: String Description: The stage that is being deployed to ...
  17. 17. Orchestration - template.yaml: Creating stage specific resources ... Resources: # ----------------------------------- # DB # ----------------------------------- JmmDbEventsTable: Type: AWS::DynamoDB::Table Condition: IsBranch Properties: TableName: !Join - '' - - JMM - !Ref Stage - EventsTable AttributeDefinitions: - AttributeName: 'aggregate' AttributeType: 'S' ...
  18. 18. TruckJobsFrontendDistribution frontend.yaml Frontend packages/aws-setup/.gitlab-ci.yml TruckJobsDomain ${__Stage__}.truck-jobs.com Backend ${__ApiDomain__}.execute-api.eu-central-1.amazonaws.com packages/api/.gitlab-ci.yml FrontendCoreS3Bucket cf.${__Stage__}.main.truck-jobs.com packages/main/.gitlab-ci.yml MatchesS3Bucket cf.${__Stage__}.matches.truck-jobs.com packages/internal-matches/.gitlab-ci.yml NewsFrontendBucket cf.${__Stage__}.news.truck-jobs.com netlify-news-cms
  19. 19. Disadvantages / Advantages ● Lack of pressure to automate QA ● Lots of environments dangling around ● Lots of AWS parts dangling around ● Easy testing, playing around, learning, discussing, designing, demonstrating ● No feature toggles ● Amazingly low cost
  20. 20. Thanks! Dr. Gunnar Wrobel, JobMatchMe GmbH https://twitter.com/gunnarwrobel https://www.linkedin.com/in/gunnarwrobel/ https://jobmatch.me

×