0.0.22 • Published 6 years ago

sr-ci v0.0.22

Weekly downloads
85
License
-
Repository
-
Last release
6 years ago

sr-ci by stage pipe line tool

install

yarn add sr-ci
# or
npm install sr-ci

use by just 'sr-ci run' command it will find sr.ci.json in your project folder

sr-ci run

init a sr.ci.json

sr-ci init

sr.ci.json file content example

{
  // project name (required) used by cache folder
  "name": "crm",
  // cache folder should add {branch} or not
  "withBranch":true,
  // choose you ci flow id(required)
  "flow": "fe",
  // define variables then you can use {{ var }} in scripts
  "variables": {
    "1": "web",
    "2": "club"
  },
  "caches": [
    "frontend/packages/pc/dist",
    "frontend/packages/mobile/dist"
  ],
  // at least one
  "flows": [
    {
      "id": "fe",
      "stages": [
        "ci-cache-take",
        "build",
        "ci-cache-backup",
        "clean-modules"
      ],
      // `fe`flow self caches here,it will extends the global caches
      // so `fe` caches are
      /** "frontend/packages/pc/dist",
        *  "frontend/packages/mobile/dist"
        *   "frontend/node_modules",
        *   "frontend/packages/pc/node_modules",
        *  "frontend/packages/mobile/node_modules",
        *  "frontend/packages/common/node_modules"
        **/
      "caches":[
        "frontend/node_modules",
        "frontend/packages/pc/node_modules",
        "frontend/packages/mobile/node_modules",
        "frontend/packages/common/node_modules"
      ]
    },
    {
      "id": "be",
      "stages": [
        "ci-cache-take",
        "clean-modules"
      ]
    }
  ],
  "stages": [
    {
      // stage id
      "id": "build",
       // pre-scripts hook
      "pre-scripts": [
        "cd frontend && yarn",
        "cd frontend && npm run install"
      ],
      "scripts": [
        "cd frontend && npm run build"
      ],
      // post-scripts hook notice the {{1}} here mean 'web'
      "post-scripts": ["echo {{1}}"]
    },
    {
      "id": "clean-modules",
      "scripts": [
        "cd frontend && npm run clean",
        "cd frontend && rm -rf node_modules"
      ]
    }
  ]
}

clear cache

# in project folder
sr-ci clear

beauty sr.ci.json to standard format,useful by git merge problem

sr-ci format

default inner ci stage you can just use

  • ci-cache-take take cache from sr-ci cache folder
  • ci-cache-backup put cache to sr-ci cache folder
  • ci-cache-clear clear current projects's cache
0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago