-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
91 lines (65 loc) · 2.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
DOCKER_REGISTRY_URL ?= ncu-product-platforms
DOCKER_REPO ?= design-system-site
DOCKER_TAG ?= latest
CIRCLE_SHA1 ?= 0000000000
SHORT_GIT_HASH := $(shell echo ${CIRCLE_SHA1} | cut -c -9)
# CURRENT BRANCH CHECKED OUT
CURRENT_BRANCH = $(shell git symbolic-ref --short -q HEAD)
# Cleans branch into a url friendly format
BASE_PATH = $(shell node -p "/(^main$$)/.test('${CURRENT_BRANCH}') ? '' : require('./scripts/branch-name-to-url.js').branchNameToUrl('${CURRENT_BRANCH}')")
BASE_URI = ${SITE_BASE_URL}${BASE_PATH}/
install:
yarn install --frozen-lockfile
# When changing the version, make sure it matches the one used in the `test_newskit_in_nextjs_app` CircleCI's job.
install_cypress:
yarn add -D [email protected];
build_icons:
yarn build:icons
build_components:
yarn build:comps
build_storybook:
yarn build:storybook
build_docs:
SITE_ENV=${SITE_ENV} BASE_URI=${BASE_URI} BASE_PATH=${BASE_PATH} yarn build:docs && yarn postbuild:docs
build_docs_with_no_base_url:
SITE_ENV=${SITE_ENV} yarn build:docs && yarn postbuild:docs
lint:
yarn lint
check_broken_links_docs:
yarn e2e:findbrokenlinks:ci
comps_visual_test:
yarn test:visual:comps:ci
comps_visual_test_percy:
yarn test:visual:comps:ci:percy
skip_comps_visual_test_percy:
yarn test:visual:comps:ci:percy:skip
e2e_visual_test_docs:
yarn e2e:visual:docs:ci;
e2e_visual_test_docs_percy:
yarn e2e:visual:docs:ci:percy;
skip_e2e_visual_test_docs_percy:
yarn e2e:visual:docs:ci:percy:skip;
publish_npm_dev:
cd dist; yarn publish --no-git-tag-version --new-version 0.0.0-${SHORT_GIT_HASH} --tag unstable;
publish_npm:
cd dist; yarn publish --no-git-tag-version;
build_docker:
docker build -t ncu-newskit .
push_docker:
docker tag ncu-newskit:latest $(DOCKER_REGISTRY_URL)/$(DOCKER_REPO):$(DOCKER_TAG)
docker push $(DOCKER_REGISTRY_URL)/$(DOCKER_REPO):$(DOCKER_TAG)
set_git_identity:
git config --global user.email "[email protected]"
git config --global user.name "Product Platforms Service"
bump_version:
git checkout main
git pull
yarn config set version-git-message "Bumping to version v%s - [skip ci]"
echo "Updating package.json and creating a tag for `${NEW_VERSION}`"
yarn version --new-version ${NEW_VERSION}
git push
git push origin v${NEW_VERSION}
# The tag deleted should match the expected tag in the `only_on_trigger_release_tag` filter.
delete_trigger_release_tag:
git checkout main
git push origin --delete trigger-release@${VERSION}