Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MONGO_USERNAME=machoyamwangi_db_user
MONGO_PASSWORD=Gorjayas2010
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
node_modules

# .env
53 changes: 53 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
pipeline {
agent any

stages {
stage('Checkout') {
steps {
// Pull latest code from your GitHub repo
git branch: 'master',
url: 'https://github.com/machoyamwangi/gallery.git'
}
}

stage('Install Dependencies') {
steps {
// Install Node.js dependencies
sh 'npm install'
}
}

stage('Deploy to Render') {
steps {
// Trigger Render deploy via webhook
withCredentials([string(credentialsId:'render-webhook',variable:'deploy')]){
sh 'curl -X POST $deploy'}
}
}
}

post {
success {
slackSend(
channel:'#herman_ip1',
tokenCredentialId: 'slackbot',
message:'Build: ${currentBuild.fullDisplayName} successfully deployed \n web app "https://gallery-3-wyte.onrender.com/" '
)
}
failure {
slackSend(
channel:'#herman_ip1',
tokenCredentialId: 'slackbot',
message:'Build: ${currentBuild.fullDisplayName} failed to deploy '
)
}
}
}








13 changes: 13 additions & 0 deletions _config .js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require('dotenv').config({ quiet: true, inject: {} });

var config = {};

const { MONGO_USERNAME: username, MONGO_PASSWORD: password} = process.env;

config.mongoURI = {
production: `mongodb+srv://${username}:${password}@cluster0.2jsyouj.mongodb.net/darkroom?retryWrites=true&w=majority&appName=Cluster0`,
development: `mongodb+srv://${username}:${password}@cluster0.2jsyouj.mongodb.net/darkroom-dev?retryWrites=true&w=majority&appName=Cluster0`,
test: `mongodb+srv://${username}:${password}@cluster0.2jsyouj.mongodb.net/darkroom-test?retryWrites=true&w=majority&appName=Cluster0`,

}
module.exports = config;
16 changes: 10 additions & 6 deletions _config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
var config = {}
require('dotenv').config({ quiet: true, inject: {} });

var config = {};

const { MONGO_USERNAME: username, MONGO_PASSWORD: password} = process.env;

// Update to have your correct username and password
config.mongoURI = {
production: 'mongodb+srv://<USERNAME>:<PASSWORD>@gallery.wc344.mongodb.net/darkroom?retryWrites=true&w=majority',
development: 'mongodb+srv://<USERNAME>:<PASSWORD>@gallery.wc344.mongodb.net/darkroom-dev?retryWrites=true&w=majority',
test: 'mongodb+srv://<USERNAME>:<PASSWORD>@gallery.wc344.mongodb.net/darkroom-test?retryWrites=true&w=majority',
}
production: `mongodb+srv://${username}:${password}@cluster0.2jsyouj.mongodb.net/darkroom?retryWrites=true&w=majority&appName=Cluster0`,
development: `mongodb+srv://${username}:${password}@cluster0.2jsyouj.mongodb.net/darkroom-dev?retryWrites=true&w=majority&appName=Cluster0`,
test: `mongodb+srv://${username}:${password}@cluster0.2jsyouj.mongodb.net/darkroom-test?retryWrites=true&w=majority&appName=Cluster0`,

}
module.exports = config;
Loading