Skip to content

Commit

Permalink
removed unneeded packages and updated ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsee committed Jan 10, 2020
1 parent 407fe0b commit bd8bf17
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 17 deletions.
8 changes: 7 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
coverage
build/
client/
coverage/
node_modules/
test/
drop.js
Gruntfile.js
55 changes: 40 additions & 15 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
stages:
- pre-build
- pre-build-test
- push-artifacts
- performance

variables:
DOMAIN_NAME: oecloud.local
Expand All @@ -15,47 +17,70 @@ before_script:
- export project=${CI_PROJECT_NAME//[^[:alnum:]]/}
- export group=${CI_PROJECT_NAMESPACE//[^[:alnum:]]/}
- export branch=${CI_BUILD_REF_NAME//[^[:alnum:]]/}
- if [ ${group} == "oecloudio" ]; then export APP_IMAGE_NAME=$project; else export APP_IMAGE_NAME=$group"-"$project; fi
- export APP_IMAGE_NAME=$(echo $APP_IMAGE_NAME | tr '[:upper:]' '[:lower:]')
- if [ ${branch} == "master" ]; then export APP_TAG=latest; else export APP_TAG=${branch}; fi
- export APP_TAG=$(echo $APP_TAG | tr '[:upper:]' '[:lower:]')

- npm config set unsafe-perm true
- npm config set progress false
- npm config set registry ${NPM_REGISTRY}
# - npm config set registry https://registry.npmjs.org/

npminstall:
stage: pre-build
script:
- echo "Performing code style check..."
- status_eslint=0
- exit_status=0
- npm set progress=false
- npm config set registry ${NPM_REGISTRY}
- time npm install eslint babel-eslint eslint-config-loopback --no-optional
- export status_eslint=0
- export exit_status=0
- time npm install eslint babel-eslint --no-optional
- if npm run lint; then status_eslint=0; else status_eslint=1; fi
- if [ $status_eslint == 1 ]; then exit_status=1 && echo "esLint errors exist"; fi
- if [ $status_eslint == 1 ]; then export exit_status=1 && echo "esLint errors exist"; fi
- if [ $exit_status == 1 ]; then exit $exit_status; fi
- echo "Code style check done successfully"
- time npm install --no-optional
- echo "Node Modules Installed"
- mkdir -p ./artifacts/${CI_PROJECT_NAME}/
- npm audit --json > ./artifacts/${CI_PROJECT_NAME}/vulnerabilities.json || true
- npm config rm registry
- npm audit --json > vulnerabilities.json || true
- if npm audit; then status_vulnerabilities=0; else status_vulnerabilities=1; fi
- if [ $status_vulnerabilities == 1 ]; then export exit_status=1; echo "Dependency vulnerabilities exist"; fi
- if [ $status_vulnerabilities == 1 ]; then echo "Dependency vulnerabilities exist"; fi
- if [ $exit_status == 1 ]; then exit $exit_status; fi
artifacts:
expire_in: 2h
paths:
- node_modules/
- vulnerabilities.json
tags:
- CEP_RUNNER

test:
mongotest:
coverage: /Statements.*?(\d+(?:\.\d+)?)%/
stage: pre-build-test
variables:
MONGODB_HOST: 10.73.53.144
MONGODB_PORT: '27017'
MONGODB_DATABASE: ${CI_JOB_ID}_mongo
script:
- echo 'Performing MongoDB Test'
- export MONGODB_HOST="10.73.53.144"
- export MONGODB_PORT=27018
- export MONGODB_DATABASE=${CI_JOB_ID}_mongo
- npm config set registry ${NPM_REGISTRY}
- time npm install --no-optional
- npm run test
- npm test
artifacts:
expire_in: 2h
paths:
- coverage/
tags:
- CEP_RUNNER

pushartifacts:
stage: push-artifacts
script:
- echo "Copying all artifacts"
- mkdir -p ./artifacts/${CI_PROJECT_NAME}/${CI_BUILD_REF_NAME}/
- cp vulnerabilities.json ./artifacts/${CI_PROJECT_NAME}/${CI_BUILD_REF_NAME}/
- cp -r coverage/ ./artifacts/${CI_PROJECT_NAME}/${CI_BUILD_REF_NAME}/
- git clone http://10.73.97.24/oecloud.io/build-tools.git
- sh ./build-tools/push_artifacts.sh
tags:
- CEP_RUNNER
only:
- /^.*/@oecloud.io/oe-connector-mongodb
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"strong-globalize": "4.1.2"
},
"devDependencies": {
"mocha": "5.2.0",
"eslint": "5.15.1",
"eslint-config-loopback": "10.0.0",
"loopback-datasource-juggler": "3.28.1",
"mocha": "5.2.0",
"rc": "1.2.8",
"semver": "5.6.0",
"should": "13.2.3",
Expand Down

0 comments on commit bd8bf17

Please sign in to comment.