58 Комити 1de1c7928b ... 20a3907ac6

Аутор SHA1 Порука Датум
  yazid138 20a3907ac6 commit пре 1 месец
  yazid138 02fd2de804 commit пре 1 месец
  yazid138 ec2bb9f193 commit пре 1 месец
  yazid138 61227fd6f3 Merge branch 'master' of https://009-sidali.kemdiktisaintek.go.id/appsptb/ptb-be пре 1 месец
  yazid138 69c3a8b952 commit пре 1 месец
  appsptb 93b4b21a86 Update 'routes/index.js' пре 1 месец
  appsptb 0d7cfc26ad Update 'routes/index.js' пре 1 месец
  yazid138 c593d41d7c commit пре 1 месец
  yazid138 9f2b0f57fa commit пре 1 месец
  yazid138 da9144e00c commit пре 1 месец
  yazid138 def245cb44 commit пре 1 месец
  yazid138 1cb98236b6 commit пре 1 месец
  yazid138 fb41eb7f08 commit пре 1 месец
  yazid138 2789a1496d commit пре 1 месец
  yazid138 bc44ba68e0 commit пре 1 месец
  yazid138 bc3c658990 commit пре 1 месец
  yazid138 de411a0553 commit пре 1 месец
  yazid138 5b6197fcda commit пре 1 месец
  yazid138 6dbfddd12f commit пре 1 месец
  yazid138 cc525e5b09 commit пре 1 месец
  yazid138 dea2ed5f96 commit пре 1 месец
  yazid138 b652025ba1 commit пре 1 месец
  yazid138 5222dc872f commit пре 1 месец
  yazid138 08da178e50 commit пре 1 месец
  yazid138 d16d722c04 commit пре 2 месеци
  yazid138 77b3fb117c commit пре 2 месеци
  yazid138 0187c54f5a commit пре 2 месеци
  yazid138 97336cd7cb commit пре 2 месеци
  yazid138 b18bf93246 commit пре 2 месеци
  yazid138 8efbf28155 commit пре 2 месеци
  yazid138 35ac137265 Merge branch 'master' of https://009-sidali.kemdiktisaintek.go.id/appsptb/ptb-be пре 2 месеци
  yazid138 b8d3d76f16 commit пре 2 месеци
  appsptb c9fdb02a35 Update 'Jenkinsfile' пре 2 месеци
  appsptb 2fc4967629 Update 'app.js' пре 3 месеци
  yazid138 507b91ffa7 commit пре 3 месеци
  yazid138 85b205a68a commit пре 3 месеци
  yazid138 d3c2629cd3 commit пре 3 месеци
  yazid138 c2396ff2eb commit пре 3 месеци
  appsptb b397bdf059 Update 'app.js' пре 3 месеци
  appsptb 89c7c81bb3 Update 'app.js' пре 3 месеци
  appsptb e743cd5a8e Update 'app.js' пре 3 месеци
  appsptb 44be1912de Update 'app.js' пре 3 месеци
  appsptb b60c7ea58e Update 'app.js' пре 3 месеци
  appsptb 380d3fd26a Update 'Jenkinsfile' пре 3 месеци
  appsptb 25490a2ef9 Update 'Jenkinsfile' пре 3 месеци
  appsptb c2171c1b9e Update 'app.js' пре 3 месеци
  appsptb e39b33a1ed commit пре 3 месеци
  appsptb 4fb5936547 commit пре 3 месеци
  appsptb f9b90815e0 commit пре 3 месеци
  appsptb 78d363ffac commit пре 3 месеци
  appsptb 71d21c05e6 commit пре 3 месеци
  appsptb 63a0a94f40 commit пре 3 месеци
  appsptb 38972a27f0 commit пре 3 месеци
  yazid e9b405b345 commit пре 3 месеци
  yazid138 2fdaa8a6ae commit пре 4 месеци
  yazid138 3abeb38b53 Merge branch 'master' of https://source.prod.sidali.vertibiz.com/appsptb/ptb-be пре 4 месеци
  yazid138 e22eabbcc0 Merge commit '1de1c7928b86a7b63fbc2b8dc1a92e0577209671' пре 4 месеци
  yazid db683221c9 Delete 'tes.js' пре 5 месеци
6 измењених фајлова са 24 додато и 52 уклоњено
  1. 2 2
      .env
  2. 19 37
      Jenkinsfile
  3. 1 1
      controller/v1/migrasi.controller.js
  4. 0 10
      controller/v1/pengunjung.controller.js
  5. 1 1
      routes/index.js
  6. 1 1
      routes/v1/index.js

+ 2 - 2
.env

@@ -1,8 +1,8 @@
-W8A1C=424f34ffbbde2007ad3797a8c0c91382d6478698bb18ed15c6576953d6bfc77b57c914cb85cef8059e7463a19cd3c40bda0ab2eb19a2534a6535de3e1ad550e1b058350fb4e2b916639df8226f4c9014c5506af17ef8e3ddd1ea3b3c14dd0afe8a1635757b7ed2828d70d46f98939561e11108fd229f7d4dc50cc6676df419dc0eb9
+W8A1C=5f272d5a701eaebf8ca8fc5b10ef4574f8cf4b47c748257cd522fe0d38d05b075133423432216d1102b43b86da62d20b4208b02399026b9d79cbaa3c0db5aef8ac6aa473be4d0489cf836efde45d1ffb7798631776852de1ee526b3b4eff8e6b38798a452ffa514462017b34bfc082cf61e476bc25
 P3UQ5=1d66650cb3bbe70d1426db09bdad22a326a1e3202598d9c92a7d43432b60a2b1cd835b13bd0aafb4497af0f494b3d0f78d4882fc5d50e05d10d19431a7ebc41b4d38bd92bda412e7f5a6ee52695a695e96b0b2aa29464437098e4377406a789652b69a92
 SRU51=3d3eb3d842f4e595048f1806ca815f8092e29fb6b98a30dff0b8241ad0e6c273
 
-MYDSY=90bfb012b7ea90eca0b7de34dbd68d9426c6b1ff97f718105ae85ce3c76fa582e857cdec5f43045440d71e700f8b4c58802ee4072489a664b97bf24954669e2ceb41fb9db581fe7fa9c90d102c0db39d67a367a685302aa41cb17a20a6fecac122ef4f3fe226ea8db3b5d92259b51008c5d03af76a8030ed665a99acf7917dd426220346
+MYDSY=a4d1823aa9fc608a0d6c9098d6906833ccbd472fb344ce4d3bcd4318749f68897c692e0d4343af9124acfeca58875ea0f256b90a718911ee6ae06dccb14f52fca3d04f52f1b8bda79a96bcb0cd4a0f886f9c426185d5ff2f62c60229f377cc779de1ce633d5824da10d3a1bf95e4b6b66856003a7ced4e1d2b95601fd7d59350
 XNX1Q=3f551be0c7519b3765a033014ddb9fc041fb2118679b46ca59db24e33c42964d6b4e311108ff1db25580feaf8dd6b63098e58b980a78bd25f3a685370a834653cc2e1c26dd0e504a76fa4490cd054f3c3eefb0b2ccc044abbe3898173de93b5084ffd2f03bcb78d23da04587737bdd0e7e0fcafd04f7784c50e59f4fd013f3f671351be3
 TEKQU=72372a5ec47568b3e9743691dd37a8854840e688bd0b653274e9652913c5021404cb31178efc06b48947d35ef9a58f0b73bd79236b732215d0d7cef7fa5a2d14e12bee126627525080197bd889c8c9f1279a9a99c53d9da2b8d8aadbe435a30180cfc311cc843000d20cd69820476fa0e6dce2057fb32c1d1f1ea301c892ed1f3bfb301b
 CBGTB=d69969375fb168a7d6cc35e27a5cc982896c1c0ab35d875fd54dc13b1226bb4e962994e8af5b02dc8c2d91eab09b26d06c37ff7aca82813883f98a568a733f3587f857d417bbbcbc292e88e2b706c1e79253ba7c4d300b8081c7ae5c1a5087f6f1b06020b79a3e91903bbe8946c5086643b683a287

+ 19 - 37
Jenkinsfile

@@ -10,10 +10,10 @@ node {
   def registryCredential
   try {
     // environment {
-      registryAddress = "https://registry.sidali.kemdikbud.go.id"
+      registryAddress = "000-sidali.kemdiktisaintek.go.id"
       registryCredential = 'DockerRegistry-ID'
-
     // }
+
     stage('Checkout') {
       checkout scm
     }
@@ -28,6 +28,7 @@ node {
       echo "Branch: master"
       sh 'docker -v'
       sh 'printenv'
+      sh 'docker-compose -v'
     }
 	
     stage('Test Build'){
@@ -35,50 +36,31 @@ node {
     }
 	
     stage('Build Deploy '){
-            // // now you are on slave labeled with 'label'
-            // def workspace = WORKSPACE
-            // // ${workspace} will now contain an absolute path to job workspace on slave
-
-            // workspace = env.WORKSPACE
-            // // ${workspace} will still contain an absolute path to job workspace on slave
-
-            // // When using a GString at least later Jenkins versions could only handle the env.WORKSPACE variant:
-            // echo "Current workspace is ${env.WORKSPACE}"
-
-            // // the current Jenkins instances will support the short syntax, too:
-            // echo "Current workspace is $WORKSPACE"
         docker.withTool("myDocker"){
-            docker.withRegistry(registryAddress, registryCredential) {
+            docker.withRegistry("https://${registryAddress}", registryCredential) {
 
                 def dockerImage = docker.build("ptb-be:${env.BUILD_ID}")
 
                 /* Push the container to the custom Registry */
                 dockerImage.push()
                 dockerImage.push('latest')
+
+                def imageName = "${registryAddress}/ptb-be:latest"
+                def composeDir = '/workdir/production'
+
+                sh "docker pull ${imageName}"
+
+                sh "docker stop ptb-Backend"
+                sh "docker rm ptb-Backend"
+
+                sh """cd ${composeDir} && 
+                      docker-compose stop ptb-be && 
+                      docker-compose rm -f ptb-be && 
+                      docker-compose up -d ptb-be"""
+
+                echo "Deploy completed successfully"
             }
         }
-        // echo 'env.BRANCH_NAME : ' + env.BRANCH_NAME
-        // if(env.BRANCH_NAME == 'master'){
-        //     script {
-        //         app = docker.build("ptb-be:latest")
-        //         echo 'app content : ' + app
-        //         dockerImage = registryAddress + ":$BUILD_NUMBER"
-        //         echo 'dockerImage : ' + dockerImage
-        //         echo 'registryCredential : ' + registryCredential
-        //         echo 'registryAddress : ' + registryAddress
-        //         echo 'withRegistry running...'
-        //         docker.withRegistry( "http://"+registryAddress, registryCredential ) {
-        //             echo 'withRegistry inside... app.push start'
-        //             //app.push("${BUILD_NUMBER}")
-        //             app.push('ptb-be:latest')
-        //             echo 'app.push done'
-        //             echo 'withRegistry inside... app.push latest start'
-        //             app.push(latest)
-        //             echo 'withRegistry inside... app.push latest done'
-        //         }
-        //     }
-        // }
-
      }
   }
   catch (err) {

+ 1 - 1
controller/v1/migrasi.controller.js

@@ -34,7 +34,7 @@ exports.pengajuan = handleError(async (req, res) => {
 })
 
 exports.dokumen = handleError(async (req, res) => {
-  const dokumen = await dokumenModel.find({ path: /api.sidali.sixsenz.net/ })
+  const dokumen = await dokumenModel.find()
 
   if (dokumen?.length) await Promise.all(dokumen.map(async e => {
     const path = e.path.split('/').slice(3).join('/')

+ 0 - 10
controller/v1/pengunjung.controller.js

@@ -6,17 +6,7 @@ const { validate } = require('../../utils/v1/validation')
 exports.create = handleError(async (req, res) => {
   const { os, ipv4, location } = req.body
   const isValid = validate(res, req.body, {
-    os: 'string',
     ipv4: 'string',
-    location: {
-      $$type: 'object',
-      country: 'string',
-      region: 'string',
-      city: 'string',
-      lat: 'number',
-      lon: 'number',
-      timezone: 'string',
-    },
   })
   if (!isValid) return
 

+ 1 - 1
routes/index.js

@@ -5,7 +5,7 @@ const handleDokumen = require('../utils/handleDokumen')
 
 router.get('/', (req, res) => {
   return res.json({
-    message: 'API SIDALI'
+    message: 'API SIDALI2'
   })
 })
 

+ 1 - 1
routes/v1/index.js

@@ -27,7 +27,7 @@ router.use('/log', require('./log.routes'))
 router.use('/auto', require('./auto.routes'))
 router.use('/pengunjung', require('./pengunjung.routes'))
 router.use('/rekomendasi', auth, require('./rekomendasi.routes'))
-router.use('/migrasi', auth, roleId([2020, 2023]), require('./migration.routes'))
+router.use('/migrasi', auth, roleId([PTB_ADMIN]), require('./migration.routes'))
 router.use('/kontak', require('./kontak.routes'))
 router.use('/signature', require('./signature.routes'))
 router.use('/catatan', require('./catatan.routes'))