Skip to content

Commit a057ce5

Browse files
Create .gitlab-ci.yml
1 parent d959e9a commit a057ce5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.gitlab-ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
optic-default-branch-push:
2+
image: node:latest
3+
rules:
4+
- if: $CI_PIPELINE_SOURCE == "push" && OPTIC_TOKEN && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
5+
script:
6+
- npm install -g @useoptic/optic
7+
- optic run
8+
9+
optic-merge-request:
10+
image: node:latest
11+
rules:
12+
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $OPTIC_TOKEN
13+
script:
14+
- npm install -g @useoptic/optic
15+
- export OPTIC_RESULT=0; optic run || export OPTIC_RESULT=$?
16+
- if [ $OPTIC_RESULT -ne 0 ]; then exit 1; fi;

0 commit comments

Comments
 (0)