CA-Bakery

ca-bakery is a tool based on cake build which enables you to define your CI/CD pipeline in a recipe.yml file which is implemented using a custom DSL (Domain Specific Language).

Note

The custom DSL is used to define:

  • Components: projects part of the CI pipeline
  • Environment: environment variables used by the CI pipeline
  • Bundlers: a bundler is a collection of steps to be executed in order to create a bundle
  • Artifacts: an artifact is a deployable component and it is built using one or more bundlers

ca-bakery can be used to bundle multiple projects in one single deployable artifact. A common use case would be a web application composed by a NetCore backend project and an Angular client project that need to be bundled into a single deployable artifact where the NetCore app serves to the client the Angular app.

Components to be part of the build process must be defined in the recipe.yml file, as well as this they must implement a build script compliant to ca-bakery.

The ca-bakery pipeline is implemented in a script which can be executed both on the local dev machine and the integration server. This approach makes applications using ca-bakery reproducible anywhere.

recipe.yml:

#---------------------------------#
#      general configuration      #
#---------------------------------#
# ca-bakery build version
version: 1
# name
name: angular-node-electron-seed
# environment variables
environment:
  CA_BAKERY_BUILD_NUMBER: 001
#---------------------------------#
#      build configuration        #
#---------------------------------#
build:
  dist: dist
  release_notes: RELEASE_NOTES.md
#---------------------------------#
#    components configuration     #
#---------------------------------#
components:
  - name: server-component
    path: server
    build:
      type: npm
      dist: dist
  - name: client-component
    path: client
    build:
      type: npm
      dist: dist
#---------------------------------#
#     bundlers configuration      #
#---------------------------------#
bundlers:
  - name: webapp-bundler
    imports:
    steps:
      - operation: copy
        from:
          component: server-component
          context: component
          path: node_modules
        to:
          path: node_modules
      - operation: copy
        from:
          component: server-component
          context: dist
          path:
        to:
          path:
      - operation: copy
        from:
          component: client-component
          context: dist
          path:
          extensions: "*.js*"
        to:
          path: public/js
  - name: electron-bundler
    imports:
    steps:
#---------------------------------#
#     artifacts configuration     #
#---------------------------------#
artifacts:
  - name: app-nodejs
    path: app-nodejs
    bundle:
      name: webapp-bundler
      enable_compression: true
  - name: app-electron
    path: app-electron
    bundle:
      name: electron-bundler
      enable_compression: true
Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY