{
    "componentChunkName": "component---src-templates-article-page-template-js",
    "path": "/ftw/how-to-use-ci-with-ftw/",
    "result": {"data":{"markdownRemark":{"frontmatter":{"title":"How to use CI with FTW","slug":"how-to-use-ci-with-ftw","updated":"2019-02-05T00:00:00.000Z","category":"ftw-testing-error-handling","ingress":"This guide describes how the Continuous Integration (CI) setup works in Flex Template for Web (FTW) and how to enable it.","skills":null},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"FTW provides a configuration to use "},{"type":"element","tagName":"a","properties":{"href":"https://circleci.com/","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"CircleCI"}]},{"type":"text","value":" as\na continuous integration server to run tests and other scripts. This\nensures quality and can be forced to avoid merging changes that break\ntests or fail audits."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/flex-template-web/blob/master/.circleci/config.yml","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":".circleci/config.yml"}]},{"type":"text","value":"\nfile is used to configure CircleCI."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"1-enable-ci","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#1-enable-ci","ariaLabel":"1 enable ci permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"1. Enable CI"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Follow the\n"},{"type":"element","tagName":"a","properties":{"href":"https://circleci.com/docs/2.0/getting-started/#setting-up-circleci","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Setting up Your Build on CircleCI"}]},{"type":"text","value":"\ninstructions in the CircleCI documentation."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"2-understand-how-the-setup-works","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#2-understand-how-the-setup-works","ariaLabel":"2 understand how the setup works permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"2. Understand how the setup works"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Currently the CI runs the following scripts:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"code-formatting","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#code-formatting","ariaLabel":"code formatting permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Code formatting"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"bash"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"yarn"}]},{"type":"text","value":" run format-ci"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This command fails if there are changes in the formatting that are not\ncommitted. Run "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"yarn run format"}]},{"type":"text","value":" to format the code and get rid of the\nerror."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"build","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#build","ariaLabel":"build permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Build"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"bash"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"yarn"}]},{"type":"text","value":" run build"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This command ensures that the build passes."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"tests","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#tests","ariaLabel":"tests permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Tests"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"bash"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"yarn"}]},{"type":"text","value":" run test-ci"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This command runs the tests."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"security-audit","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#security-audit","ariaLabel":"security audit permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Security audit"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"bash"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"yarn"}]},{"type":"text","value":" run audit"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This command runs the security audit using "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"yarn audit --json"}]},{"type":"text","value":" and\nchecks returned JSON against vulnerability exceptions defined in\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":".auditrc"}]},{"type":"text","value":" file at the project root. The audit checks for installed\npackages with known vulnerabilities and warns about those."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The scripts outputs information about the dependency path that added the\npackage. If that information is not enough, "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"yarn why package-name"}]},{"type":"text","value":" can\nbe used to get more detailed information about why the package is\ninstalled."}]}],"data":{"quirksMode":false}},"headings":[{"value":"1. Enable CI","depth":2},{"value":"2. Understand how the setup works","depth":2},{"value":"Code formatting","depth":3},{"value":"Build","depth":3},{"value":"Tests","depth":3},{"value":"Security audit","depth":3}]}},"pageContext":{"slug":"how-to-use-ci-with-ftw","category":"ftw-testing-error-handling"}},
    "staticQueryHashes": ["3794076007","439097193","717698143"]}