{"componentChunkName":"component---gatsby-theme-mdx-deck-src-templates-deck-js","path":"/","matchPath":"/*","result":{"data":{"deck":{"id":"5990c79d-7c5d-5e15-9f5a-f9d542993433","body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar theme = selected;\nvar _frontmatter = {};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar layoutProps = {\n  theme: theme,\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", null, \"CI\"), mdx(\"h4\", null, mdx(Tomato, {\n    mdxType: \"Tomato\"\n  }, \"Or how to automate the boring parts\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"Hello everyone! \"), mdx(\"p\", null, \"Today I'm going to talk about the CI part of CI/CD (Continuous Integration & Continuous Delivery), or as how I like to call it, 'How to automate the boring parts' \")), mdx(\"hr\", null), mdx(Image, {\n    src: Profile,\n    style: {\n      display: 'flex',\n      alignItems: 'center',\n      justifyContent: 'center',\n      color: 'white',\n      WebkitTextStrokeWidth: '2px',\n      WebkitTextStrokeColor: '#000',\n      backgroundColor: 'white'\n    },\n    mdxType: \"Image\"\n  }, mdx(\"h1\", null, \"About Me \\uD83D\\uDC68\\u200D\\uD83D\\uDCBB\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"First, a little about me. My name is Rohit Gohri, I am a Sr. Software Developer at CollegeDunia. \"), mdx(\"p\", null, \"I am a full stack developer with a keen interest in DevOps, I love optimising developer workflows and working on devloper tooling.\")), mdx(\"hr\", null), mdx(Small, {\n    mdxType: \"Small\"\n  }, mdx(\"h1\", null, \"\\uD83D\\uDD55 \\uD83D\\uDD59 \\uD83D\\uDD5B \\uD83D\\uDD5E\"), mdx(\"h1\", null, \"What Is Continuous Integration?\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"The process of continuously testing/building/etc your code as you \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"push\"), \" it so that \"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"problems get detected early\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"your main branch is never in a broken state, and\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"it is \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"always\"), \" deployable\"))), mdx(\"hr\", null), mdx(\"h1\", null, \"Why should you care?\"), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Single source of truth: No more \\\"But it works on my machine\\\"\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Enforce common rules for teams: Have a linting config? Have a codestyle? Want to enforce sepecific folder structures? Everything can be checked by the CI\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Faster/Better Code Reviews: Having the basic stuff automatically checked leaves the reviewer to focus on the code\"))), mdx(\"hr\", null), mdx(\"h2\", null, \"Prerequisites for \", mdx(Tomato, {\n    mdxType: \"Tomato\"\n  }, \"CI\")), mdx(\"ul\", null, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(\"li\", null, \"Automated Setup/Containerization\"), mdx(\"li\", null, \"Testability\"), mdx(\"li\", null, \"Reproducibility\"), mdx(\"li\", null, mdx(Tomato, {\n    mdxType: \"Tomato\"\n  }, \"Culture\")))), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"There are some things that your project & team need to have before you start this journey.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Automated Setup\"), \": Using things like \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://docs.docker.com/engine/docker-overview/\"\n  }), \"Docker\"), \" to make your code portable and easier to run on any machine and/or environments, or using Infrastructure as Code tools like \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://docs.ansible.com/ansible/latest/user_guide/quickstart.html\"\n  }), \"Ansible\"), \" to setup systems in an automated way\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Testability\"), \": Your code should be testable in an automatic fashion. Could be unit tests, integration tests, api tests through Postman, or UI testing.\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Reproducibility\"), \": Test results should be same in different environments and on repeat runs\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Culture\"), \": All of this if useless if you or your team members don't follow the process all of you set for yourselves. A failing CI pipeline is useless if the branch gets merged anyway.\"))), mdx(\"p\", null, \"There are also some implicit ones that aren't mentioned like having a version control system (like Git), a Pull/Merge Request based check-in system, etc.\")), mdx(\"hr\", null), mdx(\"h1\", null, \"Tools of the Trade\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://docs.gitlab.com/ee/ci/\"\n  }), \"Gitlab CI\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://drone.io/\"\n  }), \"Drone.io\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://github.com/features/actions\"\n  }), \"Github Actions\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://azure.microsoft.com/en-in/services/devops/\"\n  }), \"Azure DevOps\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://jenkins.io/\"\n  }), \"Jenkins\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://jenkins.io/\"\n  }), \"JetBrains TeamCity\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://travis-ci.org/\"\n  }), \"Travis CI\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://circleci.com/\"\n  }), \"Circle CI\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \".....\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"There are lots of options in the market now. \"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Size\", mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Big (Microsoft - Azure) \"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Small (Drone.io) \"))), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Model\", mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"SaaS (Azure)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Self-hosted(Jenkins)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Both (Drone, Gitlab)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Mixed: SaaS + Self Hosted Runners (Gitlab/Github).\")))), mdx(\"p\", null, \"A lot of them are also free for open source projects! So there is no excuse to not use these on your next personal project.\"), mdx(\"p\", null, \"There are also small niche tools that plug into your existing infra, eg. DangerJS (adding custom project specific checks), Relative-CI (for comparing bundle-sizes), CodeCov for coverage, CodeClimate, etc. These work alongside/through your option of choice above.\")), mdx(\"hr\", null), mdx(\"h1\", null, \"Pipelines & YAML\"), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"The code that runs on every push/event is termed as Pipelines. Different providers have different naming conventions.\"), mdx(\"p\", null, \"YAML(Yet Another Markup Language) is file format for declaring static information, it is used by a lot of popular Infrastructure as Code tools and most CI servers.\\nThe format is different for each Server.\")), mdx(\"hr\", null), mdx(\"h1\", null, \"Demo\"), mdx(\"div\", {\n    style: {\n      display: 'flex'\n    }\n  }, mdx(\"img\", {\n    src: QRCode,\n    style: {\n      width: '30vw'\n    }\n  }), mdx(\"span\", null, \"\\xA0\\xA0\\xA0\"), mdx(\"div\", {\n    style: {\n      display: 'flex',\n      alignItems: 'center',\n      fontSize: '32px'\n    }\n  }, \"github.com/rohit-smpx/hello-ci-frontend\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(Tomato, {\n    mdxType: \"Tomato\"\n  }, \"Send link to slack channel at this time\"), mdx(\"p\", null, \"So for the demo I have already set up a simple repository on Github with create-react-app.\"), mdx(\"p\", null, \"It would be great if you could take out your laptops and open the link\"), mdx(\"p\", null, \"I have added configs for 4 CI providers in one single repo. You can check how they are setup later.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Github\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Gitlab\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Drone\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Travis\"))), mdx(\"hr\", null), mdx(\"h1\", null, \"Make Some \", mdx(Tomato, {\n    mdxType: \"Tomato\"\n  }, \"Changes\")), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Fork the project\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Clone it\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Create and checkout to a new branch: \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"git checkout -b demo\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Do \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"npm i\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Start the website: \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"npm start\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Change something\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"Could be:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Add a component OR\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Change some styling OR\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Something else\"))), mdx(\"hr\", null), mdx(\"h1\", null, \"Open a PR\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Commit and push your code\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Open the Demo repository and Create a new PR\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Wait for results from CI\")), mdx(\"hr\", null), mdx(\"h1\", null, \"Let's see some results\"), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"Already have 2 PRs open already (one passing and one failing).\\nWait for people to do this.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Show some results\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"one failing\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"one passing\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"different providers\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Lastly focus on Gitlab CI results to associate with next slide\"))), mdx(\"hr\", null), mdx(\"h1\", null, \"How did this happen?\"), mdx(\"p\", null, \"Let's look at one example config: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".gitlab-ci.yml\")), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: codeTheme,\n    title: \".gitlab-ci.yml\",\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"file=../static/code/.gitlab-ci.yml\",\n    \"file\": \"../static/code/.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"3\": true,\n    \"className\": \"language-yaml\",\n    \"metastring\": \"3 title=\\\"Base Docker Image\\\" file=../static/code/.gitlab-ci.yml\",\n    \"title\": \"\\\"Base\",\n    \"Docker\": true,\n    \"Image\\\"\": true,\n    \"file\": \"../static/code/.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"5:7 title=\\\"ENV VAR overrides\\\" file=../static/code/.gitlab-ci.yml\",\n    \"5:7\": true,\n    \"title\": \"\\\"ENV\",\n    \"VAR\": true,\n    \"overrides\\\"\": true,\n    \"file\": \"../static/code/.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"16:28 title=\\\"The different stages\\\" file=../static/code/.gitlab-ci.yml\",\n    \"16:28\": true,\n    \"title\": \"\\\"The\",\n    \"different\": true,\n    \"stages\\\"\": true,\n    \"file\": \"../static/code/.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"13:14 title=\\\"Runs before every stage\\\" file=../static/code/.gitlab-ci.yml\",\n    \"13:14\": true,\n    \"title\": \"\\\"Runs\",\n    \"before\": true,\n    \"every\": true,\n    \"stage\\\"\": true,\n    \"file\": \"../static/code/.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\"))), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"It is written in YAML. This file defines a pipeline that will be run whenever you push your code. Some providers allow triggering multiple pipelines. Let's look a little closer:\"), mdx(\"p\", null, \"CodeSnippets:\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"This is the base (Docker) image on which each stage of the pipeline will be run\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Any env variable overrides can be specified\")), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Can be used to turn off some features\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Or Logging/Monitoring/etc.\")), mdx(\"ol\", {\n    \"start\": 3\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"These are stages defined that we saw in the UI\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"This script runs before every job in the pipeline\"))), mdx(\"hr\", null), mdx(\"h1\", null, \"Let's Add A New Stage\"), mdx(\"p\", null, \"lint: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"npm run lint\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"Now that you have seen a basic pipeline config, and seen the result of one in a project. Let's try to extend it.\"), mdx(\"p\", null, \"We have a linter(eslint) setup already in \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"package.json\"), \". You can run it through the given command.\"), mdx(\"p\", null, \"Every pipeline has 2 steps currently: test & build. Let's ensure that the code is linted properly before we do any of those.\")), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: codeTheme,\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"16:28 title=\\\"The different stages\\\" file=../static/code/.gitlab-ci.yml\",\n    \"16:28\": true,\n    \"title\": \"\\\"The\",\n    \"different\": true,\n    \"stages\\\"\": true,\n    \"file\": \"../static/code/.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"16:34 title=\\\"The different stages\\\" file=../static/code/lint.gitlab-ci.yml\",\n    \"16:34\": true,\n    \"title\": \"\\\"The\",\n    \"different\": true,\n    \"stages\\\"\": true,\n    \"file\": \"../static/code/lint.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - lint\\n  - test\\n  - build\\n\\nlint:\\n  stage: lint\\n  script:\\n    - npm run lint\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\"))), mdx(\"hr\", null), mdx(\"h1\", null, \"Some Advanced Usage Patterns\"), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: codeTheme,\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"21:28 title=\\\"Publish NPM Package\\\" file=../static/code/npm.drone.yml\",\n    \"21:28\": true,\n    \"title\": \"\\\"Publish\",\n    \"NPM\": true,\n    \"Package\\\"\": true,\n    \"file\": \"../static/code/npm.drone.yml\"\n  }), \"kind: pipeline\\nname: default\\n\\nsteps:\\n- name: install\\n  image: node:12\\n  commands:\\n  - yarn\\n\\n- name: test\\n  image: node:12\\n  commands:\\n  - yarn lint\\n  - yarn test\\n\\n- name: build\\n  image: node:12\\n  commands:\\n  - yarn build\\n\\n- name: npm\\n  image: plugins/npm\\n  settings:\\n    token:\\n      from_secret: npm_token\\n  when:\\n    event:\\n    - tag\\n\"))), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"NPM modules can automatically be published after building and testing on every git tag release.\")), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: codeTheme,\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"10:16 title=\\\"Build Docs\\\" file=../static/code/docs.drone.yml\",\n    \"10:16\": true,\n    \"title\": \"\\\"Build\",\n    \"Docs\\\"\": true,\n    \"file\": \"../static/code/docs.drone.yml\"\n  }), \"kind: pipeline\\nname: default\\n\\nsteps:\\n- name: install\\n  image: node:12\\n  commands:\\n  - yarn\\n\\n- name: docs\\n  image: node:12\\n  commands:\\n  - yarn docs\\n  when:\\n    event:\\n    - tag\\n\\n- name: commit-and-push-docs\\n  image: docker:git\\n  environment:\\n    GITHUB_TOKEN:\\n      from_secret: github_token\\n  commands:\\n    - git config user.email \\\"doc-user@company.com\\\"\\n    - git config user.name \\\"Doc User\\\"\\n    - git add --all\\n    - git commit -m \\\"Updating docs, `date`\\\"\\n    - git remote add origin-docs https://$GITHUB_TOKEN@github.com/$DRONE_REPO.git\\n    - git push --set-upstream origin-docs master\\n  when:\\n    event:\\n    - tag\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"18:32 title=\\\"Publish Docs\\\" subtitle=\\\"Using Github Pages\\\" file=../static/code/docs.drone.yml\",\n    \"18:32\": true,\n    \"title\": \"\\\"Publish\",\n    \"Docs\\\"\": true,\n    \"subtitle\": \"\\\"Using\",\n    \"Github\": true,\n    \"Pages\\\"\": true,\n    \"file\": \"../static/code/docs.drone.yml\"\n  }), \"kind: pipeline\\nname: default\\n\\nsteps:\\n- name: install\\n  image: node:12\\n  commands:\\n  - yarn\\n\\n- name: docs\\n  image: node:12\\n  commands:\\n  - yarn docs\\n  when:\\n    event:\\n    - tag\\n\\n- name: commit-and-push-docs\\n  image: docker:git\\n  environment:\\n    GITHUB_TOKEN:\\n      from_secret: github_token\\n  commands:\\n    - git config user.email \\\"doc-user@company.com\\\"\\n    - git config user.name \\\"Doc User\\\"\\n    - git add --all\\n    - git commit -m \\\"Updating docs, `date`\\\"\\n    - git remote add origin-docs https://$GITHUB_TOKEN@github.com/$DRONE_REPO.git\\n    - git push --set-upstream origin-docs master\\n  when:\\n    event:\\n    - tag\\n\"))), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Docs can be generated from a Swagger file, JSDoc/JavaDoc, Postman collection etc.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"And published to free static hosting like github pages, etc.\"))), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: codeTheme,\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"38:41 title=\\\"Deploy the Code\\\" file=../static/code/trigger.gitlab-ci.yml\",\n    \"38:41\": true,\n    \"title\": \"\\\"Deploy\",\n    \"the\": true,\n    \"Code\\\"\": true,\n    \"file\": \"../static/code/trigger.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\n# https://hub.docker.com/r/library/node/tags/\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n  - deploy\\n  - downstream\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nlint:\\n  stage: test\\n  script:\\n    - npm run lint\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\\ndeploy:\\n  stage: deploy\\n  script:\\n    - pm2 deploy dev\\n\\ntrigger-consumer:\\n  stage: downstream\\n  trigger: user/api-consumer\\n      \\ntrigger-frontend:\\n  stage: downstream\\n  trigger: \\n    project: user/project-frontend\\n    branch: dev\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-yaml\",\n    \"metastring\": \"43:51 title=\\\"Trigger Downstream Pipelines\\\" file=../static/code/trigger.gitlab-ci.yml\",\n    \"43:51\": true,\n    \"title\": \"\\\"Trigger\",\n    \"Downstream\": true,\n    \"Pipelines\\\"\": true,\n    \"file\": \"../static/code/trigger.gitlab-ci.yml\"\n  }), \"# http://docs.gitlab.com/ce/ci/yaml/README.html\\n\\n# https://hub.docker.com/r/library/node/tags/\\nimage: node:12\\n\\nvariables:\\n  CI: \\\"true\\\"\\n  NODE_ENV: \\\"test\\\"\\n\\ncache:\\n  paths:\\n    - node_modules/\\n\\nbefore_script:\\n  - npm install --unsafe-perm\\n\\nstages:\\n  - test\\n  - build\\n  - deploy\\n  - downstream\\n\\ntest:\\n  stage: test\\n  script:\\n    - npm test\\n\\nlint:\\n  stage: test\\n  script:\\n    - npm run lint\\n\\nbuild:\\n  stage: build\\n  script:\\n    - npm run build\\n\\ndeploy:\\n  stage: deploy\\n  script:\\n    - pm2 deploy dev\\n\\ntrigger-consumer:\\n  stage: downstream\\n  trigger: user/api-consumer\\n      \\ntrigger-frontend:\\n  stage: downstream\\n  trigger: \\n    project: user/project-frontend\\n    branch: dev\\n\"))), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Automated deploys can be initiated by the CI\", mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"SSH keys and other secrets can be provided through env variables\"))), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Pipelines can be triggered for dependent projects after every release\")), mdx(\"p\", null, \"NOTE: Open sapphire pipelines after this\")), mdx(\"hr\", null), mdx(Left, {\n    mdxType: \"Left\"\n  }, mdx(\"h2\", null, \"Links\"), mdx(\"h5\", null, \"\\uD83D\\uDDBC Presentation\"), mdx(\"h4\", null, mdx(\"a\", _extends({\n    parentName: \"h4\"\n  }, {\n    \"href\": \"https://github.com/rohit-smpx/slides\"\n  }), \"https://github.com/rohit-smpx/slides\")), mdx(\"h4\", null, mdx(FontAwesomeIcon, {\n    icon: faTwitter,\n    mdxType: \"FontAwesomeIcon\"\n  }), \" - @rohit_gohri\"), mdx(\"h4\", null, mdx(FontAwesomeIcon, {\n    icon: faGithub,\n    mdxType: \"FontAwesomeIcon\"\n  }), \" - rohit-smpx\")), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, mdx(\"p\", null, \"My presentation is also a js project (built with mdx-deck). Feel free to check it out and suggest any changes.\")), mdx(\"hr\", null), mdx(\"h1\", null, \"The End\"));\n}\n;\nMDXContent.isMDXComponent = true;"}},"pageContext":{"matchPath":"/*","id":"5990c79d-7c5d-5e15-9f5a-f9d542993433","slug":"","title":"CI"}}}