diff --git a/.DS_Store b/.DS_Store index a6bacf2..7f055b4 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2a68fe4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:10 +WORKDIR /usr/src/app +COPY package*.json ./ +RUN npm install +COPY . . +ENV APP_PORT 8080 +EXPOSE 8080 +CMD [ "node", "app.js" ] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..512bfac --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,48 @@ +pipeline { + agent any + + tools { + nodejs '18.8.0' + } + + stages { + + stage('Fetch Code') { + steps { + git branch: 'master', url: 'https://github.com/QNNAKWUE/Ecommerce-Nodejs.git' + } + } + + stage('Install dependencies') { + steps { + echo 'Installing dependencies...' + sh 'rm -rf node_modules package-lock.json && npm install' + } +} + stage('Build') { + steps { + sh 'npm build' + } +} + stage ('Static Analysis') { + steps { + sh ' ./node_modules/eslint/bin/eslint.js -f checkstyle src > eslint.xml' + } + post { + always { + recordIssues enabledForFailure: true, aggregatingResults: true, tool: checkStyle(pattern: 'eslint.xml') + } + } + } +} + +} + +// # Path parameters +// export metric_id="n.name" + +// curl -X DELETE "https://api.datadoghq.com/api/v2/logs/config/metrics/${n.name}" \ +// -H "Accept: application/json" \ +// -H "DD-API-KEY: ${DD_API_KEY}" \ +// -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" + diff --git a/seed/index.js b/seed/index.js index e2d9001..9141ca7 100644 --- a/seed/index.js +++ b/seed/index.js @@ -79,7 +79,7 @@ var products = quantity: 10, department: 'Women', category: 'Basics', - date: 1581397200000 + date: 15813972000 }), new Product({ _id: "5bedf3b9c14d7822b39d9d45",