From 48ae8781119e94771e2706f58df599ae1c8a3670 Mon Sep 17 00:00:00 2001 From: lidor Date: Sun, 19 Jan 2025 16:40:24 +0200 Subject: [PATCH 01/33] try --- .github/workflows/cicd-build.yaml | 58 +++++++++++++++++++ .idea/.gitignore | 3 + .idea/NetflixFrontend.iml | 8 +++ .../inspectionProfiles/profiles_settings.xml | 6 ++ .idea/misc.xml | 7 +++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 ++ 7 files changed, 96 insertions(+) create mode 100644 .github/workflows/cicd-build.yaml 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 diff --git a/.github/workflows/cicd-build.yaml b/.github/workflows/cicd-build.yaml new file mode 100644 index 0000000..ae020cb --- /dev/null +++ b/.github/workflows/cicd-build.yaml @@ -0,0 +1,58 @@ +name: NetflixFronted Build + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + actions: read + +jobs: + Build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repo code + uses: actions/checkout@v3 + + - name: Build and push image + env: + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + run: | + if [ -z "$DOCKER_USERNAME" ] || [ -z "$DOCKER_PASSWORD" ]; then + echo "Your DockerHub username and password should be set as secrets!!" + exit 1 + fi + + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + + IMAGE_NAME=$DOCKER_USERNAME/netflix-frontend:${{ github.run_number }} + docker build -t $IMAGE_NAME . + docker push $IMAGE_NAME + + - name: Checkout infrastructure repo + uses: actions/checkout@v3 + with: + repository: lidorbashari/NetflixInfra + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + path: ./NetflixInfra + ref: main + + - name: Update YAML manifests + run: | + IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/netflix-frontend:${{ github.run_number }} + cd ./NetflixInfra/k8s/NetflixFrontend + yq e ".spec.template.spec.containers[0].image = \"$IMAGE_NAME\"" -i ./deployment.yaml + + + - name: Commit and Push changes + run: | + cd ./NetflixInfra + git config --local user.email "github@action" + git config --local user.name "auto-update" + git add k8s/NetflixMovieCatalog/deployment.yaml + git commit -m "Update image to $IMAGE_NAME" + git push origin main 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..f571432 --- /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..db8786c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ 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 From 793215cbd6c51fbfb1c340c1734e7215d340b2dc Mon Sep 17 00:00:00 2001 From: lidor Date: Sun, 19 Jan 2025 16:43:05 +0200 Subject: [PATCH 02/33] try --- .github/workflows/cicd-build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cicd-build.yaml b/.github/workflows/cicd-build.yaml index ae020cb..dc6bb86 100644 --- a/.github/workflows/cicd-build.yaml +++ b/.github/workflows/cicd-build.yaml @@ -47,6 +47,7 @@ jobs: cd ./NetflixInfra/k8s/NetflixFrontend yq e ".spec.template.spec.containers[0].image = \"$IMAGE_NAME\"" -i ./deployment.yaml + - name: Commit and Push changes run: | From 7f90fb94f200f1595039daf15cf631ea02f98964 Mon Sep 17 00:00:00 2001 From: lidor Date: Thu, 23 Jan 2025 15:03:33 +0200 Subject: [PATCH 03/33] try --- .github/workflows/{cicd-build.yaml => build.yaml} | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) rename .github/workflows/{cicd-build.yaml => build.yaml} (87%) diff --git a/.github/workflows/cicd-build.yaml b/.github/workflows/build.yaml similarity index 87% rename from .github/workflows/cicd-build.yaml rename to .github/workflows/build.yaml index dc6bb86..bbdaea2 100644 --- a/.github/workflows/cicd-build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: NetflixFronted Build +name: NetflixFrontend Build on: push: @@ -23,7 +23,7 @@ jobs: DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} run: | if [ -z "$DOCKER_USERNAME" ] || [ -z "$DOCKER_PASSWORD" ]; then - echo "Your DockerHub username and password should be set as secrets!!" + echo "Your DockerHub username and password should be set as secrets!!" exit 1 fi @@ -44,16 +44,15 @@ jobs: - name: Update YAML manifests run: | IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/netflix-frontend:${{ github.run_number }} - cd ./NetflixInfra/k8s/NetflixFrontend + cd ./NetflixInfra/k8s/NetflixFrontend yq e ".spec.template.spec.containers[0].image = \"$IMAGE_NAME\"" -i ./deployment.yaml - - name: Commit and Push changes run: | cd ./NetflixInfra git config --local user.email "github@action" git config --local user.name "auto-update" - git add k8s/NetflixMovieCatalog/deployment.yaml + git add k8s/NetflixFrontend/deployment.yaml git commit -m "Update image to $IMAGE_NAME" git push origin main From 2041786f97a2e8bc4b4963685a2489eca48f3f86 Mon Sep 17 00:00:00 2001 From: lidor Date: Thu, 23 Jan 2025 15:05:55 +0200 Subject: [PATCH 04/33] try --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bbdaea2..fa2aef8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,7 +30,7 @@ jobs: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin IMAGE_NAME=$DOCKER_USERNAME/netflix-frontend:${{ github.run_number }} - docker build -t $IMAGE_NAME . + docker build -t $IMAGE_NAME .. docker push $IMAGE_NAME - name: Checkout infrastructure repo From 221ab0a3450a0c262634b51f250f312983164a9c Mon Sep 17 00:00:00 2001 From: lidor Date: Thu, 23 Jan 2025 15:07:37 +0200 Subject: [PATCH 05/33] try --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fa2aef8..517d1a7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,8 +29,8 @@ jobs: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - IMAGE_NAME=$DOCKER_USERNAME/netflix-frontend:${{ github.run_number }} - docker build -t $IMAGE_NAME .. + IMAGE_NAME=$DOCKER_USERNAME/nf:${{ github.run_number }} + docker build -t $IMAGE_NAME . docker push $IMAGE_NAME - name: Checkout infrastructure repo @@ -43,7 +43,7 @@ jobs: - name: Update YAML manifests run: | - IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/netflix-frontend:${{ github.run_number }} + IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/nf:${{ github.run_number }} cd ./NetflixInfra/k8s/NetflixFrontend yq e ".spec.template.spec.containers[0].image = \"$IMAGE_NAME\"" -i ./deployment.yaml From 2405ea997b14770fed2e817c0bf91c91484185c2 Mon Sep 17 00:00:00 2001 From: lidor Date: Thu, 23 Jan 2025 15:14:06 +0200 Subject: [PATCH 06/33] try --- .github/workflows/build.yaml | 4 ++-- Dockerfile | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 517d1a7..bbdaea2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,7 +29,7 @@ jobs: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - IMAGE_NAME=$DOCKER_USERNAME/nf:${{ github.run_number }} + IMAGE_NAME=$DOCKER_USERNAME/netflix-frontend:${{ github.run_number }} docker build -t $IMAGE_NAME . docker push $IMAGE_NAME @@ -43,7 +43,7 @@ jobs: - name: Update YAML manifests run: | - IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/nf:${{ github.run_number }} + IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/netflix-frontend:${{ github.run_number }} cd ./NetflixInfra/k8s/NetflixFrontend yq e ".spec.template.spec.containers[0].image = \"$IMAGE_NAME\"" -i ./deployment.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d337315 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:14.0.0-buster +WORKDIR /app +COPY . . +RUN npm install +RUN npm run build +CMD ["npm", "start"] \ No newline at end of file From e85005cd28f1617ae2fdfbb52c8061d439f3eb33 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Thu, 6 Mar 2025 16:36:10 +0200 Subject: [PATCH 07/33] build jenkins file --- pipelines/build.Jenkinsfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 pipelines/build.Jenkinsfile diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile new file mode 100644 index 0000000..d0c005c --- /dev/null +++ b/pipelines/build.Jenkinsfile @@ -0,0 +1,25 @@ +// 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 . + ''' + } + } + } +} \ No newline at end of file From 1b0c632c2a180ae3e8fdde3202845160f9fad5db Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Thu, 6 Mar 2025 17:10:13 +0200 Subject: [PATCH 08/33] build jenkins file --- pipelines/build.Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index d0c005c..014e2e2 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -11,10 +11,6 @@ pipeline { 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 fddf8e171658e5a4492dcf9e3434aeee24c82982 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Thu, 6 Mar 2025 17:19:01 +0200 Subject: [PATCH 09/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 014e2e2..6b27508 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,7 +12,7 @@ pipeline { steps { sh ''' - # build an image + # build an imagek docker build -t netflix-front . ''' } From 4cf28ac654b4b82b29566ba9bdc75f1852832c93 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Thu, 6 Mar 2025 17:20:03 +0200 Subject: [PATCH 10/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6b27508..014e2e2 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,7 +12,7 @@ pipeline { steps { sh ''' - # build an imagek + # build an image docker build -t netflix-front . ''' } From f50ee9bcae57d6314ad49a9a7633070d1ede7764 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Thu, 6 Mar 2025 17:23:28 +0200 Subject: [PATCH 11/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 014e2e2..f327f31 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Build app container') { steps { sh ''' - + ls # build an image docker build -t netflix-front . ''' From d6ec308d9fed0bc3748be01a1d1efe8bd9bfe819 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Thu, 6 Mar 2025 17:30:53 +0200 Subject: [PATCH 12/33] build jenkins file --- pipelines/build.Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index f327f31..9769827 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,6 +12,7 @@ pipeline { steps { sh ''' ls + echo hi # build an image docker build -t netflix-front . ''' From 19a51a555ee3950c71a52ed83d8ff43570cf08e7 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 11:22:34 +0200 Subject: [PATCH 13/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 9769827..996cac3 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -12,7 +12,7 @@ pipeline { steps { sh ''' ls - echo hi + echo hii # build an image docker build -t netflix-front . ''' From 57e78f72aa2b3a6a49891d96aa68ceba49eafe51 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 13:37:24 +0200 Subject: [PATCH 14/33] build jenkins file --- pipelines/build.Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 996cac3..473a372 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -1,7 +1,9 @@ // pipelines/build.Jenkinsfile pipeline { - agent any + agent { + label 'general' + } triggers { githubPush() From 7e988a60865c719917a436a2684c7ceed7e33331 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 13:58:40 +0200 Subject: [PATCH 15/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 473a372..1a47950 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -14,7 +14,7 @@ pipeline { steps { sh ''' ls - echo hii + echo hii lidi # build an image docker build -t netflix-front . ''' From 508e6e393e3c221d3bc29ae0fe971139ab47bbea Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 16:26:08 +0200 Subject: [PATCH 16/33] build jenkins file --- pipelines/build.Jenkinsfile | 40 ++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 1a47950..6348a84 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -1,22 +1,44 @@ -// pipelines/build.Jenkinsfile - pipeline { agent { - label 'general' + label 'general' } triggers { - githubPush() + githubPush() // trigger the pipeline upon push event in github + } + + options { + timeout(time: 10, unit: 'MINUTES') // discard the build after 10 minutes of running + timestamps() // display timestamp in console output + } + + 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-frontend" + + DOCKER_CREDS = credentials('dockerhub') + DOCKER_USERNAME = "${DOCKER_CREDS_USR}" // The _USR suffix added to access the username value + DOCKER_PASS = "${DOCKER_CREDS_PSW}" // The _PSW suffix added to access the password value } stages { - stage('Build app container') { + stage('Docker setup') { steps { sh ''' - ls - echo hii lidi - # build an image - docker build -t netflix-front . + docker login -u $DOCKER_USERNAME -p $DOCKER_PASS + ''' + } + } + + stage('Build & Push') { + steps { + sh ''' + IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG + docker build --push -t $IMAGE_FULL_NAME . + ''' } } From 8fcd5fe60670fccce553b41e74d2980665b684b3 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 19:00:32 +0200 Subject: [PATCH 17/33] build jenkins file --- pipelines/build.Jenkinsfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 6348a84..0a4d2d4 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -42,5 +42,12 @@ pipeline { ''' } } - } + stage('Trigger Deploy') { + steps { + build job: 'front-deploy', wait: false, parameters: [ + string(name: 'SERVICE_NAME', value: "NetflixFrontend"), + string(name: 'IMAGE_FULL_NAME_PARAM', value: "$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG") + ] + } + } } \ No newline at end of file From 77c9146e26c51a509cbc399e0286c740004a726d Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 19:01:54 +0200 Subject: [PATCH 18/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 0a4d2d4..acdc1fe 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -50,4 +50,4 @@ pipeline { ] } } -} \ No newline at end of file + } \ No newline at end of file From b66d50085dfe5c97aad1064182c842bc4f5cdc15 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 19:03:35 +0200 Subject: [PATCH 19/33] build jenkins file --- pipelines/build.Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index acdc1fe..67639be 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -50,4 +50,5 @@ pipeline { ] } } - } \ No newline at end of file + } +} \ No newline at end of file From 19535ead654cade90bae13e5a9861941e621c6fc Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 11 Mar 2025 19:05:30 +0200 Subject: [PATCH 20/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 67639be..16242b0 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -9,7 +9,7 @@ pipeline { options { timeout(time: 10, unit: 'MINUTES') // discard the build after 10 minutes of running - timestamps() // display timestamp in console output + timestamps() // display timestamp in console outputs } environment { From 395cc67c17bf961ce46c2734db8f70ca959a705d Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Mon, 17 Mar 2025 12:01:47 +0200 Subject: [PATCH 21/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 16242b0..de0f309 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -44,7 +44,7 @@ pipeline { } stage('Trigger Deploy') { steps { - build job: 'front-deploy', wait: false, parameters: [ + build job: 'frontend-deploy', wait: false, parameters: [ string(name: 'SERVICE_NAME', value: "NetflixFrontend"), string(name: 'IMAGE_FULL_NAME_PARAM', value: "$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG") ] From f4cd3e6fb8623d0dfc15ebec94b2856711915528 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Mon, 17 Mar 2025 12:08:01 +0200 Subject: [PATCH 22/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index de0f309..3c05089 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -20,7 +20,7 @@ pipeline { IMAGE_BASE_NAME = "netflix-frontend" DOCKER_CREDS = credentials('dockerhub') - DOCKER_USERNAME = "${DOCKER_CREDS_USR}" // The _USR suffix added to access the username value + DOCKER_USERNAME = "${DOCKER_CREDS_USR}" // The _USR suffix added to access the username value s DOCKER_PASS = "${DOCKER_CREDS_PSW}" // The _PSW suffix added to access the password value } From 19e625aff1f93066dc7a85caad040d337545c67b Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Mon, 17 Mar 2025 13:06:53 +0200 Subject: [PATCH 23/33] build jenkins file --- pipelines/build.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build.Jenkinsfile b/pipelines/build.Jenkinsfile index 3c05089..de0f309 100644 --- a/pipelines/build.Jenkinsfile +++ b/pipelines/build.Jenkinsfile @@ -20,7 +20,7 @@ pipeline { IMAGE_BASE_NAME = "netflix-frontend" DOCKER_CREDS = credentials('dockerhub') - DOCKER_USERNAME = "${DOCKER_CREDS_USR}" // The _USR suffix added to access the username value s + DOCKER_USERNAME = "${DOCKER_CREDS_USR}" // The _USR suffix added to access the username value DOCKER_PASS = "${DOCKER_CREDS_PSW}" // The _PSW suffix added to access the password value } From 55687d2d89435d04a750e1482ee1d0083cf9be0e Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Sun, 23 Mar 2025 12:30:51 +0200 Subject: [PATCH 24/33] test jenkins file --- pipelines/test.Jenkinsfile | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pipelines/test.Jenkinsfile diff --git a/pipelines/test.Jenkinsfile b/pipelines/test.Jenkinsfile new file mode 100644 index 0000000..94a57e0 --- /dev/null +++ b/pipelines/test.Jenkinsfile @@ -0,0 +1,46 @@ +pipeline { + agent { + label 'general' + } + + stages { + stage('Tests before build') { + parallel { + stage('Unittest') { + steps { + sh 'echo unittesting...' + } + } + stage('Lint') { + steps { + sh 'echo linting...' + } + } + } + } + stage('Build and deploy to Test environment') { + steps { + sh 'echo trigger build and deploy pipelines for test environment... wait until successful deployment' + } + } + 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 3c4c2306e4dbafe1446a9d20f7d217824a0811d2 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Sun, 23 Mar 2025 12:42:35 +0200 Subject: [PATCH 25/33] change author name --- components/Footer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index 67f7b1c..0ac1be7 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -8,7 +8,7 @@ export default function Footer() {

Made by{' '} - Ayushi Gupta + Ayushi Gupta and lidor

From 0d0d34c62c34aa1c3e0162df580c1c909ff44919 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Sun, 23 Mar 2025 12:48:59 +0200 Subject: [PATCH 26/33] change author name --- components/Footer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index 0ac1be7..b74cd8c 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -8,7 +8,7 @@ export default function Footer() {

Made by{' '} - Ayushi Gupta and lidor + Ayushi Gupta and lidor bashari

From 74587a29c9522be44823103d3573731039b144e3 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Sun, 23 Mar 2025 13:10:39 +0200 Subject: [PATCH 27/33] change author name --- components/Footer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index b74cd8c..9419b46 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -8,7 +8,7 @@ export default function Footer() {

Made by{' '} - Ayushi Gupta and lidor bashari + Ayushi Gupta and lidor bashari hamelech

From 872cad22ca3d5e34ce2a9bf1bb44ae7f92da1de6 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 25 Mar 2025 17:50:07 +0200 Subject: [PATCH 28/33] implement build pipeline --- pipelines/build-dev.Jenkinsfile | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 pipelines/build-dev.Jenkinsfile diff --git a/pipelines/build-dev.Jenkinsfile b/pipelines/build-dev.Jenkinsfile new file mode 100644 index 0000000..99f476e --- /dev/null +++ b/pipelines/build-dev.Jenkinsfile @@ -0,0 +1,54 @@ +pipeline { + agent { + label 'general' + } + + triggers { + githubPush() // trigger the pipeline upon push event in github + } + + options { + timeout(time: 10, unit: 'MINUTES') // discard the build after 10 minutes of running + timestamps() // display timestamp in console outputs + } + + 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-frontend-dev" + + DOCKER_CREDS = credentials('dockerhub') + DOCKER_USERNAME = "${DOCKER_CREDS_USR}" // The _USR suffix added to access the username value + DOCKER_PASS = "${DOCKER_CREDS_PSW}" // The _PSW suffix added to access the password value + } + + stages { + stage('Docker setup') { + steps { + sh ''' + docker login -u $DOCKER_USERNAME -p $DOCKER_PASS + ''' + } + } + + stage('Build & Push') { + steps { + sh ''' + IMAGE_FULL_NAME=$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG + docker build --push -t $IMAGE_FULL_NAME . + + ''' + } + } + stage('Trigger Deploy') { + steps { + build job: 'frontend-deploy-dev', wait: false, parameters: [ + string(name: 'SERVICE_NAME', value: "NetflixFrontend"), + string(name: 'IMAGE_FULL_NAME_PARAM', value: "$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG") + ] + } + } + } +} \ No newline at end of file From f740431059dc33f4bfc77b09ad57db10298adf2f Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Tue, 25 Mar 2025 19:01:22 +0200 Subject: [PATCH 29/33] implement build pipeline --- pipelines/build-dev.Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build-dev.Jenkinsfile b/pipelines/build-dev.Jenkinsfile index 99f476e..86e8ce1 100644 --- a/pipelines/build-dev.Jenkinsfile +++ b/pipelines/build-dev.Jenkinsfile @@ -45,7 +45,7 @@ pipeline { stage('Trigger Deploy') { steps { build job: 'frontend-deploy-dev', wait: false, parameters: [ - string(name: 'SERVICE_NAME', value: "NetflixFrontend"), + string(name: 'SERVICE_NAME', value: "NetflixFrontendDev"), string(name: 'IMAGE_FULL_NAME_PARAM', value: "$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG") ] } From 7b4df3c317d0972a5b9b59d599414b30034e049d Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Fri, 28 Mar 2025 09:42:17 +0300 Subject: [PATCH 30/33] change author name --- components/Footer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index 9419b46..974c966 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -8,7 +8,7 @@ export default function Footer() {

Made by{' '} - Ayushi Gupta and lidor bashari hamelech + Ayushi Gupta!!!

From e4a0cfd58ef75f4e67815b38e49c6b949ce81a5e Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Fri, 28 Mar 2025 09:45:03 +0300 Subject: [PATCH 31/33] change name! --- components/Footer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index 974c966..fb0167f 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -8,7 +8,7 @@ export default function Footer() {

Made by{' '} - Ayushi Gupta!!! + Ayushi Gupta!!!!!

From b4b872fbefa6c11707ba29a6b827d42acb9c2b3d Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Fri, 28 Mar 2025 09:48:28 +0300 Subject: [PATCH 32/33] change auyhor and add my name --- components/Footer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index fb0167f..567071c 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -8,7 +8,7 @@ export default function Footer() {

Made by{' '} - Ayushi Gupta!!!!! + Ayushi Gupta!!!!! and lidi

From f40c49b45480f7e7026aee2d82199f30d303ba54 Mon Sep 17 00:00:00 2001 From: lidorbashari Date: Fri, 28 Mar 2025 10:12:31 +0300 Subject: [PATCH 33/33] change auyhor and add my name again --- components/Footer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index 567071c..4b4befc 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -8,7 +8,7 @@ export default function Footer() {

Made by{' '} - Ayushi Gupta!!!!! and lidi + Ayushi Gupta!!!!! and lidor