Some cleanup on files. Remove skip tests
This commit is contained in:
parent
0f504eaf53
commit
57be8a144a
6 changed files with 95 additions and 248 deletions
|
@ -1,58 +0,0 @@
|
||||||
version: 2
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:latest
|
|
||||||
resource_class: medium
|
|
||||||
working_directory: ~/app
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Install npm deployment app
|
|
||||||
command: sudo npm install -g github-release-cli @babel/runtime
|
|
||||||
- run:
|
|
||||||
name: Check if this is a new release
|
|
||||||
command: |
|
|
||||||
set +e
|
|
||||||
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[", ]//g')
|
|
||||||
github-release list --owner $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME | grep "tag_name=\"v${PACKAGE_VERSION}\""
|
|
||||||
retVal=$?
|
|
||||||
if [ $retVal -eq 0 ]; then
|
|
||||||
echo "Release already exists. Quitting early"
|
|
||||||
circleci step halt
|
|
||||||
fi
|
|
||||||
- run:
|
|
||||||
name: Get current git commit message
|
|
||||||
command: |
|
|
||||||
echo "export COMMIT_MESSAGE=\"$(git log --format=oneline -n 1 $CIRCLE_SHA1)\"" >> $BASH_ENV
|
|
||||||
source $BASH_ENV
|
|
||||||
- run:
|
|
||||||
name: Get 7zz
|
|
||||||
command: |
|
|
||||||
wget https://www.7-zip.org/a/7z2106-linux-x64.tar.xz
|
|
||||||
tar -xvf 7z2106-linux-x64.tar.xz
|
|
||||||
- deploy:
|
|
||||||
name: Create a release
|
|
||||||
command: |
|
|
||||||
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[", ]//g')
|
|
||||||
echo "Creating release v${PACKAGE_VERSION}"
|
|
||||||
|
|
||||||
./7zz a "${CIRCLE_PROJECT_REPONAME}_build-sc-core.7z" runner.mjs package.json "service/*" "core/**/*" "core/*" -mx9 -mfb273 -mmt2 -md16M -mqs -myx9
|
|
||||||
./7zz a "${CIRCLE_PROJECT_REPONAME}_app.zip" runner.mjs package.json "service/*" "core/**/*" "core/*" config.json install.bat npminstall.bat README.md uninstall.bat
|
|
||||||
echo "Creating release '${PACKAGE_VERSION}'"
|
|
||||||
github-release upload \
|
|
||||||
--commitish $CIRCLE_SHA1 \
|
|
||||||
--token $GITHUB_TOKEN \
|
|
||||||
--owner $CIRCLE_PROJECT_USERNAME \
|
|
||||||
--repo $CIRCLE_PROJECT_REPONAME \
|
|
||||||
--tag "v${PACKAGE_VERSION}" \
|
|
||||||
--release-name "v${PACKAGE_VERSION}" \
|
|
||||||
--body "Automatic CircleCI Build of v${PACKAGE_VERSION} from ${CIRCLE_SHA1}: ${COMMIT_MESSAGE}" \
|
|
||||||
"${CIRCLE_PROJECT_REPONAME}_build-sc-core.zip" "${CIRCLE_PROJECT_REPONAME}_app.zip"
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
build_deploy:
|
|
||||||
jobs:
|
|
||||||
- build:
|
|
||||||
context: github-thething
|
|
98
.gitignore
vendored
98
.gitignore
vendored
|
@ -1,111 +1,13 @@
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
*.lcov
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
# Dependency directories
|
||||||
node_modules/
|
node_modules/
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# TypeScript cache
|
|
||||||
*.tsbuildinfo
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Microbundle cache
|
|
||||||
.rpt2_cache/
|
|
||||||
.rts2_cache_cjs/
|
|
||||||
.rts2_cache_es/
|
|
||||||
.rts2_cache_umd/
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
# Output of 'npm pack'
|
||||||
*.tgz
|
*.tgz
|
||||||
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|
||||||
# dotenv environment variables file
|
|
||||||
.env
|
|
||||||
.env.test
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
|
||||||
.cache
|
|
||||||
|
|
||||||
# Next.js build output
|
|
||||||
.next
|
|
||||||
|
|
||||||
# Nuxt.js build / generate output
|
|
||||||
.nuxt
|
|
||||||
dist
|
|
||||||
|
|
||||||
# Gatsby files
|
|
||||||
.cache/
|
|
||||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
|
||||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
||||||
# public
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
|
|
||||||
# TernJS port file
|
|
||||||
.tern-port
|
|
||||||
|
|
||||||
# Custom ignore
|
# Custom ignore
|
||||||
db.json
|
db.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
daemon
|
|
||||||
dev/public/main.js
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ on_success:
|
||||||
-H "Authorization: token $deploytoken" \
|
-H "Authorization: token $deploytoken" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases \
|
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}: ${APPVEYOR_REPO_COMMIT_MESSAGE}\"}")
|
-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)
|
RELEASE_ID=$(echo $RELEASE_RESULT | jq -r .id)
|
||||||
echo "Adding ${CURR_VER}_sc-core.7z to release ${RELEASE_ID}"
|
echo "Adding ${CURR_VER}_sc-core.7z to release ${RELEASE_ID}"
|
||||||
curl \
|
curl \
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
"inherit": true
|
"inherit": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"bin": {
|
||||||
|
"sccli": "./cli.mjs"
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://git.nfp.is/TheThing/service-core.git"
|
"url": "git+https://git.nfp.is/TheThing/service-core.git"
|
||||||
|
|
|
@ -32,7 +32,7 @@ t.after(function() {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
t.skip().timeout(10000).test('should run update and install correctly', async function(){
|
t.timeout(10000).test('should run update and install correctly', async function(){
|
||||||
try {
|
try {
|
||||||
await app.update()
|
await app.update()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -3,13 +3,12 @@ import Util from '../../core/util.mjs'
|
||||||
import fs from 'fs/promises'
|
import fs from 'fs/promises'
|
||||||
import GitProvider from '../../core/providers/git.mjs'
|
import GitProvider from '../../core/providers/git.mjs'
|
||||||
|
|
||||||
t.skip().describe('test', function() {
|
t.after(function() {
|
||||||
t.after(function() {
|
|
||||||
return fs.rm('./test/providers/file.7z')
|
return fs.rm('./test/providers/file.7z')
|
||||||
.catch(function() { })
|
.catch(function() { })
|
||||||
})
|
})
|
||||||
|
|
||||||
t.timeout(5000).describe('#getLatestVersion()', function() {
|
t.timeout(5000).describe('#getLatestVersion()', function() {
|
||||||
t.test('should return latest version in a valid repository', async function() {
|
t.test('should return latest version in a valid repository', async function() {
|
||||||
let provider = new GitProvider({ url: 'https://git.nfp.is/api/v1/repos/thething/sc-helloworld/releases' })
|
let provider = new GitProvider({ url: 'https://git.nfp.is/api/v1/repos/thething/sc-helloworld/releases' })
|
||||||
let version = await provider.getLatestVersion()
|
let version = await provider.getLatestVersion()
|
||||||
|
@ -19,9 +18,9 @@ t.skip().describe('test', function() {
|
||||||
assert.ok(version.link)
|
assert.ok(version.link)
|
||||||
assert.match(version.link, /\/attachments\//)
|
assert.match(version.link, /\/attachments\//)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
t.timeout(5000).describe('#checkConfig()', function() {
|
t.timeout(5000).describe('#checkConfig()', function() {
|
||||||
t.test('should fail if link does not return json repository object', async function() {
|
t.test('should fail if link does not return json repository object', async function() {
|
||||||
let err = await assert.isRejected(new GitProvider({ url: 'http://git.nfp.is/api/v1/repos/thething/ProgramQueuer' }).checkConfig())
|
let err = await assert.isRejected(new GitProvider({ url: 'http://git.nfp.is/api/v1/repos/thething/ProgramQueuer' }).checkConfig())
|
||||||
assert.match(err.message, /valid/i)
|
assert.match(err.message, /valid/i)
|
||||||
|
@ -51,6 +50,7 @@ t.skip().describe('test', function() {
|
||||||
|
|
||||||
let test = t
|
let test = t
|
||||||
if (!process.env.gittesttoken) {
|
if (!process.env.gittesttoken) {
|
||||||
|
console.log('Skipping "git.test.integration: #checkConfig() should succeed on private repo with token"')
|
||||||
test = test.skip()
|
test = test.skip()
|
||||||
}
|
}
|
||||||
test.test('should succeed on private repo with token', function() {
|
test.test('should succeed on private repo with token', function() {
|
||||||
|
@ -59,13 +59,14 @@ t.skip().describe('test', function() {
|
||||||
url: 'https://git.nfp.is/api/v1/repos/TheThing/privateexample/releases',
|
url: 'https://git.nfp.is/api/v1/repos/TheThing/privateexample/releases',
|
||||||
}).checkConfig()
|
}).checkConfig()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
t.timeout(5000).describe('#downloadVersion()', function() {
|
t.timeout(5000).describe('#downloadVersion()', function() {
|
||||||
const util = new Util(import.meta.url)
|
const util = new Util(import.meta.url)
|
||||||
|
|
||||||
let test = t
|
let test = t
|
||||||
if (!process.env.gittesttoken) {
|
if (!process.env.gittesttoken) {
|
||||||
|
console.log('Skipping "git.test.integration: #downloadVersion() should successfully download release"')
|
||||||
test = test.skip()
|
test = test.skip()
|
||||||
}
|
}
|
||||||
test.test('should successfully download release', async function() {
|
test.test('should successfully download release', async function() {
|
||||||
|
@ -94,5 +95,4 @@ t.skip().describe('test', function() {
|
||||||
assert.ok(output.indexOf('file1.txt'))
|
assert.ok(output.indexOf('file1.txt'))
|
||||||
assert.ok(output.indexOf('file2.txt'))
|
assert.ok(output.indexOf('file2.txt'))
|
||||||
})
|
})
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue