From 6bfbb929107bd286b22a216c4eab02a1911ec2db Mon Sep 17 00:00:00 2001 From: dipalikulshrestha <38211382+dipalikulshrestha@users.noreply.github.com> Date: Wed, 2 Jun 2021 22:10:42 +0530 Subject: [PATCH 1/2] Add files via upload This Branch 01_03b contains the initial code package to be downloaded to follow along with the course. --- CodeDeployConfig.md | 22 ++ appspec.yml | 30 +++ buildspec.yml | 20 ++ index.html | 392 ++++++++++++++++++++++++++++++++ scripts/after_install.sh | 5 + scripts/install_dependencies.sh | 3 + scripts/start_server.sh | 3 + scripts/stop_server.sh | 6 + scripts/validate_service.sh | 4 + 9 files changed, 485 insertions(+) create mode 100644 CodeDeployConfig.md create mode 100644 appspec.yml create mode 100644 buildspec.yml create mode 100644 index.html create mode 100644 scripts/after_install.sh create mode 100644 scripts/install_dependencies.sh create mode 100644 scripts/start_server.sh create mode 100644 scripts/stop_server.sh create mode 100644 scripts/validate_service.sh diff --git a/CodeDeployConfig.md b/CodeDeployConfig.md new file mode 100644 index 0000000..2594297 --- /dev/null +++ b/CodeDeployConfig.md @@ -0,0 +1,22 @@ + +# Installing the CodeDeploy agent on EC2 +``` +sudo yum update -y +sudo yum install -y ruby wget +wget https://aws-codedeploy-eu-west-1.s3.eu-west-1.amazonaws.com/latest/install +chmod +x ./install +sudo ./install auto +sudo service codedeploy-agent status +``` + + +# create a bucket and enable versioning +``` +aws s3 mb s3://aws-devops-cicddemo --region us-east-1 --profile aws-devops +aws s3api put-bucket-versioning --bucket aws-devops-cicddemo --versioning-configuration Status=Enabled --region us-east-1 --profile aws-devops +``` + +# deploy the files into S3 +``` +aws deploy push --application-name CodeDeployDemo --s3-location s3://aws-devops-cicddemo/codedeploy-demo/app.zip --ignore-hidden-files --region us-east-1 --profile aws-devops +``` \ No newline at end of file diff --git a/appspec.yml b/appspec.yml new file mode 100644 index 0000000..29b964f --- /dev/null +++ b/appspec.yml @@ -0,0 +1,30 @@ +version: 0.0 +os: linux +files: + - source: /index.html + destination: /var/www/html/ +hooks: + ApplicationStop: + - location: scripts/stop_server.sh + timeout: 300 + runas: root + + BeforeInstall: + - location: scripts/install_dependencies.sh + timeout: 300 + runas: root + + AfterInstall: + - location: scripts/after_install.sh + timeout: 300 + runas: root + + ApplicationStart: + - location: scripts/start_server.sh + timeout: 300 + runas: root + + ValidateService: + - location: scripts/validate_service.sh + timeout: 300 + diff --git a/buildspec.yml b/buildspec.yml new file mode 100644 index 0000000..607a2bb --- /dev/null +++ b/buildspec.yml @@ -0,0 +1,20 @@ +version: 0.2 + +phases: + install: + runtime-versions: + nodejs: 10 + commands: + - echo "installing something" + pre_build: + commands: + - echo "This is the pre build phase" + build: + commands: + - echo "This is the build phase" + - echo "Here we can run some tests" + - grep -Fq "Welcome" index.html + post_build: + commands: + - echo "This is the post build phase" + diff --git a/index.html b/index.html new file mode 100644 index 0000000..dea384d --- /dev/null +++ b/index.html @@ -0,0 +1,392 @@ + + +DevOps with AWS + + + + + + + + + +
+
+ LOGO + + + + + + + +
+
+ + + + + +
+
+ Welcome to DevOps with AWS
+ Start something that matters
+ This application is deployed using AWS CodeDeploy +

Learn more and start today

+
+
+ + + + + + +
+
+ + +
+

ABOUT THE COMPANY

+

Key features of our company

+
+
+ +

Responsive

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.

+
+
+ +

Passion

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.

+
+
+ +

Design

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.

+
+
+ +

Support

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.

+
+
+
+ + +
+
+
+

We know design.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore.

+

  View Our Works

+
+
+ Buildings +
+
+
+ + +
+

THE TEAM

+

The ones who runs this company

+
+
+
+ John +
+

John Doe

+

CEO & Founder

+

Phasellus eget enim eu lectus faucibus vestibulum. Suspendisse sodales pellentesque elementum.

+

+
+
+
+
+
+ Jane +
+

Anja Doe

+

Art Director

+

Phasellus eget enim eu lectus faucibus vestibulum. Suspendisse sodales pellentesque elementum.

+

+
+
+
+
+
+ Mike +
+

Mike Ross

+

Web Designer

+

Phasellus eget enim eu lectus faucibus vestibulum. Suspendisse sodales pellentesque elementum.

+

+
+
+
+
+
+ Dan +
+

Dan Star

+

Designer

+

Phasellus eget enim eu lectus faucibus vestibulum. Suspendisse sodales pellentesque elementum.

+

+
+
+
+
+
+ + +
+
+ 14+ +
Partners +
+
+ 55+ +
Projects Done +
+
+ 89+ +
Happy Clients +
+
+ 150+ +
Meetings +
+
+ + +
+

OUR WORK

+

What we've done for people

+ +
+
+ A microphone +
+
+ A phone +
+
+ A drone +
+
+ Soundbox +
+
+ +
+
+ A tablet +
+
+ A camera +
+
+ A typewriter +
+
+ A tableturner +
+
+
+ + +
+ × +
+ +

+
+
+ + +
+
+
+

Our Skills.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore et dolore.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore et dolore.

+
+
+

Photography

+
+
90%
+
+

Web Design

+
+
85%
+
+

Photoshop

+
+
75%
+
+
+
+
+ + +
+

PRICING

+

Choose a pricing plan that fits your needs.

+
+
+
    +
  • Basic
  • +
  • 10GB Storage
  • +
  • 10 Emails
  • +
  • 10 Domains
  • +
  • Endless Support
  • +
  • +

    $ 10

    + per month +
  • +
  • + +
  • +
+
+
+
    +
  • Pro
  • +
  • 25GB Storage
  • +
  • 25 Emails
  • +
  • 25 Domains
  • +
  • Endless Support
  • +
  • +

    $ 25

    + per month +
  • +
  • + +
  • +
+
+
+
    +
  • Premium
  • +
  • 50GB Storage
  • +
  • 50 Emails
  • +
  • 50 Domains
  • +
  • Endless Support
  • +
  • +

    $ 50

    + per month +
  • +
  • + +
  • +
+
+
+
+ + +
+

CONTACT

+

Lets get in touch. Send us a message:

+
+

Chicago, US

+

Phone: +00 151515

+

Email: mail@mail.com

+
+
+

+

+

+

+

+ +

+
+ + +
+
+ + + + + + + + diff --git a/scripts/after_install.sh b/scripts/after_install.sh new file mode 100644 index 0000000..e7935e8 --- /dev/null +++ b/scripts/after_install.sh @@ -0,0 +1,5 @@ +#!/bin/bash +EC2_INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) +EC2_AZ=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone) +sed -i "s/is deployed/is deployed on $EC2_INSTANCE_ID in $EC2_AZ/g" /var/www/html/index.html +chmod 664 /var/www/html/index.html \ No newline at end of file diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh new file mode 100644 index 0000000..3d37299 --- /dev/null +++ b/scripts/install_dependencies.sh @@ -0,0 +1,3 @@ +#!/bin/bash +yum install -y httpd + diff --git a/scripts/start_server.sh b/scripts/start_server.sh new file mode 100644 index 0000000..203194f --- /dev/null +++ b/scripts/start_server.sh @@ -0,0 +1,3 @@ +#!/bin/bash +service httpd start + diff --git a/scripts/stop_server.sh b/scripts/stop_server.sh new file mode 100644 index 0000000..00c3e3c --- /dev/null +++ b/scripts/stop_server.sh @@ -0,0 +1,6 @@ +#!/bin/bash +isExistApp = `pgrep httpd` +if [[ -n $isExistApp ]]; then + service httpd stop +fi + diff --git a/scripts/validate_service.sh b/scripts/validate_service.sh new file mode 100644 index 0000000..2a151dd --- /dev/null +++ b/scripts/validate_service.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# verify we can access our webpage successfully +curl -v --silent localhost:80 2>&1 | grep Welcome \ No newline at end of file From 9012151efdc340c374d12cbc6c107a3f004778ea Mon Sep 17 00:00:00 2001 From: smoser-LiL Date: Tue, 20 Jul 2021 20:08:38 +0000 Subject: [PATCH 2/2] Moving files using main --- README.md | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b42fd25..500ef6d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ -# COURSENAME -This is the repository for the LinkedIn Learning course `course-name`. The full course is available from [LinkedIn Learning][lil-course-url]. +# DevOps with AWS +This is the repository for the LinkedIn Learning course DevOps with AWS. The full course is available from [LinkedIn Learning][lil-course-url]. -![course-name-alt-text][lil-thumbnail-url] +![DevOps with AWS][lil-thumbnail-url] + +DevOps describes a culture and set of processes that bring development and operations teams together to simplify software development. It allows organizations to create and improve products at a faster pace than they can deliver with traditional software development approaches. And it’s gaining in popularity at a rapid rate. In this course, programmer Dipali Kulshrestha covers the concepts of DevOps with hands-on demos to create and automate CI/CD (continuous implementation and continuous delivery) pipelines. She covers AWS services like CodeCommit, CodeBuild, CodeDeploy, and CodePipeline, and how to implement DevOps with AWS offerings to increase security, scalability, reliability, and simplicity of the development processes. -_See the readme file in the main branch for updated instructions and information._ ## Instructions This repository has branches for each of the videos in the course. You can use the branch pop up menu in github to switch to a specific branch and take a look at the course at that stage, or you can add `/tree/BRANCH_NAME` to the URL to go to the branch you want to access. @@ -11,15 +12,25 @@ This repository has branches for each of the videos in the course. You can use t The branches are structured to correspond to the videos in the course. The naming convention is `CHAPTER#_MOVIE#`. As an example, the branch named `02_03` corresponds to the second chapter and the third video in that chapter. Some branches will have a beginning and an end state. These are marked with the letters `b` for "beginning" and `e` for "end". The `b` branch contains the code as it is at the beginning of the movie. The `e` branch contains the code as it is at the end of the movie. The `main` branch holds the final state of the code when in the course. -## Installing -1. To use these exercise files, you must have the following installed: - - [list of requirements for course] -2. Clone this repository into your local machine using the terminal (Mac), CMD (Windows), or a GUI tool like SourceTree. -3. [Course-specific instructions] +When switching from one exercise files branch to the next after making changes to the files, you may get a message like this: + + error: Your local changes to the following files would be overwritten by checkout: [files] + Please commit your changes or stash them before you switch branches. + Aborting + +To resolve this issue: + + Add changes to git using this command: git add . + Commit changes using this command: git commit -m "some message" + + +### Instructor -[0]: # (Replace these placeholder URLs with actual course URLs) +Dipali Kulshrestha + -[lil-course-url]: https://www.linkedin.com/learning/ -[lil-thumbnail-url]: http:// +Check out my other courses on [LinkedIn Learning](https://www.linkedin.com/learning/instructors/dipali-kulshrestha). +[lil-course-url]: https://www.linkedin.com/learning/devops-with-aws +[lil-thumbnail-url]: https://cdn.lynda.com/course/2886059/2886059-1626198010037-16x9.jpg