Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2 # use CircleCI 2.0
jobs: # a collection of steps
build:
working_directory: ~/new-ecommerce # directory where steps will run
docker: # run the steps with Docker
- image: circleci/node:14.0 # ...with this image as the primary container; this is where all `steps` will run
steps: # a collection of executable commands
- checkout # special step to check out source code to working directory
- run:
name: update-npm
command: 'sudo npm install -g npm@latest'
- restore_cache: # special step to restore the dependency cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-dependencies
command: npm install
- save_cache: # special step to save the dependency cache
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- add_ssh_keys:
fingerprints:
- "2c:18:35:24:5d:a5:96:8f:e9:c8:b4:5c:8f:cc:21:94"
- deploy:
name: deployment
command: ssh -o "StrictHostKeyChecking no" root@68.183.90.186 "cd ~ && rm -rf new-ecommerce && git clone -b feature/auth https://github.com/Sagar2177/devsnest-ecommerce-app.git new-ecommerce && cd new-ecommerce && sh deployment.sh "
2 changes: 2 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require('dotenv').config();

const config = {
postgresUrl: process.env["DATABASE_URL"] || 'postgres://postgres:password@localhost:5432/mydb',
twilio: {
Expand Down
2 changes: 1 addition & 1 deletion controllers/otp.controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { sendSMS} = require("../services/sms.service");

const createOtp = async (req, res) => {
const otp = '1122';
const otp = '1122 - testing ';
const someuser = "+919415751180";

await sendSMS("OTP is " + otp, someuser);
Expand Down
9 changes: 9 additions & 0 deletions deployment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
echo ‘installing requirements…’
apt-get install -y npm
npm install
echo ‘start server…’
pm2 restart index

echo ‘started server. ending SSH session..’
exit
Loading