15 Commits

Author SHA1 Message Date
rajukottedi 3be0d38cf1 Merge pull request 'refactor: streamline Jenkinsfile by using helper methods for environment variables and agent labels' (#10) from develop into prod
bangararaju.kottedi.in/admin/admin-prod/pipeline/head Build queued...
Reviewed-on: #10
2026-02-16 20:33:10 +05:30
rajukottedi a0e56f6a89 refactor: streamline Jenkinsfile by using helper methods for environment variables and agent labels
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
bangararaju.kottedi.in/admin/admin-uat/pipeline/head This commit looks good
2026-02-16 20:28:02 +05:30
rajukottedi 7cf7246abd Merge pull request 'develop' (#9) from develop into prod
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
Reviewed-on: #9
2026-02-16 20:05:59 +05:30
rajukottedi 8885e288ed removed test file
bangararaju.kottedi.in/admin/admin-uat/pipeline/head This commit looks good
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
2026-02-16 20:05:39 +05:30
rajukottedi a888636487 webhook test
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
2026-02-16 19:57:11 +05:30
rajukottedi dad46d788d webhook test
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
2026-02-16 19:45:15 +05:30
rajukottedi 3619e33f44 webhook test
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
2026-02-16 19:31:46 +05:30
rajukottedi cf8e3b880c fix: add sudo to systemctl reload command in deployment stage
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
2026-02-16 19:13:30 +05:30
rajukottedi a6e48d6b2b fix: remove redundant ownership change command in deployment stage
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 18:39:34 +05:30
rajukottedi 06a64fa018 fix: add npm install step before building Angular
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 18:28:53 +05:30
rajukottedi 1bec713692 fix: ensure cleanup of deployment directory before building Angular
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 18:11:14 +05:30
rajukottedi cea6d218f8 feat: add Jenkins pipeline for automated deployment
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 17:40:09 +05:30
rajukottedi 9065626d40 Merge pull request 'develop' (#8) from develop into master
Reviewed-on: #8
2026-02-16 10:40:47 +05:30
rajukottedi 3dbecd171f Merge pull request 'fix: enhance OTP sending logic and add success message display' (#7) from task/popup-for-dynamic-form into develop
Reviewed-on: #7
2026-02-16 10:03:02 +05:30
rajukottedi bdba683f00 fix: enhance OTP sending logic and add success message display 2026-02-16 10:02:26 +05:30
4 changed files with 166 additions and 17 deletions
Vendored
+113
View File
@@ -0,0 +1,113 @@
pipeline {
agent none
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
}
environment {
DEPLOY_PATH = getDeployPath()
ENV_FILE_ID = getEnvFileId()
TARGET_URL = getHealthUrl()
}
stages {
stage('Checkout') {
agent { label getAgentLabel() }
steps {
checkout scm
}
}
stage('Inject Environment File') {
agent { label getAgentLabel() }
steps {
configFileProvider(
[configFile(
fileId: ENV_FILE_ID,
targetLocation: 'src/environments/environment.ts',
replaceTokens: true
)]
) {
echo "Environment file injected for ${env.BRANCH_NAME}"
}
}
}
stage('Build Angular') {
agent { label getAgentLabel() }
steps {
sh '''
npm install
ng build --configuration production --base-href /admin/
'''
}
}
stage('Deploy') {
agent { label getAgentLabel() }
steps {
sh '''
rm -rf $DEPLOY_PATH/*
cp -r dist/portfolio-admin/browser/* $DEPLOY_PATH/
sudo /usr/bin/systemctl reload nginx
'''
}
}
stage('Health Check') {
agent { label getAgentLabel() }
steps {
sh """
sleep 2
curl -f ${TARGET_URL}
"""
}
}
}
post {
failure {
echo "Deployment failed!"
}
success {
echo "Deployment successful!"
}
}
}
// -------- Helper Methods --------
def getAgentLabel() {
if (env.BRANCH_NAME == 'prod') {
return 'oracle-node'
} else {
return 'built-in' // for develop
}
}
def getEnvFileId() {
if (env.BRANCH_NAME == 'prod') {
return 'admin-prod-properties'
} else {
return 'admin-uat-properties'
}
}
def getDeployPath() {
if (env.BRANCH_NAME == 'prod') {
return "/var/www/bangararaju.kottedi.in/admin"
} else {
return "/var/www/bangararaju.kottedi.in/admin"
}
}
def getHealthUrl() {
if (env.BRANCH_NAME == 'prod') {
return "https://bangararaju.kottedi.in/admin"
} else {
return "https://bangararaju-uat.kottedi.in/admin"
}
}
+14 -10
View File
@@ -21,19 +21,9 @@
<!-- Step 2: OTP Input --> <!-- Step 2: OTP Input -->
@if (isOtpSent() && !isVerified()) { @if (isOtpSent() && !isVerified()) {
<div class="otp-section"> <div class="otp-section">
<p class="info-text">
OTP sent to <b>{{ emailForm.value.email }}</b>
</p>
<form [formGroup]="otpForm" (ngSubmit)="verifyOtp()"> <form [formGroup]="otpForm" (ngSubmit)="verifyOtp()">
<label for="otp">Enter 6-digit OTP</label> <label for="otp">Enter 6-digit OTP</label>
<input id="otp" type="text" maxlength="6" formControlName="otp" placeholder="123456" /> <input id="otp" type="text" maxlength="6" formControlName="otp" placeholder="123456" />
@if (isError()) {
<div class="error-banner">
<i class="fa-solid fa-circle-exclamation"></i>
<span>{{ message() }}</span>
</div>
}
<button type="submit" [disabled]="otpForm.invalid"> <button type="submit" [disabled]="otpForm.invalid">
Verify OTP Verify OTP
</button> </button>
@@ -47,5 +37,19 @@
</button> </button>
</div> </div>
} }
@if (isError()) {
<div class="error-banner">
<i class="fa-solid fa-circle-exclamation"></i>
<span>{{ message() }}</span>
</div>
}
@if (!isError() && isOtpSent() && !isVerified()) {
<div class="success-banner">
<i class="fa-solid fa-circle-check"></i>
<span>{{ message() }}</span>
</div>
}
</div> </div>
</div> </div>
+20
View File
@@ -171,3 +171,23 @@ button {
font-size: 14px; font-size: 14px;
margin-bottom: 10px; margin-bottom: 10px;
} }
/* Success banner for OTP sent */
.success-banner {
display: flex;
align-items: center;
gap: 8px;
background: rgba(120, 255, 140, 0.07);
border: 1px solid rgba(120, 255, 140, 0.25);
border-radius: 8px;
padding: 10px 14px;
margin: 10px 0 10px;
color: #78ff8c;
font-size: 13px;
i {
font-size: 15px;
flex-shrink: 0;
color: #78ff8c;
}
}
+14 -2
View File
@@ -48,15 +48,27 @@ export class OtpComponent implements OnInit {
if (this.emailForm.invalid) return; if (this.emailForm.invalid) return;
const email = this.emailForm.value.email; const email = this.emailForm.value.email;
this.authService.sendOtp(email).subscribe(() => { this.authService.sendOtp(email).subscribe({
next: () => {
this.isOtpSent.set(true); this.isOtpSent.set(true);
this.message.set('OTP sent successfully!'); this.isError.set(false);
this.message.set(`OTP sent to ${email}.`);
this.startTimer(30); // 30 seconds countdown this.startTimer(30); // 30 seconds countdown
},
error: (err) => {
this.isError.set(true);
if (err.status === 404) {
this.message.set('Email not found. Please check and try again.');
} else {
this.message.set('Failed to send OTP. Please try again.');
}
}
}); });
} }
resendOtp() { resendOtp() {
if (this.countdown() > 0) return; if (this.countdown() > 0) return;
this.otpForm.reset();
this.sendOtp(); this.sendOtp();
} }