@lmnto/h-mall-shared 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitbucket-pipelines.yml +47 -209
- package/package.json +1 -1
package/bitbucket-pipelines.yml
CHANGED
|
@@ -1,223 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- linux.shell
|
|
16
|
-
- common.ci
|
|
17
|
-
script:
|
|
18
|
-
- |
|
|
19
|
-
# Copy to common CI server for h-mall-web builds
|
|
20
|
-
# This location is used by h-mall-web Dockerfile during build (COPY h-mall-shared)
|
|
21
|
-
SHARED_LIB_PATH_CI="${HOME}/with-zone/h-mall-shared"
|
|
22
|
-
|
|
23
|
-
# Ensure directory exists
|
|
24
|
-
mkdir -p ${SHARED_LIB_PATH_CI}
|
|
25
|
-
|
|
26
|
-
# Deploy shared library to CI server
|
|
27
|
-
set +e
|
|
28
|
-
rm -rf ${SHARED_LIB_PATH_CI}
|
|
29
|
-
set -e
|
|
30
|
-
mkdir -p ${SHARED_LIB_PATH_CI}
|
|
31
|
-
cp -r ./ ${SHARED_LIB_PATH_CI}/
|
|
32
|
-
rm -rf ${SHARED_LIB_PATH_CI}/node_modules ${SHARED_LIB_PATH_CI}/.git
|
|
33
|
-
rm -f ${SHARED_LIB_PATH_CI}/.env*
|
|
34
|
-
|
|
35
|
-
echo "✓ Shared library copied to CI server: ${SHARED_LIB_PATH_CI}"
|
|
36
|
-
echo " This path is used by h-mall-web Dockerfile during build"
|
|
37
|
-
|
|
38
|
-
- step: &preview_deploy
|
|
39
|
-
name: "CD (Deploy Shared Library to Preview)"
|
|
40
|
-
runs-on:
|
|
41
|
-
- self.hosted
|
|
42
|
-
- linux.shell
|
|
43
|
-
- preview.runner
|
|
44
|
-
script:
|
|
45
|
-
- |
|
|
46
|
-
# Standard deployment location - user-writable directory
|
|
47
|
-
# Note: This path must match docker-compose.yml volume mount in h-mall-web
|
|
48
|
-
SHARED_LIB_PATH="${HOME}/with-zone/h-mall-shared"
|
|
49
|
-
|
|
50
|
-
# Ensure directory exists (user home directory is always writable)
|
|
51
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
52
|
-
|
|
53
|
-
# Deploy shared library
|
|
54
|
-
set +e
|
|
55
|
-
rm -rf ${SHARED_LIB_PATH}
|
|
56
|
-
set -e
|
|
57
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
58
|
-
cp -r ./ ${SHARED_LIB_PATH}/
|
|
59
|
-
rm -rf ${SHARED_LIB_PATH}/node_modules ${SHARED_LIB_PATH}/.git
|
|
60
|
-
rm -f ${SHARED_LIB_PATH}/.env*
|
|
61
|
-
|
|
62
|
-
echo "✓ Shared library deployed to: ${SHARED_LIB_PATH}"
|
|
63
|
-
echo " This path is mounted in h-mall-web docker-compose.yml"
|
|
64
|
-
|
|
65
|
-
- step: &dev_deploy
|
|
66
|
-
name: "CD (Deploy Shared Library to Dev)"
|
|
67
|
-
runs-on:
|
|
68
|
-
- self.hosted
|
|
69
|
-
- linux.shell
|
|
70
|
-
- dev.runner
|
|
71
|
-
script:
|
|
72
|
-
- |
|
|
73
|
-
# Standard deployment location - user-writable directory
|
|
74
|
-
# Note: This path must match docker-compose.yml volume mount in h-mall-web
|
|
75
|
-
SHARED_LIB_PATH="${HOME}/with-zone/h-mall-shared"
|
|
76
|
-
|
|
77
|
-
# Ensure directory exists (user home directory is always writable)
|
|
78
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
79
|
-
|
|
80
|
-
# Deploy shared library
|
|
81
|
-
set +e
|
|
82
|
-
rm -rf ${SHARED_LIB_PATH}
|
|
83
|
-
set -e
|
|
84
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
85
|
-
cp -r ./ ${SHARED_LIB_PATH}/
|
|
86
|
-
rm -rf ${SHARED_LIB_PATH}/node_modules ${SHARED_LIB_PATH}/.git
|
|
87
|
-
rm -f ${SHARED_LIB_PATH}/.env*
|
|
88
|
-
|
|
89
|
-
echo "✓ Shared library deployed to: ${SHARED_LIB_PATH}"
|
|
90
|
-
echo " This path is mounted in h-mall-web docker-compose.yml"
|
|
91
|
-
|
|
92
|
-
- step: &uat_deploy
|
|
93
|
-
name: "CD (Deploy Shared Library to UAT)"
|
|
94
|
-
runs-on:
|
|
95
|
-
- self.hosted
|
|
96
|
-
- linux.shell
|
|
97
|
-
- uat.runner
|
|
98
|
-
script:
|
|
99
|
-
- |
|
|
100
|
-
# Standard deployment location - user-writable directory
|
|
101
|
-
# Note: This path must match docker-compose.yml volume mount in h-mall-web
|
|
102
|
-
SHARED_LIB_PATH="${HOME}/with-zone/h-mall-shared"
|
|
103
|
-
|
|
104
|
-
# Ensure directory exists (user home directory is always writable)
|
|
105
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
106
|
-
|
|
107
|
-
# Deploy shared library
|
|
108
|
-
set +e
|
|
109
|
-
rm -rf ${SHARED_LIB_PATH}
|
|
110
|
-
set -e
|
|
111
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
112
|
-
cp -r ./ ${SHARED_LIB_PATH}/
|
|
113
|
-
rm -rf ${SHARED_LIB_PATH}/node_modules ${SHARED_LIB_PATH}/.git
|
|
114
|
-
rm -f ${SHARED_LIB_PATH}/.env*
|
|
115
|
-
|
|
116
|
-
echo "✓ Shared library deployed to: ${SHARED_LIB_PATH}"
|
|
117
|
-
echo " This path is mounted in h-mall-web docker-compose.yml"
|
|
118
|
-
|
|
119
|
-
- step: &prod_deploy
|
|
120
|
-
name: "CD (Deploy Shared Library to Prod)"
|
|
121
|
-
runs-on:
|
|
122
|
-
- self.hosted
|
|
123
|
-
- linux.shell
|
|
124
|
-
- prod.runner
|
|
125
|
-
script:
|
|
126
|
-
- |
|
|
127
|
-
# Standard deployment location - user-writable directory
|
|
128
|
-
# Note: This path must match docker-compose.yml volume mount in h-mall-web
|
|
129
|
-
SHARED_LIB_PATH="${HOME}/with-zone/h-mall-shared"
|
|
130
|
-
|
|
131
|
-
# Ensure directory exists (user home directory is always writable)
|
|
132
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
133
|
-
|
|
134
|
-
# Deploy shared library
|
|
135
|
-
set +e
|
|
136
|
-
rm -rf ${SHARED_LIB_PATH}
|
|
137
|
-
set -e
|
|
138
|
-
mkdir -p ${SHARED_LIB_PATH}
|
|
139
|
-
cp -r ./ ${SHARED_LIB_PATH}/
|
|
140
|
-
rm -rf ${SHARED_LIB_PATH}/node_modules ${SHARED_LIB_PATH}/.git
|
|
141
|
-
rm -f ${SHARED_LIB_PATH}/.env*
|
|
142
|
-
|
|
143
|
-
echo "✓ Shared library deployed to: ${SHARED_LIB_PATH}"
|
|
144
|
-
echo " This path is mounted in h-mall-web docker-compose.yml"
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# h-mall-shared — Bitbucket Pipelines
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Auth: Repository variables → NPM_TOKEN (secured). Granular token: publish +
|
|
5
|
+
# bypass 2FA for @lmnto.
|
|
6
|
+
#
|
|
7
|
+
# main: each push runs CI automatically; open that pipeline run and press
|
|
8
|
+
# Deploy (or Continue) on the manual "Publish to npm" stage to publish.
|
|
9
|
+
# Optional: Pipelines → Run pipeline → custom "publish-to-npm" (any branch).
|
|
10
|
+
#
|
|
11
|
+
# Previous self-hosted pipeline: bitbucket-pipelines.yml.backup
|
|
12
|
+
# =============================================================================
|
|
13
|
+
|
|
14
|
+
image: node:22
|
|
145
15
|
|
|
146
16
|
definitions:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
17
|
+
steps:
|
|
18
|
+
- step: &ci-install
|
|
19
|
+
name: CI — install dependencies
|
|
20
|
+
caches:
|
|
21
|
+
- node
|
|
22
|
+
script:
|
|
23
|
+
- node -v
|
|
24
|
+
- npm install
|
|
25
|
+
- echo "✓ Dependencies install OK"
|
|
26
|
+
|
|
27
|
+
- step: &publish-npm
|
|
28
|
+
name: Publish @lmnto/h-mall-shared to npm
|
|
29
|
+
caches:
|
|
30
|
+
- node
|
|
31
|
+
script:
|
|
32
|
+
- |
|
|
33
|
+
if [ -z "${NPM_TOKEN}" ]; then
|
|
34
|
+
echo "ERROR: Set secured repository variable NPM_TOKEN (Repository settings → Repository variables)."
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
- echo "registry=https://registry.npmjs.org/" > .npmrc
|
|
38
|
+
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
|
39
|
+
- npm install
|
|
40
|
+
- npm whoami
|
|
41
|
+
- npm publish --access public
|
|
150
42
|
|
|
151
43
|
pipelines:
|
|
152
44
|
default:
|
|
153
|
-
- step: *
|
|
154
|
-
- step: *copy_shared_library
|
|
45
|
+
- step: *ci-install
|
|
155
46
|
|
|
156
47
|
branches:
|
|
157
|
-
feature/*:
|
|
158
|
-
- stage:
|
|
159
|
-
name: CI
|
|
160
|
-
steps:
|
|
161
|
-
- step: *build
|
|
162
|
-
- step: *copy_shared_library
|
|
163
|
-
- stage:
|
|
164
|
-
name: CD
|
|
165
|
-
trigger: manual
|
|
166
|
-
steps:
|
|
167
|
-
- step: *preview_deploy
|
|
168
|
-
|
|
169
|
-
pull-requests:
|
|
170
|
-
- stage:
|
|
171
|
-
name: CI
|
|
172
|
-
steps:
|
|
173
|
-
- step: *build
|
|
174
|
-
- step: *copy_shared_library
|
|
175
|
-
- stage:
|
|
176
|
-
name: CD
|
|
177
|
-
condition:
|
|
178
|
-
or:
|
|
179
|
-
- equals:
|
|
180
|
-
- ${BITBUCKET_PR_DESTINATION_BRANCH}
|
|
181
|
-
- dev
|
|
182
|
-
- equals:
|
|
183
|
-
- ${BITBUCKET_PR_DESTINATION_BRANCH}
|
|
184
|
-
- develop
|
|
185
|
-
|
|
186
|
-
steps:
|
|
187
|
-
- step: *preview_deploy
|
|
188
|
-
|
|
189
|
-
develop:
|
|
190
|
-
- stage:
|
|
191
|
-
name: CI
|
|
192
|
-
steps:
|
|
193
|
-
- step: *build
|
|
194
|
-
- step: *copy_shared_library
|
|
195
|
-
- stage:
|
|
196
|
-
name: CD
|
|
197
|
-
trigger: manual
|
|
198
|
-
steps:
|
|
199
|
-
- step: *dev_deploy
|
|
200
|
-
|
|
201
|
-
release/*:
|
|
202
|
-
- stage:
|
|
203
|
-
name: CI
|
|
204
|
-
steps:
|
|
205
|
-
- step: *build
|
|
206
|
-
- step: *copy_shared_library
|
|
207
|
-
- stage:
|
|
208
|
-
name: CD
|
|
209
|
-
trigger: manual
|
|
210
|
-
steps:
|
|
211
|
-
- step: *uat_deploy
|
|
212
|
-
|
|
213
48
|
main:
|
|
214
49
|
- stage:
|
|
215
50
|
name: CI
|
|
216
51
|
steps:
|
|
217
|
-
- step: *
|
|
218
|
-
- step: *copy_shared_library
|
|
52
|
+
- step: *ci-install
|
|
219
53
|
- stage:
|
|
220
|
-
name:
|
|
54
|
+
name: Publish to npm
|
|
221
55
|
trigger: manual
|
|
222
56
|
steps:
|
|
223
|
-
- step: *
|
|
57
|
+
- step: *publish-npm
|
|
58
|
+
|
|
59
|
+
custom:
|
|
60
|
+
publish-to-npm:
|
|
61
|
+
- step: *publish-npm
|