Bash scripting: A Bash Shell Script is a plain text file containing a set of various commands that we usually type in the command line. It is used to automate repetitive tasks on Linux filesystem. It might include a set of commands, or a single command. For example ,to install GIT we need to update the packages, then install git and check if installation is done using Linux commands. We can write all the command in a .sh file and we can execute the file to do all the steps mentioned above. Lets start with example from hello-world. 1.Open terminal and check the root of the bash using below command. CMD: which bash you can see path like /usr/bin/bash or /bin/bash . 2.Create a hello-world.sh file and paste the below lines. CMD: nano hello-world.sh You can see editor ,add below lines #!/bin/bash # declare MSG variable MSG="Hello World" # print variable on a screen echo $MSG To save the file use CTRL+X, then CTRL+Y and press ENTER 3. To execute the file we need to ad...
Get link
Facebook
X
Pinterest
Email
Other Apps
DevOps session 4: DevOps life cycle and Tools
Get link
Facebook
X
Pinterest
Email
Other Apps
-
Continuous Development -
This is the phase that involves ‘planning’ and ‘coding’ of the software. The vision of the project is decided during the planning phase and the developers begin developing the code for the application. There are no DevOps tools that are required for planning, but there are a number of tools for maintaining the code.
Tools:
Code maintain:Git, SVN, Mercurial, CVS, and JIRA.
Build tools: Ant, Maven, Gradle
Continuous Testing -
This is the stage where the developed software is continuously tested for bugs. For Continuous testing, automation testing tools are used. These tools allow QAs to test multiple code-bases thoroughly in parallel to ensure that there are no flaws in the functionality. In this phase, Docker Containers can be used for simulating the test environment.
Automation Tools: Selenium, Cypress, Python, TestNG, Pytest, Junit etc.
Continuous Integration -
This stage is the heart of the entire DevOps life cycle. It is a software development practice in which the developers require to commit changes to the source code more frequently. This may be on a daily or a weekly basis. Every commit is then built and this allows early detection of problems if they are present. Building code not only involves compilation but it also includes code review, unit testing, integration testing, and packaging.
The code supporting new functionality is continuously integrated with the existing code. Since there is continuous development of software, the updated code needs to be integrated continuously as well as smoothly with the systems to reflect changes to the end-users.
CI /CD Tools: Jenkins, Bamboo, Circle CI, GitHub actions, Gitlab.
Continuous Deployment -
This is the stage where the code is deployed to the production servers. It is also important to ensure that the code is correctly deployed on all the servers.
It is the act of releasing deployments to servers, scheduling updates on all servers and most importantly keeping the configurations consistent across all the servers.
Containerization tools also play an equally important role in the deployment stage. These tools help produce consistency across Development, Test, Staging and Production environments. Besides this, they also help in scaling-up and scaling-down of instances swiftly.
Containerization tools:Docker, Kubernetes and Vagrant
configuration management tools: Puppet, Chef, Salt Stack, and Ansible.
Continuous Monitoring -
This is a stage of the DevOps life cycle where you continuously monitor the performance of your application. Here vital information about the use of the software is recorded. This information is processed to recognize the proper functionality of the application. The system errors such as low memory, server not reachable, etc are resolved in this phase.
It maintains the security and availability of the services. They can also improve productivity and increase the reliability of the systems, which in turn reduces IT support costs. Any major issues if found are reported to the development team so that it can be fixed in the continuous development phase. This leads to a faster resolution of the problems.
Monitoring Tools: Splunk, ELK Stack, Nagios, NewRelic and Sensu.
OTHER SKILLS -
Linux basics
At least one programming language: Python, Java, Jscript, GO Lang etc.
Infrastructure Automation tools : Terraform and packer
Let us consider an example your in team where developer 1 working on feature1 , developer2 working on feature 2 etc. With out branching if the developers push and pull the code daily, which will leads to a confusion and code duplication or removal of code which might impact other features. So git provides an option to create multiple branches, So that each developer can create there own branch and then update the code, push code to their own branch ,finally merge with main branch. Eg: Developer 1 creates a new branch name: dev-login Developer 2 creates another branch name: dev-signup. So, Developer 1 and Developer 2 can work on their branch and once every thing is done. They will come together to merge the Login and signup branches to main. Git branching commands: 1. git branch: Use to display all the branches on currently working repo(in our example devopsDemo ) 2. git branch --show-current: Display the name of current working bra...
File commands: ls : Display the folders present in the current working directory. ls -al : formatted listing with hidden files mkdir – create a directory with provided name. cd devops – change directory to devops pwd – show current directory touch file – create or update file cat > file – places standard input into file/Create a new file and you can provide some text from console. Then to exit the file editting, click on CTRL+D. cat file – Display the file content in the console. cp file1 file2 – copy file1 to file2 cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it doesn’t exist mv file1 file2 – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2 rm file – delete file rm -r dir – delete directory dir Screen shots will be attached soon... Process Management ps – display your currently active processes top – display all running processes k...
Comments
Post a Comment