Skip to content

Commit 398be5a

Browse files
HennaAbbasuser
and
user
authored
docs: update circleci ci-setup.md (conventional-changelog#3989)
* Update cirlcleci ci-setup.md The syntax of the circleci config.yml was out of date. * style: prettier --------- Co-authored-by: user <[email protected]>
1 parent ce8180f commit 398be5a

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed

docs/guides/ci-setup.md

+39-35
Original file line numberDiff line numberDiff line change
@@ -70,52 +70,56 @@ script:
7070
It's just a simple example of how CircleCI configuration file could look like to validate last commit message
7171
7272
```yml
73-
version: 2
74-
defaults:
75-
working_directory: ~/project
76-
docker:
77-
- image: circleci/node:latest
73+
version: 2.1
74+
75+
executors:
76+
my-executor:
77+
docker:
78+
- image: cimg/node:current
79+
working_directory: ~/project
7880

7981
jobs:
8082
setup:
81-
<<: *defaults
83+
executor: my-executor
8284
steps:
83-
- checkout
84-
- restore_cache:
85-
key: lock-{{ checksum "package-lock.json" }}
86-
- run:
87-
name: Install dependencies
88-
command: npm install
89-
- save_cache:
90-
key: lock-{{ checksum "package-lock.json" }}
91-
paths:
92-
- node_modules
93-
- persist_to_workspace:
94-
root: ~/project
95-
paths:
96-
- node_modules
85+
- checkout
86+
- restore_cache:
87+
key: lock-{{ checksum "package-lock.json" }}
88+
- run:
89+
name: Install dependencies
90+
command: npm install
91+
- save_cache:
92+
key: lock-{{ checksum "package-lock.json" }}
93+
paths:
94+
- node_modules
95+
- persist_to_workspace:
96+
root: ~/project
97+
paths:
98+
- node_modules
9799

98100
lint_commit_message:
99-
<<: *defaults
101+
executor: my-executor
100102
steps:
101-
- checkout
102-
- attach_workspace:
103-
at: ~/project
104-
- run:
105-
name: Define environment variable with latest commit's message
106-
command: |
107-
echo 'export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")' >> $BASH_ENV
108-
source $BASH_ENV
109-
- run:
110-
name: Lint commit message
111-
command: echo "$COMMIT_MESSAGE" | npx commitlint
103+
- checkout
104+
- attach_workspace:
105+
at: ~/project
106+
- run:
107+
name: Define environment variable with latest commit's message
108+
command: |
109+
echo 'export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")' >> $BASH_ENV
110+
source $BASH_ENV
111+
- run:
112+
name: Lint commit message
113+
command: echo "$COMMIT_MESSAGE" | npx commitlint
112114

113115
workflows:
114-
version: 2
116+
version: 2.1
115117
commit:
116118
jobs:
117-
- setup
118-
- lint_commit_message: { requires: [setup] }
119+
- setup
120+
- lint_commit_message:
121+
requires:
122+
- setup
119123
```
120124
121125
## GitLab CI

0 commit comments

Comments
 (0)