@leverege/build-tools 2.40.0-john.1 → 2.40.1
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/package.json +4 -3
- package/src/Utils.mjs +6 -2
- package/src/bash-funcs +10 -8
- package/src/dirty-git.sh +4 -2
- package/src/helm-charts/prometheus/helmup.plugin +5 -1
- package/src/helm-charts/prometheus/values-local.yaml +4 -0
- package/src/helm-charts/redis/helmup.plugin +1 -1
- package/src/helm-charts/traefik/helmup.plugin +1 -1
- package/src/helmdn.sh +1 -1
- package/src/helmup.sh +4 -3
- package/src/k8scale.sh +1 -1
- package/src/refresh-npm-token.mjs +1 -1
- package/src/send-to-slack.mjs +124 -0
- package/src/circle-lib.yml +0 -150
- package/src/circle-srv.yml +0 -213
- package/src/helm-charts/geotile-server/.nohelm +0 -0
- package/src/helm-charts/geotile-server/gitignore +0 -1
- package/src/helm-charts/geotile-server/helmup.plugin +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.40.
|
|
3
|
+
"version": "2.40.1",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"pull-git": "src/pull-git.sh",
|
|
44
44
|
"push-my-chart": "src/push-my-chart.mjs",
|
|
45
45
|
"refresh-npm-token": "src/refresh-npm-token.mjs",
|
|
46
|
+
"send-to-slack": "src/send-to-slack.mjs",
|
|
46
47
|
"tag-release": "src/tag-release.mjs",
|
|
47
48
|
"unleash": "src/unleash.mjs"
|
|
48
49
|
},
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"deepmerge": "^4.3.1",
|
|
57
58
|
"enquirer": "^2.4.1",
|
|
58
59
|
"execa": "^8.0.1",
|
|
59
|
-
"glob": "^10.3.
|
|
60
|
+
"glob": "^10.3.10",
|
|
60
61
|
"js-yaml": "^4.1.0",
|
|
61
62
|
"ms": "^2.1.3",
|
|
62
63
|
"npm-registry-fetch": "^16.0.0",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"read-pkg": "^8.1.0",
|
|
65
66
|
"readline-sync": "^1.4.10",
|
|
66
67
|
"semver": "^7.5.4",
|
|
67
|
-
"simple-git": "^3.
|
|
68
|
+
"simple-git": "^3.20.0",
|
|
68
69
|
"zx": "^7.2.3"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
package/src/Utils.mjs
CHANGED
|
@@ -6,12 +6,16 @@ const debugEnabled = process.env.BUILD_TOOLS_DEBUG === '1'
|
|
|
6
6
|
/* eslint-disable no-console */
|
|
7
7
|
export const err = console.error
|
|
8
8
|
export const log = console.log
|
|
9
|
-
/* eslint-enable no-console */
|
|
10
9
|
export const debug = ( obj, text ) => {
|
|
11
10
|
if ( debugEnabled ) {
|
|
12
|
-
|
|
11
|
+
console.dir( {
|
|
12
|
+
obj,
|
|
13
|
+
text : `${chalk.yellow( '***DEBUG:' )} ${chalk.green( text )}`,
|
|
14
|
+
},
|
|
15
|
+
{ depth : 8, colors : true }, )
|
|
13
16
|
}
|
|
14
17
|
}
|
|
18
|
+
/* eslint-enable no-console */
|
|
15
19
|
|
|
16
20
|
export const shellCmd = async ( cmdstr, opts = {} ) => {
|
|
17
21
|
try {
|
package/src/bash-funcs
CHANGED
|
@@ -139,16 +139,18 @@ function removeHelmRepo(){
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
# initial use for logging helm activities
|
|
142
|
-
function
|
|
142
|
+
function sendToSlack() {
|
|
143
143
|
local toPost="$@"
|
|
144
144
|
local running="`basename $0`"
|
|
145
145
|
local dts="`date +\"%c\"`"
|
|
146
|
-
local slackURL="https://hooks.slack.com/services/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"
|
|
147
|
-
local channel="#dev-ops-helm"
|
|
148
146
|
local account="`gcloud config get account`"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
read -rd '' slackmsg<<EOSLACK
|
|
148
|
+
--- $running by \`$account\` in \`$GCP_PROJECT_ID\` @ $dts
|
|
149
|
+
\`$toPost\`
|
|
150
|
+
node `node --version` / `build-tools --version` / helm `helm version --short`
|
|
151
|
+
EOSLACK
|
|
152
|
+
send-to-slack --project leverege-registry \
|
|
153
|
+
--config REFRESH_NPM_SLACK_CONFIG \
|
|
154
|
+
--message "\"$slackmsg\""
|
|
155
|
+
# the "\"$var\"" escaped " is necessary for proper message encapsulation
|
|
154
156
|
}
|
package/src/dirty-git.sh
CHANGED
|
@@ -4,9 +4,10 @@ CLEAN="\e[32m✔\e[0m"
|
|
|
4
4
|
DIRTY="\e[31m✘\e[0m"
|
|
5
5
|
STASH="\e[33;44m$\e[0m"
|
|
6
6
|
AHEAD="\e[34;42m!\e[0m"
|
|
7
|
+
LOCKD="\e[35m\e[0m"
|
|
7
8
|
|
|
8
9
|
clear
|
|
9
|
-
printf "${CLEAN} clean ${DIRTY} dirty ${STASH} stashed ${AHEAD} unpushed\n\n"
|
|
10
|
+
printf "${CLEAN} clean ${DIRTY} dirty ${STASH} stashed ${AHEAD} unpushed ${LOCKD} locked\n\n"
|
|
10
11
|
for dir in $@;
|
|
11
12
|
do
|
|
12
13
|
[ ! -d $dir ] || [ ! -d $dir/.git ] && continue
|
|
@@ -17,6 +18,7 @@ do
|
|
|
17
18
|
[ $scount -gt 0 ] && stash="\e[33;44m$\e[0m" || stash=" "
|
|
18
19
|
ahead=`git rev-list FETCH_HEAD..HEAD --count`
|
|
19
20
|
[ $ahead -gt 0 ] && ahead="$AHEAD" || ahead=" "
|
|
21
|
+
[ -f "Versions.json" ] && locked="$LOCKD" || locked=" "
|
|
20
22
|
cd - &>/dev/null
|
|
21
|
-
printf "${status} %-28s ${stash}${ahead} %s\n" $dir $branch
|
|
23
|
+
printf "${status} %-28s ${stash}${ahead}${locked} %s\n" $dir $branch
|
|
22
24
|
done
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
#
|
|
3
3
|
showInstalling "Prometheus"
|
|
4
4
|
|
|
5
|
+
# the following two lines may be removed after reaching prom chart 25
|
|
6
|
+
kubectl delete deploy -n monitoring -l app=prometheus,component=server &> $DEVNULL
|
|
7
|
+
kubectl delete deploy -n monitoring -l app.kubernetes.io/name=prometheus &> $DEVNULL
|
|
8
|
+
|
|
5
9
|
addHelmRepo prometheus-community https://prometheus-community.github.io/helm-charts
|
|
6
10
|
|
|
7
|
-
[ -z "$PROMETHEUS_CHART_VERSION" ] && PROMETHEUS_CHART_VERSION="
|
|
11
|
+
[ -z "$PROMETHEUS_CHART_VERSION" ] && PROMETHEUS_CHART_VERSION="17"
|
|
8
12
|
helm upgrade --install prometheus prometheus-community/prometheus \
|
|
9
13
|
--namespace monitoring --create-namespace \
|
|
10
14
|
--values prometheus/values.yaml \
|
|
@@ -30,6 +30,10 @@ server:
|
|
|
30
30
|
pushgateway:
|
|
31
31
|
enabled: false
|
|
32
32
|
|
|
33
|
+
# name change with chart 19+
|
|
34
|
+
prometheus-pushgateway:
|
|
35
|
+
enabled: false
|
|
36
|
+
|
|
33
37
|
# temp set to false if upgrade errors with something like:
|
|
34
38
|
# Error: UPGRADE FAILED: cannot patch "prometheus-kube-state-metrics" ... field is immutable
|
|
35
39
|
#
|
|
@@ -4,7 +4,7 @@ showInstalling "Redis"
|
|
|
4
4
|
|
|
5
5
|
addBitnamiRepo latest
|
|
6
6
|
|
|
7
|
-
[ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="
|
|
7
|
+
[ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="18"
|
|
8
8
|
helm upgrade --install redis bitnami/redis \
|
|
9
9
|
--values redis/redis-local.yaml \
|
|
10
10
|
--version $REDIS_CHART_VERSION $HELM_WHAT
|
|
@@ -6,7 +6,7 @@ TRAEFIK_NAMESPACE="traefik"
|
|
|
6
6
|
|
|
7
7
|
addHelmRepo traefik https://helm.traefik.io/traefik
|
|
8
8
|
|
|
9
|
-
[ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="
|
|
9
|
+
[ -z "$TRAEFIK_CHART_VERSION" ] && TRAEFIK_CHART_VERSION="24"
|
|
10
10
|
helm upgrade --install traefik traefik/traefik \
|
|
11
11
|
--namespace $TRAEFIK_NAMESPACE --create-namespace \
|
|
12
12
|
--values traefik/traefik-local.yaml \
|
package/src/helmdn.sh
CHANGED
package/src/helmup.sh
CHANGED
|
@@ -30,7 +30,7 @@ PLATFORM=(
|
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
SYSTEM=(
|
|
33
|
-
|
|
33
|
+
elasticsearch8
|
|
34
34
|
redis
|
|
35
35
|
postgres
|
|
36
36
|
timescale-db
|
|
@@ -172,7 +172,7 @@ INSTALLDEFAULTCONFIGS
|
|
|
172
172
|
|
|
173
173
|
printf "\nRunning => `color y \"$kubecmd\"`\n\n"
|
|
174
174
|
eval $kubecmd
|
|
175
|
-
|
|
175
|
+
sendToSlack "$kubecmd"
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
function errorIfMissingSecret() {
|
|
@@ -548,6 +548,7 @@ PLUGIN_NOEXEC
|
|
|
548
548
|
printf "\n***Executing local plugin code => `color y $PLUGIN`\n\n" && sleep 2
|
|
549
549
|
export HELM_WHAT
|
|
550
550
|
. $PLUGIN # executing with . allows the plugin to use functions like color
|
|
551
|
+
sendToSlack "$PLUGIN"
|
|
551
552
|
return 0
|
|
552
553
|
}
|
|
553
554
|
|
|
@@ -595,7 +596,7 @@ doHelmup() {
|
|
|
595
596
|
[ ! -z "$FROM_VERSIONS" ] && from="`color y \"<= from Versions.json\"`"
|
|
596
597
|
printf "$doing $from\n"
|
|
597
598
|
eval $helmup
|
|
598
|
-
|
|
599
|
+
sendToSlack "$helmup"
|
|
599
600
|
}
|
|
600
601
|
|
|
601
602
|
# not a fan of global vars but bash forced me to - set by getServiceAndChartVersion
|
package/src/k8scale.sh
CHANGED
|
@@ -31,6 +31,6 @@ do
|
|
|
31
31
|
kubectl scale --replicas=$REPLICAS deployment $SERVICE &>/dev/null
|
|
32
32
|
[ $? -eq 1 ] && RESULTS="`color r FAILURE`"
|
|
33
33
|
printf " $RESULTS => $SERVICE\n"
|
|
34
|
-
|
|
34
|
+
sendToSlack "k8scale $DIRECTION $SERVICE"
|
|
35
35
|
done
|
|
36
36
|
printf "\n\n"
|
|
@@ -261,7 +261,7 @@ if ( process.env.BUILD_TOOLS_DEBUG || args.dryRun ) {
|
|
|
261
261
|
'Content-Type' : 'application/json',
|
|
262
262
|
},
|
|
263
263
|
} )
|
|
264
|
-
|
|
264
|
+
debug( { fetchStatus }, '<==Fetch returned' )
|
|
265
265
|
} catch ( fetchError ) {
|
|
266
266
|
log( { fetchError }, chalk.red( '\n\n***ERROR: fetch call failed\n' ) )
|
|
267
267
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* send-to-slack...
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import chalk from 'chalk'
|
|
8
|
+
import commandLineArgs from 'command-line-args'
|
|
9
|
+
import commandLineUsage from 'command-line-usage'
|
|
10
|
+
import { lt as semverLt } from 'semver'
|
|
11
|
+
|
|
12
|
+
import { debug, log, shellCmd } from './Utils.mjs'
|
|
13
|
+
|
|
14
|
+
const slackSendOptions = [ // Use slackSendOptions to tie into the Usage statements
|
|
15
|
+
{
|
|
16
|
+
name : 'project',
|
|
17
|
+
type : String,
|
|
18
|
+
default : false,
|
|
19
|
+
description : '{green the name of the google project containing the slack config secret}',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name : 'config',
|
|
23
|
+
type : String,
|
|
24
|
+
default : false,
|
|
25
|
+
description : '{green the name of the JSON secret containing the slack URL and channel}',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name : 'message',
|
|
29
|
+
type : String,
|
|
30
|
+
default : false,
|
|
31
|
+
description : '{green the message to send to slack}',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name : 'dry-run',
|
|
35
|
+
type : Boolean,
|
|
36
|
+
default : false,
|
|
37
|
+
description : '{green do everything without actually sending to slack}',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name : 'help',
|
|
41
|
+
type : Boolean,
|
|
42
|
+
default : false,
|
|
43
|
+
description : '{green display this help screen}',
|
|
44
|
+
},
|
|
45
|
+
/* eslint-enable max-len */
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
const sections = [
|
|
49
|
+
{
|
|
50
|
+
header : 'Leverege Slack Sender',
|
|
51
|
+
content : '{green This tool helps you to send slack}'
|
|
52
|
+
},
|
|
53
|
+
{ header : 'Options',
|
|
54
|
+
optionList : slackSendOptions,
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
const args = commandLineArgs( slackSendOptions, { camelCase : true, partial : true } )
|
|
59
|
+
const usage = commandLineUsage( sections )
|
|
60
|
+
|
|
61
|
+
if ( args.help ) {
|
|
62
|
+
log( usage )
|
|
63
|
+
process.exit( 0 )
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* eslint-disable no-underscore-dangle */
|
|
67
|
+
if ( args._unknown ) {
|
|
68
|
+
log( usage )
|
|
69
|
+
log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
|
|
70
|
+
process.exit( 1 )
|
|
71
|
+
}
|
|
72
|
+
/* eslint-enable no-underscore-dangle */
|
|
73
|
+
|
|
74
|
+
if ( semverLt( process.version, '18.0.0' ) ) {
|
|
75
|
+
log( chalk.red( '\n\n***ERROR: must be running at least node 18\n' ) )
|
|
76
|
+
process.exit( 1 )
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const gcpProject = args.project
|
|
80
|
+
|
|
81
|
+
const getGcpSecretCommand = ( secretName ) => {
|
|
82
|
+
return `gcloud secrets versions access latest --project=${gcpProject} --secret=${secretName}`
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// fetch and parse the slack config for audits
|
|
86
|
+
const slackSecretName = args.config
|
|
87
|
+
let slackConfig
|
|
88
|
+
try {
|
|
89
|
+
const slackConfigFetcher = getGcpSecretCommand( slackSecretName )
|
|
90
|
+
const slackSecret = await shellCmd( slackConfigFetcher )
|
|
91
|
+
slackConfig = JSON.parse( slackSecret )
|
|
92
|
+
debug( { slackSecretName, slackConfig, slackConfigFetcher }, `<==shellCmd Output ${slackSecretName}` )
|
|
93
|
+
} catch ( err ) {
|
|
94
|
+
if ( err.escapedCommand && err.stderr ) {
|
|
95
|
+
log( chalk.yellow( `\nFailed Fetching Slack Secret => [${err.escapedCommand}]\n\n` ), chalk.red( err.stderr ) )
|
|
96
|
+
} else {
|
|
97
|
+
log( err, chalk.red( `\n\nFailed to fetch and / or parse secret ${slackSecretName} from ${gcpProject}` ) )
|
|
98
|
+
}
|
|
99
|
+
process.exit( 1 )
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// slack out the details to the configured channel
|
|
103
|
+
const account = await shellCmd( 'gcloud config get account' )
|
|
104
|
+
const slackData = {
|
|
105
|
+
text : args.message.replace(/^\"|\"$/g,''), // strip pesky leading/trailing "
|
|
106
|
+
channel : slackConfig.channel,
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if ( process.env.BUILD_TOOLS_DEBUG || args.dryRun ) {
|
|
110
|
+
log( { slackConfig, slackData }, '<==Slack skipped' )
|
|
111
|
+
} else {
|
|
112
|
+
try {
|
|
113
|
+
const fetchStatus = await fetch( slackConfig.url, {
|
|
114
|
+
method : 'POST',
|
|
115
|
+
body : JSON.stringify( slackData ),
|
|
116
|
+
headers : {
|
|
117
|
+
'Content-Type' : 'application/json',
|
|
118
|
+
},
|
|
119
|
+
} )
|
|
120
|
+
debug( { fetchStatus }, '<==Fetch returned' )
|
|
121
|
+
} catch ( fetchError ) {
|
|
122
|
+
log( { fetchError }, chalk.red( '\n\n***ERROR: fetch call failed\n' ) )
|
|
123
|
+
}
|
|
124
|
+
}
|
package/src/circle-lib.yml
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
jobs:
|
|
3
|
-
install:
|
|
4
|
-
docker:
|
|
5
|
-
- image: $CIRCLE_NODE_IMG
|
|
6
|
-
steps:
|
|
7
|
-
- checkout
|
|
8
|
-
- restore_cache:
|
|
9
|
-
keys:
|
|
10
|
-
- v1-npm-deps-{{ checksum "package-lock.json" }}
|
|
11
|
-
- v1-npm-deps-
|
|
12
|
-
|
|
13
|
-
- run:
|
|
14
|
-
name: Setup @leverege Token
|
|
15
|
-
command: echo \${NPMRC} > ~/.npmrc
|
|
16
|
-
|
|
17
|
-
- run: npm install
|
|
18
|
-
|
|
19
|
-
- save_cache:
|
|
20
|
-
key: v1-npm-deps-{{ checksum "package-lock.json" }}
|
|
21
|
-
paths:
|
|
22
|
-
- ./node_modules
|
|
23
|
-
|
|
24
|
-
- persist_to_workspace:
|
|
25
|
-
root: /home/circleci/project
|
|
26
|
-
paths:
|
|
27
|
-
- ./node_modules
|
|
28
|
-
|
|
29
|
-
security-check:
|
|
30
|
-
docker:
|
|
31
|
-
- image: $CIRCLE_NODE_IMG
|
|
32
|
-
steps:
|
|
33
|
-
- checkout
|
|
34
|
-
- attach_workspace:
|
|
35
|
-
at: ~/project
|
|
36
|
-
- run:
|
|
37
|
-
name: Check for vulnerabilities
|
|
38
|
-
command: npm audit --production --audit-level=moderate
|
|
39
|
-
|
|
40
|
-
license-check:
|
|
41
|
-
docker:
|
|
42
|
-
- image: $CIRCLE_NODE_IMG
|
|
43
|
-
steps:
|
|
44
|
-
- checkout
|
|
45
|
-
- attach_workspace:
|
|
46
|
-
at: ~/project
|
|
47
|
-
- run:
|
|
48
|
-
name: Check for LICENSE and README files
|
|
49
|
-
command: npm run pkglint
|
|
50
|
-
|
|
51
|
-
- run:
|
|
52
|
-
name: Check for license violations (e.g. GPL)
|
|
53
|
-
command: npx license-checker --production --summary --failOn GPL
|
|
54
|
-
|
|
55
|
-
lint:
|
|
56
|
-
docker:
|
|
57
|
-
- image: $CIRCLE_NODE_IMG
|
|
58
|
-
steps:
|
|
59
|
-
- checkout
|
|
60
|
-
- attach_workspace:
|
|
61
|
-
at: ~/project
|
|
62
|
-
- run:
|
|
63
|
-
name: Lint and save results
|
|
64
|
-
command: npm run lint-ci
|
|
65
|
-
|
|
66
|
-
- store_test_results:
|
|
67
|
-
path: reports
|
|
68
|
-
|
|
69
|
-
docs:
|
|
70
|
-
docker:
|
|
71
|
-
- image: $CIRCLE_NODE_IMG
|
|
72
|
-
steps:
|
|
73
|
-
- checkout
|
|
74
|
-
- attach_workspace:
|
|
75
|
-
at: ~/project
|
|
76
|
-
- run:
|
|
77
|
-
name: Generate docs
|
|
78
|
-
command: npx jsdoc -r src -R README.md -d docs
|
|
79
|
-
- store_artifacts:
|
|
80
|
-
path: docs
|
|
81
|
-
prefix: docs
|
|
82
|
-
|
|
83
|
-
coverage:
|
|
84
|
-
# coverage runs tests, generates coverage, and saves docs
|
|
85
|
-
environment:
|
|
86
|
-
TZ: 'America/New_York'
|
|
87
|
-
docker:
|
|
88
|
-
- image: $CIRCLE_NODE_IMG
|
|
89
|
-
# IF YOU NEED ANY OF THESE, UNCOMMENT TO USE
|
|
90
|
-
# - image: redis
|
|
91
|
-
# - image: circleci/mysql:5.7
|
|
92
|
-
# environment:
|
|
93
|
-
# MYSQL_USER: root
|
|
94
|
-
# MYSQL_ROOT_PASSWORD: root
|
|
95
|
-
# MYSQL_ALLOW_EMPTY_PASSWORD: true
|
|
96
|
-
# MYSQL_HOST: 127.0.0.1
|
|
97
|
-
# - image: nsqio/nsq
|
|
98
|
-
# command: /nsqlookupd -broadcast-address localhost:4160 -tcp-address 0.0.0.0:4160 -http-address 0.0.0.0:4161
|
|
99
|
-
|
|
100
|
-
# - image: nsqio/nsq
|
|
101
|
-
# command: >
|
|
102
|
-
# /nsqd
|
|
103
|
-
# -broadcast-address localhost:4150
|
|
104
|
-
# -tcp-address 0.0.0.0:4150
|
|
105
|
-
# -http-address 0.0.0.0:4151
|
|
106
|
-
# -lookupd-tcp-address localhost:4160
|
|
107
|
-
|
|
108
|
-
steps:
|
|
109
|
-
- checkout
|
|
110
|
-
- attach_workspace:
|
|
111
|
-
at: ~/project
|
|
112
|
-
|
|
113
|
-
# UNCOMMENT IF YOU NEED DECRYPTING SECRETS
|
|
114
|
-
# - run:
|
|
115
|
-
# name: Load secrets
|
|
116
|
-
# command: npm run decrypt
|
|
117
|
-
|
|
118
|
-
- run:
|
|
119
|
-
name: Run Tests and Generate Code Coverage
|
|
120
|
-
command: npm run coverage
|
|
121
|
-
|
|
122
|
-
- run:
|
|
123
|
-
name: Check if coverage meets at least 70%
|
|
124
|
-
command: npx c8 check-coverage --functions 70 --lines 70 --statements 70
|
|
125
|
-
|
|
126
|
-
- store_artifacts:
|
|
127
|
-
path: coverage
|
|
128
|
-
prefix: coverage
|
|
129
|
-
|
|
130
|
-
workflows:
|
|
131
|
-
version: 2.1
|
|
132
|
-
test-build-deploy:
|
|
133
|
-
jobs:
|
|
134
|
-
- install:
|
|
135
|
-
context: npm
|
|
136
|
-
- security-check:
|
|
137
|
-
requires:
|
|
138
|
-
- install
|
|
139
|
-
- license-check:
|
|
140
|
-
requires:
|
|
141
|
-
- install
|
|
142
|
-
- lint:
|
|
143
|
-
requires:
|
|
144
|
-
- install
|
|
145
|
-
- coverage:
|
|
146
|
-
requires:
|
|
147
|
-
- install
|
|
148
|
-
- docs:
|
|
149
|
-
requires:
|
|
150
|
-
- install
|
package/src/circle-srv.yml
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
#orbs:
|
|
3
|
-
# gcp-gcr: circleci/gcp-gcr@0.6.1
|
|
4
|
-
executors:
|
|
5
|
-
default:
|
|
6
|
-
description: >
|
|
7
|
-
A debian-based machine executor.
|
|
8
|
-
machine: true
|
|
9
|
-
jobs:
|
|
10
|
-
install:
|
|
11
|
-
docker:
|
|
12
|
-
- image: $CIRCLE_NODE_IMG
|
|
13
|
-
steps:
|
|
14
|
-
- checkout
|
|
15
|
-
- restore_cache:
|
|
16
|
-
keys:
|
|
17
|
-
- v1-npm-deps-{{ checksum "package-lock.json" }}
|
|
18
|
-
- v1-npm-deps-
|
|
19
|
-
|
|
20
|
-
- run:
|
|
21
|
-
name: Setup @leverege Token
|
|
22
|
-
command: echo \${NPMRC} > ~/.npmrc
|
|
23
|
-
|
|
24
|
-
- run: npm install
|
|
25
|
-
|
|
26
|
-
- save_cache:
|
|
27
|
-
key: v1-npm-deps-{{ checksum "package-lock.json" }}
|
|
28
|
-
paths:
|
|
29
|
-
- ./node_modules
|
|
30
|
-
|
|
31
|
-
- persist_to_workspace:
|
|
32
|
-
root: /home/circleci/project
|
|
33
|
-
paths:
|
|
34
|
-
- ./node_modules
|
|
35
|
-
|
|
36
|
-
security-check:
|
|
37
|
-
docker:
|
|
38
|
-
- image: $CIRCLE_NODE_IMG
|
|
39
|
-
steps:
|
|
40
|
-
- checkout
|
|
41
|
-
- attach_workspace:
|
|
42
|
-
at: ~/project
|
|
43
|
-
- run:
|
|
44
|
-
name: Check for vulnerabilities
|
|
45
|
-
command: npm audit --production --audit-level=moderate
|
|
46
|
-
|
|
47
|
-
license-check:
|
|
48
|
-
docker:
|
|
49
|
-
- image: $CIRCLE_NODE_IMG
|
|
50
|
-
steps:
|
|
51
|
-
- checkout
|
|
52
|
-
- attach_workspace:
|
|
53
|
-
at: ~/project
|
|
54
|
-
- run:
|
|
55
|
-
name: Check for LICENSE and README files
|
|
56
|
-
command: npm run pkglint
|
|
57
|
-
|
|
58
|
-
- run:
|
|
59
|
-
name: Check for license violations (e.g. GPL)
|
|
60
|
-
command: npx license-checker --production --summary --failOn GPL
|
|
61
|
-
|
|
62
|
-
lint:
|
|
63
|
-
docker:
|
|
64
|
-
- image: $CIRCLE_NODE_IMG
|
|
65
|
-
steps:
|
|
66
|
-
- checkout
|
|
67
|
-
- attach_workspace:
|
|
68
|
-
at: ~/project
|
|
69
|
-
- run:
|
|
70
|
-
name: Lint and save results
|
|
71
|
-
command: npm run lint-ci
|
|
72
|
-
|
|
73
|
-
- store_test_results:
|
|
74
|
-
path: reports
|
|
75
|
-
|
|
76
|
-
docs:
|
|
77
|
-
docker:
|
|
78
|
-
- image: $CIRCLE_NODE_IMG
|
|
79
|
-
steps:
|
|
80
|
-
- checkout
|
|
81
|
-
- attach_workspace:
|
|
82
|
-
at: ~/project
|
|
83
|
-
- run:
|
|
84
|
-
name: Generate docs
|
|
85
|
-
command: npx jsdoc -r src -R README.md -d docs
|
|
86
|
-
- store_artifacts:
|
|
87
|
-
path: docs
|
|
88
|
-
prefix: docs
|
|
89
|
-
|
|
90
|
-
coverage:
|
|
91
|
-
# coverage runs tests, generates coverage, and saves docs
|
|
92
|
-
environment:
|
|
93
|
-
TZ: 'America/New_York'
|
|
94
|
-
docker:
|
|
95
|
-
- image: $CIRCLE_NODE_IMG
|
|
96
|
-
# IF YOU NEED ANY OF THESE, UNCOMMENT TO USE
|
|
97
|
-
# - image: redis
|
|
98
|
-
# - image: circleci/mysql:5.7
|
|
99
|
-
# environment:
|
|
100
|
-
# MYSQL_USER: root
|
|
101
|
-
# MYSQL_ROOT_PASSWORD: root
|
|
102
|
-
# MYSQL_ALLOW_EMPTY_PASSWORD: true
|
|
103
|
-
# MYSQL_HOST: 127.0.0.1
|
|
104
|
-
# - image: nsqio/nsq
|
|
105
|
-
# command: /nsqlookupd -broadcast-address localhost:4160 -tcp-address 0.0.0.0:4160 -http-address 0.0.0.0:4161
|
|
106
|
-
|
|
107
|
-
# - image: nsqio/nsq
|
|
108
|
-
# command: >
|
|
109
|
-
# /nsqd
|
|
110
|
-
# -broadcast-address localhost:4150
|
|
111
|
-
# -tcp-address 0.0.0.0:4150
|
|
112
|
-
# -http-address 0.0.0.0:4151
|
|
113
|
-
# -lookupd-tcp-address localhost:4160
|
|
114
|
-
|
|
115
|
-
steps:
|
|
116
|
-
- checkout
|
|
117
|
-
- attach_workspace:
|
|
118
|
-
at: ~/project
|
|
119
|
-
|
|
120
|
-
# UNCOMMENT IF YOU NEED DECRYPTING SECRETS
|
|
121
|
-
# - run:
|
|
122
|
-
# name: Load secrets
|
|
123
|
-
# command: npm run decrypt
|
|
124
|
-
|
|
125
|
-
- run:
|
|
126
|
-
name: Run Tests and Generate Code Coverage
|
|
127
|
-
command: npm run coverage
|
|
128
|
-
|
|
129
|
-
- run:
|
|
130
|
-
name: Check if coverage meets at least 70%
|
|
131
|
-
command: npx c8 check-coverage --functions 70 --lines 70 --statements 70
|
|
132
|
-
|
|
133
|
-
- store_artifacts:
|
|
134
|
-
path: coverage
|
|
135
|
-
prefix: coverage
|
|
136
|
-
|
|
137
|
-
build:
|
|
138
|
-
# build should make dist image and prepare docker file
|
|
139
|
-
docker:
|
|
140
|
-
- image: $CIRCLE_NODE_IMG
|
|
141
|
-
|
|
142
|
-
steps:
|
|
143
|
-
- checkout
|
|
144
|
-
- attach_workspace:
|
|
145
|
-
at: ~/project
|
|
146
|
-
|
|
147
|
-
- run:
|
|
148
|
-
name: Setup @leverege Token
|
|
149
|
-
command: echo \${NPMRC} > ~/.npmrc.ro
|
|
150
|
-
|
|
151
|
-
- run:
|
|
152
|
-
name: Determine version number and container name
|
|
153
|
-
command: |
|
|
154
|
-
container="\`node -p \"require('./package.json').leverege.container\"\`"
|
|
155
|
-
if [ "\$container" == "undefined" ];
|
|
156
|
-
then
|
|
157
|
-
container=\$CIRCLE_PROJECT_REPONAME
|
|
158
|
-
fi
|
|
159
|
-
NODE_IMAGE="\`node -p \"require('./package.json').leverege.nodeimg\"\`"
|
|
160
|
-
|
|
161
|
-
echo \$(git describe --tags) > package_version
|
|
162
|
-
echo \${container} > container_name
|
|
163
|
-
echo \${NODE_IMAGE} > node_img
|
|
164
|
-
|
|
165
|
-
- run:
|
|
166
|
-
name: Create Dockerfile and build dist directory
|
|
167
|
-
command: mkdir -p docker && npm run dockerize \$(git describe --tags)
|
|
168
|
-
|
|
169
|
-
- persist_to_workspace:
|
|
170
|
-
root: ~/project
|
|
171
|
-
paths:
|
|
172
|
-
- docker/*
|
|
173
|
-
- package_version
|
|
174
|
-
- container_name
|
|
175
|
-
- node_img
|
|
176
|
-
|
|
177
|
-
workflows:
|
|
178
|
-
version: 2.1
|
|
179
|
-
test-build-deploy:
|
|
180
|
-
jobs:
|
|
181
|
-
- install:
|
|
182
|
-
context: npm
|
|
183
|
-
- security-check:
|
|
184
|
-
requires:
|
|
185
|
-
- install
|
|
186
|
-
- license-check:
|
|
187
|
-
requires:
|
|
188
|
-
- install
|
|
189
|
-
- lint:
|
|
190
|
-
requires:
|
|
191
|
-
- install
|
|
192
|
-
- coverage:
|
|
193
|
-
requires:
|
|
194
|
-
- install
|
|
195
|
-
- docs:
|
|
196
|
-
requires:
|
|
197
|
-
- install
|
|
198
|
-
- build:
|
|
199
|
-
context: npm
|
|
200
|
-
filters:
|
|
201
|
-
branches:
|
|
202
|
-
only:
|
|
203
|
-
- development
|
|
204
|
-
- /release-.*/
|
|
205
|
-
- master
|
|
206
|
-
requires:
|
|
207
|
-
- install
|
|
208
|
-
- security-check
|
|
209
|
-
- license-check
|
|
210
|
-
- lint
|
|
211
|
-
- coverage
|
|
212
|
-
- docs
|
|
213
|
-
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
geotile-local.yaml
|