Compare commits
4 commits
1090cdc21a
...
master
Author | SHA1 | Date | |
---|---|---|---|
035af486a2 | |||
e28bfc0d1c | |||
2ce531c0e8 | |||
a945e7e9b9 |
7 changed files with 91 additions and 26 deletions
|
@ -1,17 +0,0 @@
|
||||||
version: 2
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
docker:
|
|
||||||
- image: node:6-alpine
|
|
||||||
working_directory: ~/mv-lite
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
name: Install SSH & Git
|
|
||||||
command: apk add --no-cache make bash git openssh
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Install dependancies
|
|
||||||
command: npm install
|
|
||||||
- run:
|
|
||||||
name: Run tests
|
|
||||||
command: npm test
|
|
76
appveyor.yml
Normal file
76
appveyor.yml
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
# version format
|
||||||
|
version: '{build}'
|
||||||
|
deploy: on
|
||||||
|
|
||||||
|
# branches to build
|
||||||
|
branches:
|
||||||
|
# whitelist
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
# Do not build on tags (GitHub, Bitbucket, GitLab, Gitea)
|
||||||
|
skip_tags: true
|
||||||
|
|
||||||
|
# Maximum number of concurrent jobs for the project
|
||||||
|
max_jobs: 1
|
||||||
|
clone_depth: 1
|
||||||
|
|
||||||
|
# Build worker image (VM template)
|
||||||
|
build_cloud: Docker
|
||||||
|
|
||||||
|
environment:
|
||||||
|
APPVEYOR_SSH_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBRMxhawMlUlQ8l4pOaeHsZl8XDO54WQngkYM1U/XB4m samsyn\jonatan@JonatanAMD
|
||||||
|
docker_image: node:16-alpine
|
||||||
|
npm_config_cache: /appveyor/projects/cache
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- sh: |
|
||||||
|
chmod -R 777 /appveyor/projects
|
||||||
|
npm install
|
||||||
|
npm run test
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# on successful build
|
||||||
|
on_success:
|
||||||
|
- sh: |
|
||||||
|
apk add curl jq
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Finished installling curl and jq"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
CURR_VER=$(cat package.json | jq -r .version)
|
||||||
|
echo "Checking https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases for version v${CURR_VER}"
|
||||||
|
curl -s -X GET -H "Authorization: token $deploytoken" https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases | grep -o "\"name\"\:\"v${CURR_VER}\"" > /dev/null
|
||||||
|
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
echo "Release already exists, nothing to do.";
|
||||||
|
else
|
||||||
|
echo "Creating release on gitea"
|
||||||
|
RELEASE_RESULT=$(curl \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token $deploytoken" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases \
|
||||||
|
-d "{\"tag_name\":\"v${CURR_VER}\",\"name\":\"v${CURR_VER}\",\"body\":\"Automatic release from Appveyor from ${APPVEYOR_REPO_COMMIT} :\n\n${APPVEYOR_REPO_COMMIT_MESSAGE}\"}")
|
||||||
|
RELEASE_ID=$(echo $RELEASE_RESULT | jq -r .id)
|
||||||
|
echo '//registry.npmjs.org/:_authToken=${npmtoken}' > ~/.npmrc
|
||||||
|
echo "Publishing new version to npm"
|
||||||
|
npm publish
|
||||||
|
fi
|
||||||
|
# - sh: |
|
||||||
|
# YELLOW='\033[0;33m'
|
||||||
|
# NC='\033[0m'
|
||||||
|
# LOCK_FILE="${HOME}/build.lock"
|
||||||
|
# export APPVEYOR_SSH_BLOCK=true
|
||||||
|
# touch "${LOCK_FILE}"
|
||||||
|
# echo -e "Build paused. To resume it, open a bash session to run '${YELLOW}rm \"${LOCK_FILE}\"${NC}' command."
|
||||||
|
# while [ -f "${LOCK_FILE}" ]; do
|
||||||
|
# sleep 1
|
||||||
|
# done
|
||||||
|
|
||||||
|
# on build failure
|
||||||
|
on_failure:
|
||||||
|
- sh: echo on_failure
|
|
@ -608,8 +608,8 @@ function stylizeWithColor(str, color) {
|
||||||
return '';
|
return '';
|
||||||
var codes = colors[color];
|
var codes = colors[color];
|
||||||
if (codes) {
|
if (codes) {
|
||||||
return '\x33[' + codes[0] + 'm' + str +
|
return '\x1B[' + codes[0] + 'm' + str +
|
||||||
'\x33[' + codes[1] + 'm';
|
'\x1B[' + codes[1] + 'm';
|
||||||
} else {
|
} else {
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
|
@ -771,13 +771,19 @@ Logger.prototype._emit = function (rec, noemit) {
|
||||||
function mkRecord(log, minLevel, args) {
|
function mkRecord(log, minLevel, args) {
|
||||||
var excludeFields, fields, msgArgs;
|
var excludeFields, fields, msgArgs;
|
||||||
if (args[0] instanceof Error) {
|
if (args[0] instanceof Error) {
|
||||||
|
var err = args[0];
|
||||||
// `log.<level>(err, ...)`
|
// `log.<level>(err, ...)`
|
||||||
fields = {
|
fields = {
|
||||||
// Use this Logger's err serializer, if defined.
|
// Use this Logger's err serializer, if defined.
|
||||||
err: (log.serializers && log.serializers.err
|
err: (log.serializers && log.serializers.err
|
||||||
? log.serializers.err(args[0])
|
? log.serializers.err(err)
|
||||||
: Logger.stdSerializers.err(args[0]))
|
: Logger.stdSerializers.err(err))
|
||||||
};
|
};
|
||||||
|
for (const key in err) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(err, key)) {
|
||||||
|
fields[key] = err[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
excludeFields = {err: true};
|
excludeFields = {err: true};
|
||||||
if (args.length === 1) {
|
if (args.length === 1) {
|
||||||
msgArgs = [fields.err.message];
|
msgArgs = [fields.err.message];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bunyan-lite",
|
"name": "bunyan-lite",
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"description": "a lite version of bunyan, a JSON logging library for node.js services with zero dependency",
|
"description": "a lite version of bunyan, a JSON logging library for node.js services with zero dependency",
|
||||||
"author": "Jonatan Nilsson <jonatan@nilsson.is> (https://nfp.is)",
|
"author": "Jonatan Nilsson <jonatan@nilsson.is> (https://nfp.is)",
|
||||||
"main": "./lib/bunyan.mjs",
|
"main": "./lib/bunyan.mjs",
|
||||||
|
|
|
@ -102,8 +102,8 @@ t.test('simple.log doesnotexist1.log doesnotexist2.log', async function () {
|
||||||
// io.js 2.2 (at least):
|
// io.js 2.2 (at least):
|
||||||
// ENOENT: no such file or directory, open 'doesnotexist1.log'
|
// ENOENT: no such file or directory, open 'doesnotexist1.log'
|
||||||
let matches = [
|
let matches = [
|
||||||
/^bunyan: ENOENT.*?, open '.+doesnotexist1.log'/m,
|
/^bunyan: ENOENT.*?, open '[^']*doesnotexist1.log'/m,
|
||||||
/^bunyan: ENOENT.*?, open '.+doesnotexist2.log'/m,
|
/^bunyan: ENOENT.*?, open '[^']*doesnotexist2.log'/m,
|
||||||
];
|
];
|
||||||
matches.forEach(function (match) {
|
matches.forEach(function (match) {
|
||||||
assert.match(res.stderr, match);
|
assert.match(res.stderr, match);
|
||||||
|
|
|
@ -119,7 +119,7 @@ t.test('defined getter properties using __defineGetter__', function() {
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
'{"foo":"[Throws: Cannot read property \'oh my\' of undefined]"}',
|
'{"foo":"[Throws: Cannot read properties of undefined (reading \'oh my\')]"}',
|
||||||
safeJson(obj)
|
safeJson(obj)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -142,7 +142,7 @@ t.test('enumerable defined getter properties using Object.defineProperty', funct
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
'{"foo":"[Throws: Cannot read property \'oh my\' of undefined]"}',
|
'{"foo":"[Throws: Cannot read properties of undefined (reading \'oh my\')]"}',
|
||||||
safeJson(obj)
|
safeJson(obj)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue