Unverified Commit e1be9dea authored by Abhishek Mishra's avatar Abhishek Mishra Committed by GitHub
Browse files

Merge branch 'feature/63/upgrade-dependencies' into...

Merge branch 'feature/63/upgrade-dependencies' into dependabot/npm_and_yarn/cacheable-request-and-got-10.2.7
No related merge requests found
Showing with 1266 additions and 1132 deletions
+1266 -1132
node() {
properties([
parameters([
string(name: 'docker_repo', defaultValue: 'user-service', description: 'Docker Image Name'),
string(name: 'docker_server', defaultValue: 'localhost:5000', description: 'Docker Registry URL'),
withCredentials([string(credentialsId: 'docker_server', variable: 'docker_server')]) {
properties([
parameters([
string(name: 'docker_repo', defaultValue: 'samagragovernance/esamwad-user-service', description: 'Docker Image Name'),
string(name: 'docker_server', defaultValue: "$docker_server", description: 'Docker Registry URL'),
])
])
])
}
stage('Checkout') {
cleanWs()
checkout scm
commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
env.commit_id = sh(script: 'echo ' + env.docker_repo + '_' + commit_hash + '_' + env.BRANCH_NAME, returnStdout: true).trim()
env.commit_id = env.BRANCH_NAME
echo "${env.commit_id}"
}
stage('docker-build') {
sh '''
docker build -f build/Dockerfile -t $docker_server/$docker_repo:$commit_id .
'''
if (env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'master') {
sh '''
docker build -f build/Dockerfile -t $docker_server/$docker_repo:$commit_id .
'''
docker build -f build/Dockerfile -t $docker_server/$docker_repo:latest .
'''
}
}
stage('docker-push') {
sh '''
docker push $docker_server/$docker_repo:$commit_id
'''
}
stage('ArchiveArtifacts') {
sh("echo ${commit_id} > commit_id.txt")
archiveArtifacts 'commit_id.txt'
currentBuild.description = "${commit_id}"
docker push $docker_server/$docker_repo:$commit_id
'''
if (env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'master') {
sh '''
docker push $docker_server/$docker_repo:latest
'''
}
}
}
\ No newline at end of file
}
This diff is collapsed.
......@@ -7,7 +7,7 @@ import {
Param,
Patch,
Post,
Query,
Query, UnprocessableEntityException,
} from '@nestjs/common';
import {
SignupResponse,
......@@ -44,7 +44,24 @@ export class ApiController {
}
@Get('sendOTP')
async sendOTP(@Query('phone') phone): Promise<any> {
async sendOTP(
@Query('phone') phone,
@Query('errorMessage') errorMessage = 'User not found.',
@Headers('x-application-id') applicationId?,
): Promise<any> {
if (applicationId) {
const { total }: { total: number; users: Array<User> } =
await this.fusionAuthService.getUsersByString(
`(username: ${phone}, mobilePhone: ${phone})`,
0,
1,
applicationId,
null,
);
if (!total || total == 0) {
throw new UnprocessableEntityException(errorMessage);
}
}
const status: SMSResponse = await this.otpService.sendOTP(phone);
return { status };
}
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment