Skip to content

Commit 421f006

Browse files
committed
chore: added ci settings for authenticated pulls to docker-hub (#UIM-513)
1 parent 89d4b1e commit 421f006

File tree

1 file changed

+63
-56
lines changed

1 file changed

+63
-56
lines changed

.circleci/config.yml

Lines changed: 63 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,72 @@
11
anchor_job_defaults: &job_defaults
2-
working_directory: ~/tslint-config
3-
docker:
4-
- image: ptsecurity/node-container:0.1.0
2+
working_directory: ~/tslint-config
3+
docker:
4+
- image: circleci/node:12.19.0
5+
auth:
6+
username: $DOCKER_HUB_USERNAME
7+
password: $DOCKER_HUB_PASSWORD
58

69
anchor_post_checkout: &post_checkout
7-
post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
10+
post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
811

912
version: 2
1013
jobs:
11-
build:
12-
<<: *job_defaults
13-
steps:
14-
- checkout:
15-
<<: *post_checkout
16-
- restore_cache:
17-
key: tslint-cache-{{ checksum "package.json" }}
18-
- run:
19-
name: System information
20-
command: |
21-
echo "Node.js $(node -v)"
22-
echo "npm $(npm -v)"
23-
echo "Yarn v$(yarn --version)"
24-
- run:
25-
name: Install npm packages
26-
command: npm install
27-
- save_cache:
28-
key: tslint-cache-{{ checksum "package.json" }}
29-
paths:
30-
- "node_modules"
31-
- run:
32-
name: Run build
33-
command: npm run build:tslint
34-
- run:
35-
name: Test
36-
command: npm run test:rules
37-
- persist_to_workspace:
38-
root: .
39-
paths: .
14+
build:
15+
<<: *job_defaults
16+
steps:
17+
- checkout:
18+
<<: *post_checkout
19+
- restore_cache:
20+
key: tslint-cache-{{ checksum "package.json" }}
21+
- run:
22+
name: System information
23+
command: |
24+
echo "Node.js $(node -v)"
25+
echo "npm $(npm -v)"
26+
echo "Yarn v$(yarn --version)"
27+
- run:
28+
name: Install npm packages
29+
command: npm install
30+
- save_cache:
31+
key: tslint-cache-{{ checksum "package.json" }}
32+
paths:
33+
- "node_modules"
34+
- run:
35+
name: Run build
36+
command: npm run build:tslint
37+
- run:
38+
name: Test
39+
command: npm run test:rules
40+
- persist_to_workspace:
41+
root: .
42+
paths: .
4043

41-
publish:
42-
<<: *job_defaults
43-
steps:
44-
- attach_workspace:
45-
at: ./
46-
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
47-
- run: npm publish ./dist/@ptsecurity/tslint-config --access public
48-
- run: ./scripts/trigger_notify.sh
44+
publish:
45+
<<: *job_defaults
46+
steps:
47+
- attach_workspace:
48+
at: ./
49+
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
50+
- run: npm publish ./dist/@ptsecurity/tslint-config --access public
51+
- run: ./scripts/trigger_notify.sh
4952

5053
workflows:
51-
version: 2
52-
default_workflow:
53-
jobs:
54-
- build:
55-
filters:
56-
tags:
57-
only: /.*/
58-
- publish:
59-
requires:
60-
- build
61-
filters:
62-
branches:
63-
ignore: /.*/
64-
tags:
65-
only: /^\d+\.\d+\.\d+$/
54+
version: 2
55+
default_workflow:
56+
jobs:
57+
- build:
58+
context:
59+
- docker-hub
60+
filters:
61+
tags:
62+
only: /.*/
63+
- publish:
64+
context:
65+
- docker-hub
66+
requires:
67+
- build
68+
filters:
69+
branches:
70+
ignore: /.*/
71+
tags:
72+
only: /^\d+\.\d+\.\d+$/

0 commit comments

Comments
 (0)