From 8514eb3948a0794ac151648ea9713979530ad71e Mon Sep 17 00:00:00 2001 From: ghazal Date: Mon, 1 Jul 2024 14:04:25 +0300 Subject: [PATCH 01/35] first --- .idea/.gitignore | 3 +++ .idea/NetflixFrontend.iml | 8 +++++++ .../inspectionProfiles/profiles_settings.xml | 6 +++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 +++++++ .idea/vcs.xml | 6 +++++ pipelines/build.Jenkinsfile | 24 +++++++++++++++++++ 7 files changed, 59 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/NetflixFrontend.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 pipelines/build.Jenkinsfile diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/NetflixFrontend.iml b/.idea/NetflixFrontend.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/NetflixFrontend.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..060d2c5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a62c735 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile new file mode 100644 index 0000000..21625de --- /dev/null +++ b/pipelines/build.Jenkinsfile @@ -0,0 +1,24 @@ +// pipelines/build.Jenkinsfile + +pipeline { + agent any + + triggers { + githubPush() + } + + stages { + stage('Build app container') { + steps { + sh ''' + # your pipeline commands here.... + + # for example list the files in the pipeline workdir + ls + + # build an image + docker build -t netflix-front . + ''' + } + } + } From 80445d40beb0f8980a1c6de0a912085ad45a731b Mon Sep 17 00:00:00 2001 From: ghazal Date: Mon, 1 Jul 2024 14:27:30 +0300 Subject: [PATCH 02/35] first --- pipelines/build.Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 21625de..e0fb839 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -2,6 +2,9 @@ pipeline { agent any + agent { + label 'general' + } triggers { githubPush() From ea311986371d62233ea575271337daacc20749c7 Mon Sep 17 00:00:00 2001 From: ghazal Date: Mon, 1 Jul 2024 14:31:59 +0300 Subject: [PATCH 03/35] first --- pipelines/build.Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index e0fb839..6327834 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -1,7 +1,6 @@ // pipelines/build.Jenkinsfile pipeline { - agent any agent { label 'general' } From ccec02feb3eb9e33ff10e4d462f907ad9525add3 Mon Sep 17 00:00:00 2001 From: ghazal Date: Mon, 1 Jul 2024 14:33:11 +0300 Subject: [PATCH 04/35] first --- .idea/misc.xml | 3 +++ pipelines/build.Jenkinsfile | 1 + 2 files changed, 4 insertions(+) diff --git a/.idea/misc.xml b/.idea/misc.xml index 060d2c5..db8786c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6327834..5f15b7b 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -24,3 +24,4 @@ pipeline { } } } +} From 9ee022a4f31cc708d6439007787491fb46d024e4 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 09:42:28 +0300 Subject: [PATCH 05/35] first --- k8s/deploymentCatalog.yaml | 48 ++++++++++++++++++++++++++++++++++++++ k8s/deploymentFront.yaml | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 k8s/deploymentCatalog.yaml create mode 100644 k8s/deploymentFront.yaml diff --git a/k8s/deploymentCatalog.yaml b/k8s/deploymentCatalog.yaml new file mode 100644 index 0000000..cbfaecc --- /dev/null +++ b/k8s/deploymentCatalog.yaml @@ -0,0 +1,48 @@ +#k8s/service-demo.yaml + +apiVersion: v1 +kind: Service +metadata: + name: service-netflix-movie-catalog +spec: + selector: + app: netflix-movie-catalog + ports: + - protocol: TCP + port: 8080 + targetPort: 8080 + +--- + + +# k8s/deployment-demo.yaml + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: netflix-movie-catalog + labels: + app: netflix-movie-catalog +spec: + replicas: 2 + selector: + matchLabels: + app: netflix-movie-catalog + template: + metadata: + labels: + app: netflix-movie-catalog + spec: + containers: + - name: server + image: ghazalkhateeb/netflix_movie_catalog:0.0.1 + livenessProbe: + initialDelaySeconds: 10 + httpGet: + path: "/status" + port: 8080 + readinessProbe: + initialDelaySeconds: 10 + httpGet: + path: "/status" + port: 8080 \ No newline at end of file diff --git a/k8s/deploymentFront.yaml b/k8s/deploymentFront.yaml new file mode 100644 index 0000000..79407b7 --- /dev/null +++ b/k8s/deploymentFront.yaml @@ -0,0 +1,43 @@ +#k8s/service-demo.yaml + +apiVersion: v1 +kind: Service +metadata: + name: service-netflix-movie-front +spec: + selector: + app: netflix-frontend + ports: + - protocol: TCP + port: 3000 + targetPort: 3000 + +--- + + +# k8s/deployment-demo.yaml + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: netflix-frontend + labels: + app: netflix-frontend +spec: + replicas: 1 + selector: + matchLabels: + app: netflix-frontend + template: + metadata: + labels: + app: netflix-frontend + spec: + containers: + - name: server + image: ghazalkhateeb/netflixfrontend_image:0.0.3 + env: + - name: MOVIE_CATALOG_SERVICE + value: http://service-netflix-movie-catalog:8080 + - name: REDIS_URL + value: service-netflix-redis:6379 From 42a93bb770598d6480363d6dcd0d3be96ffd463f Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 10:38:46 +0300 Subject: [PATCH 06/35] first --- k8s/deploymentCatalog.yaml | 48 -------------------------------------- k8s/deploymentFront.yaml | 1 + 2 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 k8s/deploymentCatalog.yaml diff --git a/k8s/deploymentCatalog.yaml b/k8s/deploymentCatalog.yaml deleted file mode 100644 index cbfaecc..0000000 --- a/k8s/deploymentCatalog.yaml +++ /dev/null @@ -1,48 +0,0 @@ -#k8s/service-demo.yaml - -apiVersion: v1 -kind: Service -metadata: - name: service-netflix-movie-catalog -spec: - selector: - app: netflix-movie-catalog - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - ---- - - -# k8s/deployment-demo.yaml - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: netflix-movie-catalog - labels: - app: netflix-movie-catalog -spec: - replicas: 2 - selector: - matchLabels: - app: netflix-movie-catalog - template: - metadata: - labels: - app: netflix-movie-catalog - spec: - containers: - - name: server - image: ghazalkhateeb/netflix_movie_catalog:0.0.1 - livenessProbe: - initialDelaySeconds: 10 - httpGet: - path: "/status" - port: 8080 - readinessProbe: - initialDelaySeconds: 10 - httpGet: - path: "/status" - port: 8080 \ No newline at end of file diff --git a/k8s/deploymentFront.yaml b/k8s/deploymentFront.yaml index 79407b7..714ea27 100644 --- a/k8s/deploymentFront.yaml +++ b/k8s/deploymentFront.yaml @@ -25,6 +25,7 @@ metadata: app: netflix-frontend spec: replicas: 1 + selector: matchLabels: app: netflix-frontend From 2bfce63c99a519d1bf5c08a818abad4b3a983829 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 10:39:14 +0300 Subject: [PATCH 07/35] first --- k8s/deploymentFront.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/k8s/deploymentFront.yaml b/k8s/deploymentFront.yaml index 714ea27..0e3a3ce 100644 --- a/k8s/deploymentFront.yaml +++ b/k8s/deploymentFront.yaml @@ -24,6 +24,7 @@ metadata: labels: app: netflix-frontend spec: + replicas: 1 selector: From 1340809eef0ca39d8eb6b1888ed4d478ff68e8d0 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 12:03:55 +0300 Subject: [PATCH 08/35] first --- pipelines/build.Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 5f15b7b..9fb7926 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,6 +12,7 @@ pipeline { stages { stage('Build app container') { steps { + cleanWs() sh ''' # your pipeline commands here.... From fbc9a88989aa30bac80788ce47feb52599392fc0 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 12:55:11 +0300 Subject: [PATCH 09/35] first --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c9814a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:14-alpine +WORKDIR /app +COPY . . +RUN npm install +RUN npm run build +CMD ["npm", "start"] \ No newline at end of file From 47f7f86ae007881a93235cdbee832d13ca7f13d1 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 12:57:53 +0300 Subject: [PATCH 10/35] first --- pipelines/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 pipelines/Dockerfile diff --git a/pipelines/Dockerfile b/pipelines/Dockerfile new file mode 100644 index 0000000..c9814a1 --- /dev/null +++ b/pipelines/Dockerfile @@ -0,0 +1,6 @@ +FROM node:14-alpine +WORKDIR /app +COPY . . +RUN npm install +RUN npm run build +CMD ["npm", "start"] \ No newline at end of file From 8334f4aa9a57159b2b8c106432d27883399449e4 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 12:59:34 +0300 Subject: [PATCH 11/35] first --- Dockerfile | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c9814a1..0000000 --- a/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM node:14-alpine -WORKDIR /app -COPY . . -RUN npm install -RUN npm run build -CMD ["npm", "start"] \ No newline at end of file From 91b6834ec97194682bff28def89c0a576de6a64e Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 13:15:50 +0300 Subject: [PATCH 12/35] first --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c9814a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:14-alpine +WORKDIR /app +COPY . . +RUN npm install +RUN npm run build +CMD ["npm", "start"] \ No newline at end of file From 40830ecad5d59aa30f6bcad2a06f0083fd51cd74 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 13:20:27 +0300 Subject: [PATCH 13/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 9fb7926..9967e5d 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,7 +12,7 @@ pipeline { stages { stage('Build app container') { steps { - cleanWs() + sh ''' # your pipeline commands here.... From 4fcd011b47294050814a18ae56f87581d08f88a2 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 13:26:31 +0300 Subject: [PATCH 14/35] first --- pipelines/build.Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 9967e5d..abf10d7 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -9,6 +9,7 @@ pipeline { githubPush() } + stages { stage('Build app container') { steps { From 23504e57d7537ca0be066ddae47b01e521e0860b Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 14:07:05 +0300 Subject: [PATCH 15/35] first --- pipelines/build.Jenkinsfile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index abf10d7..255c832 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -8,20 +8,34 @@ pipeline { triggers { githubPush() } + environment { + // GIT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() + // TIMESTAMP = new Date().format("yyyyMMdd-HHmmss") + + IMAGE_TAG = v1.0.$BUILD_NUMBER + IMAGE_BASE_NAME = 'netflix-app' + + DOCKER_USERNAME = credentials('dockerhub').username + DOCKER_PASS = credentials('dockerhub').password + } stages { - stage('Build app container') { + stage('Docker setup') { steps { + sh ''' + docker login -u $DOCKER_USERNAME -p $DOCKER_PASS + ''' + } + } + stage('Build & Push') { + steps { sh ''' - # your pipeline commands here.... - - # for example list the files in the pipeline workdir - ls - - # build an image - docker build -t netflix-front . + IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG + + docker build -t $IMAGE_FULL_NAME . + docker push $IMAGE_FULL_NAME ''' } } From 53ae6647d11745430d06c69534c2e659cfcc3911 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 14:10:41 +0300 Subject: [PATCH 16/35] first --- pipelines/build.Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 255c832..6f5042d 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,7 +12,8 @@ pipeline { // GIT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() // TIMESTAMP = new Date().format("yyyyMMdd-HHmmss") - IMAGE_TAG = v1.0.$BUILD_NUMBER + zero_value=0 + IMAGE_TAG = v1.zero_value.$BUILD_NUMBER IMAGE_BASE_NAME = 'netflix-app' DOCKER_USERNAME = credentials('dockerhub').username From fb0635d4892a1cf6e94a9888be49353e7b1f9f34 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 14:12:13 +0300 Subject: [PATCH 17/35] first --- pipelines/build.Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6f5042d..be44cfe 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,8 +12,8 @@ pipeline { // GIT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() // TIMESTAMP = new Date().format("yyyyMMdd-HHmmss") - zero_value=0 - IMAGE_TAG = v1.zero_value.$BUILD_NUMBER + + IMAGE_TAG = 0.0.$BUILD_NUMBER IMAGE_BASE_NAME = 'netflix-app' DOCKER_USERNAME = credentials('dockerhub').username From 6fc8e52f01aa309b83dddaae2b0f3c44fd9a5767 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 14:13:45 +0300 Subject: [PATCH 18/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index be44cfe..62ccb33 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -13,7 +13,7 @@ pipeline { // TIMESTAMP = new Date().format("yyyyMMdd-HHmmss") - IMAGE_TAG = 0.0.$BUILD_NUMBER + IMAGE_TAG = 'v1.0.$BUILD_NUMBER' IMAGE_BASE_NAME = 'netflix-app' DOCKER_USERNAME = credentials('dockerhub').username From 5697f0b7e27fed612f8258d790bb0f74e210ad3f Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 14:14:34 +0300 Subject: [PATCH 19/35] first --- pipelines/build.Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 62ccb33..7f7d562 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -16,8 +16,8 @@ pipeline { IMAGE_TAG = 'v1.0.$BUILD_NUMBER' IMAGE_BASE_NAME = 'netflix-app' - DOCKER_USERNAME = credentials('dockerhub').username - DOCKER_PASS = credentials('dockerhub').password + DOCKER_USERNAME = 'credentials('dockerhub').username' + DOCKER_PASS = 'credentials('dockerhub').password' } From d61b66b386ac8db56aa4bc165659720ed9c87da2 Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 14:21:33 +0300 Subject: [PATCH 20/35] first --- pipelines/build.Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 7f7d562..343c93d 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -15,9 +15,12 @@ pipeline { IMAGE_TAG = 'v1.0.$BUILD_NUMBER' IMAGE_BASE_NAME = 'netflix-app' + DOCKER_CREDENTIALS = credentials('dockerhub') + DOCKER_USERNAME = "${DOCKER_CREDENTIALS_USR}" + DOCKER_PASS = "${DOCKER_CREDENTIALS_PSW}" - DOCKER_USERNAME = 'credentials('dockerhub').username' - DOCKER_PASS = 'credentials('dockerhub').password' + //DOCKER_USERNAME = credentials('dockerhub').username + //DOCKER_PASS = credentials('dockerhub').password } From ac78aa02fc0249965e2206a6aa431942bcefb86a Mon Sep 17 00:00:00 2001 From: ghazal Date: Tue, 2 Jul 2024 14:22:37 +0300 Subject: [PATCH 21/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 343c93d..c2ea349 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -13,7 +13,7 @@ pipeline { // TIMESTAMP = new Date().format("yyyyMMdd-HHmmss") - IMAGE_TAG = 'v1.0.$BUILD_NUMBER' + IMAGE_TAG = "v1.0.$BUILD_NUMBER" IMAGE_BASE_NAME = 'netflix-app' DOCKER_CREDENTIALS = credentials('dockerhub') DOCKER_USERNAME = "${DOCKER_CREDENTIALS_USR}" From dfd3cb9fd9a81941ebe24f4edb8feff777a154a9 Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 10:59:25 +0300 Subject: [PATCH 22/35] first --- pipelines/build.Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index c2ea349..6a5d08a 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -43,5 +43,13 @@ pipeline { ''' } } + stage('Trigger Deploy') { + steps { + build job: 'NetflixFrontendDeploy' , wait: false, parameters: [ + string(name: 'SERVICE_NAME', value: "NetflixFrontend") + string(name: 'IMAGE_FULL_NAME_PARAM', value: "$IMAGE_FULL_NAME") + ] + } + } } } From 0fe267219dec7d28a5ea0f10346f1c6f3c932669 Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:02:49 +0300 Subject: [PATCH 23/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6a5d08a..1fa7c1c 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -47,7 +47,7 @@ pipeline { steps { build job: 'NetflixFrontendDeploy' , wait: false, parameters: [ string(name: 'SERVICE_NAME', value: "NetflixFrontend") - string(name: 'IMAGE_FULL_NAME_PARAM', value: "$IMAGE_FULL_NAME") + string(name: 'IMAGE_FULL_NAME', value: "$IMAGE_FULL_NAME") ] } } From 4a201d817d3cae6e99d7f39a011b37767184fd3b Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:06:21 +0300 Subject: [PATCH 24/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 1fa7c1c..6a5d08a 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -47,7 +47,7 @@ pipeline { steps { build job: 'NetflixFrontendDeploy' , wait: false, parameters: [ string(name: 'SERVICE_NAME', value: "NetflixFrontend") - string(name: 'IMAGE_FULL_NAME', value: "$IMAGE_FULL_NAME") + string(name: 'IMAGE_FULL_NAME_PARAM', value: "$IMAGE_FULL_NAME") ] } } From 81dcd2c86fe8b6675b8455ed26927f8b13dacea0 Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:10:10 +0300 Subject: [PATCH 25/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6a5d08a..6c76a15 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -46,7 +46,7 @@ pipeline { stage('Trigger Deploy') { steps { build job: 'NetflixFrontendDeploy' , wait: false, parameters: [ - string(name: 'SERVICE_NAME', value: "NetflixFrontend") + string(name: 'SERVICE_NAME', value: "NetflixFrontend"), string(name: 'IMAGE_FULL_NAME_PARAM', value: "$IMAGE_FULL_NAME") ] } From 8ca805937dbcd2423a38796445c958984bbfab83 Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:22:50 +0300 Subject: [PATCH 26/35] first --- pipelines/build.Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6c76a15..bbdf487 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -24,6 +24,7 @@ pipeline { } + stages { stage('Docker setup') { steps { From 68c4876680370875044a77e9d588588d93182d30 Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:30:18 +0300 Subject: [PATCH 27/35] first --- pipelines/build.Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index bbdf487..6d85e0b 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -37,7 +37,7 @@ pipeline { stage('Build & Push') { steps { sh ''' - IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG + env.IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG docker build -t $IMAGE_FULL_NAME . docker push $IMAGE_FULL_NAME @@ -48,7 +48,7 @@ pipeline { steps { build job: 'NetflixFrontendDeploy' , wait: false, parameters: [ string(name: 'SERVICE_NAME', value: "NetflixFrontend"), - string(name: 'IMAGE_FULL_NAME_PARAM', value: "$IMAGE_FULL_NAME") + string(name: 'IMAGE_FULL_NAME_PARAM', value: "${env.IMAGE_FULL_NAME}") ] } } From 593fe9dbb3439de4733565468fbcda36837803ad Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:33:51 +0300 Subject: [PATCH 28/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6d85e0b..05fe535 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -37,7 +37,7 @@ pipeline { stage('Build & Push') { steps { sh ''' - env.IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG + env.IMAGE_FULL_NAME="$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG" docker build -t $IMAGE_FULL_NAME . docker push $IMAGE_FULL_NAME From 93541eaff023fc431c1965fe0f45c38d10cf2bab Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:38:20 +0300 Subject: [PATCH 29/35] first --- pipelines/build.Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 05fe535..448ffd8 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -37,7 +37,8 @@ pipeline { stage('Build & Push') { steps { sh ''' - env.IMAGE_FULL_NAME="$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG" + def imageFullName = "${DOCKER_USERNAME}/${IMAGE_BASE_NAME}:${IMAGE_TAG}" + env.IMAGE_FULL_NAME=imageFullName docker build -t $IMAGE_FULL_NAME . docker push $IMAGE_FULL_NAME From 32ab134da35294bb59fdf89bc54525aba892f35f Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:42:38 +0300 Subject: [PATCH 30/35] first --- pipelines/build.Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 448ffd8..9ef007e 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -37,8 +37,8 @@ pipeline { stage('Build & Push') { steps { sh ''' - def imageFullName = "${DOCKER_USERNAME}/${IMAGE_BASE_NAME}:${IMAGE_TAG}" - env.IMAGE_FULL_NAME=imageFullName + IMAGE_FULL_NAME = ${DOCKER_USERNAME}/${IMAGE_BASE_NAME}:${IMAGE_TAG} + docker build -t $IMAGE_FULL_NAME . docker push $IMAGE_FULL_NAME @@ -49,7 +49,7 @@ pipeline { steps { build job: 'NetflixFrontendDeploy' , wait: false, parameters: [ string(name: 'SERVICE_NAME', value: "NetflixFrontend"), - string(name: 'IMAGE_FULL_NAME_PARAM', value: "${env.IMAGE_FULL_NAME}") + string(name: 'IMAGE_FULL_NAME_PARAM', value: "${DOCKER_USERNAME}/${IMAGE_BASE_NAME}:${IMAGE_TAG}") ] } } From 9b73ddaba4b21649d8c4381cb5c5f1c0868184c9 Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:45:07 +0300 Subject: [PATCH 31/35] first --- pipelines/build.Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 9ef007e..32a4d9c 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -37,7 +37,8 @@ pipeline { stage('Build & Push') { steps { sh ''' - IMAGE_FULL_NAME = ${DOCKER_USERNAME}/${IMAGE_BASE_NAME}:${IMAGE_TAG} + + IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG docker build -t $IMAGE_FULL_NAME . From f329ba2c5c440ce98c6ac168f732f212ea029bea Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 11:46:41 +0300 Subject: [PATCH 32/35] first --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 32a4d9c..fe72c9f 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -50,7 +50,7 @@ pipeline { steps { build job: 'NetflixFrontendDeploy' , wait: false, parameters: [ string(name: 'SERVICE_NAME', value: "NetflixFrontend"), - string(name: 'IMAGE_FULL_NAME_PARAM', value: "${DOCKER_USERNAME}/${IMAGE_BASE_NAME}:${IMAGE_TAG}") + string(name: 'IMAGE_FULL_NAME_PARAM', value: "$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG") ] } } From 72024ad95eda3df5948ca7fdde86c4b1028e1d0a Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 13:40:51 +0300 Subject: [PATCH 33/35] first --- pipelines/build.Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index fe72c9f..53881a9 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -38,6 +38,7 @@ pipeline { steps { sh ''' + IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG From feb6af531eff7ae81701be4fbfb085f21263500e Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 13:50:22 +0300 Subject: [PATCH 34/35] first --- pipelines/test.Jenkinsfile | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 pipelines/test.Jenkinsfile diff --git a/pipelines/test.Jenkinsfile b/pipelines/test.Jenkinsfile new file mode 100644 index 0000000..9653ce4 --- /dev/null +++ b/pipelines/test.Jenkinsfile @@ -0,0 +1,44 @@ +pipeline { + agent any + + stages { + stage('Tests before build') { + parallel { + stage('Unittest') { + steps { + sh 'echo unittesting...' + } + } + stage('Lint') { + steps { + sh 'echo linting...' + } + } + } + } + stage('Build the app') { + steps { + sh 'echo building ....' + } + } + stage('Tests after build') { + parallel { + stage('Security vulnerabilities scanning') { + steps { + sh 'echo scanning for vulnerabilities...' + } + } + stage('API test') { + steps { + sh 'echo testing API...' + } + } + stage('Load test') { + steps { + sh 'echo testing under load...' + } + } + } + } + } +} \ No newline at end of file From 75133465c5e84efebf893e7622d60b2bf140958f Mon Sep 17 00:00:00 2001 From: ghazal Date: Wed, 3 Jul 2024 13:59:19 +0300 Subject: [PATCH 35/35] first --- k8s/deploymentFront.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/k8s/deploymentFront.yaml b/k8s/deploymentFront.yaml index 0e3a3ce..aaa5cf6 100644 --- a/k8s/deploymentFront.yaml +++ b/k8s/deploymentFront.yaml @@ -11,6 +11,7 @@ spec: - protocol: TCP port: 3000 targetPort: 3000 + #ghazalllllllllllllllllllllllllllllll ---