Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
48ae878
try
lidorbashari Jan 19, 2025
793215c
try
lidorbashari Jan 19, 2025
7f90fb9
try
lidorbashari Jan 23, 2025
2041786
try
lidorbashari Jan 23, 2025
221ab0a
try
lidorbashari Jan 23, 2025
2405ea9
try
lidorbashari Jan 23, 2025
e85005c
build jenkins file
lidorbashari Mar 6, 2025
1b0c632
build jenkins file
lidorbashari Mar 6, 2025
fddf8e1
build jenkins file
lidorbashari Mar 6, 2025
4cf28ac
build jenkins file
lidorbashari Mar 6, 2025
f50ee9b
build jenkins file
lidorbashari Mar 6, 2025
d6ec308
build jenkins file
lidorbashari Mar 6, 2025
19a51a5
build jenkins file
lidorbashari Mar 11, 2025
57e78f7
build jenkins file
lidorbashari Mar 11, 2025
7e988a6
build jenkins file
lidorbashari Mar 11, 2025
508e6e3
build jenkins file
lidorbashari Mar 11, 2025
8fcd5fe
build jenkins file
lidorbashari Mar 11, 2025
77c9146
build jenkins file
lidorbashari Mar 11, 2025
b66d500
build jenkins file
lidorbashari Mar 11, 2025
19535ea
build jenkins file
lidorbashari Mar 11, 2025
395cc67
build jenkins file
lidorbashari Mar 17, 2025
f4cd3e6
build jenkins file
lidorbashari Mar 17, 2025
19e625a
build jenkins file
lidorbashari Mar 17, 2025
55687d2
test jenkins file
lidorbashari Mar 23, 2025
3c4c230
change author name
lidorbashari Mar 23, 2025
0d0d34c
change author name
lidorbashari Mar 23, 2025
74587a2
change author name
lidorbashari Mar 23, 2025
872cad2
implement build pipeline
lidorbashari Mar 25, 2025
f740431
implement build pipeline
lidorbashari Mar 25, 2025
730a325
Merge pull request #2 from lidorbashari/feature/build_pipeline_for_dev
lidorbashari Mar 25, 2025
7b4df3c
change author name
lidorbashari Mar 28, 2025
9624432
Merge branch 'dev' into feature/change_aouthur_name
lidorbashari Mar 28, 2025
e4a0cfd
change name!
lidorbashari Mar 28, 2025
b4b872f
change auyhor and add my name
lidorbashari Mar 28, 2025
f40c49b
change auyhor and add my name again
lidorbashari Mar 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: NetflixFrontend 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/NetflixFrontend/deployment.yaml
git commit -m "Update image to $IMAGE_NAME"
git push origin main
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/NetflixFrontend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:14.0.0-buster
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function Footer() {
<p>
Made by{' '}
<a href='https://github.com/ayushiee/nextflix' target='_blank' rel='noreferrer'>
<b>Ayushi Gupta</b>
<b>Ayushi Gupta!!!!! and lidor</b>
</a>
</p>
</div>
Expand Down
54 changes: 54 additions & 0 deletions pipelines/build-dev.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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: "NetflixFrontendDev"),
string(name: 'IMAGE_FULL_NAME_PARAM', value: "$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG")
]
}
}
}
}
54 changes: 54 additions & 0 deletions pipelines/build.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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"

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', wait: false, parameters: [
string(name: 'SERVICE_NAME', value: "NetflixFrontend"),
string(name: 'IMAGE_FULL_NAME_PARAM', value: "$DOCKER_USERNAME/$IMAGE_BASE_NAME:$IMAGE_TAG")
]
}
}
}
}
46 changes: 46 additions & 0 deletions pipelines/test.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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...'
}
}
}
}
}
}