fix(guide): simplify directory structure

This commit is contained in:
Mrugesh Mohapatra
2018-10-16 21:26:13 +05:30
parent f989c28c52
commit da0df12ab7
35752 changed files with 0 additions and 317652 deletions

View File

@ -0,0 +1,63 @@
---
title: Ansible
---
## Ansible
Ansible is a simple to use automation tool. Ansible can be used to automate deployments, updates, security, systems management, container provisioning and more. The configuration files are easy to manage YAML files written in plain English. Installation is simple and due its Master-Push format, there are no agents needed on remote machines. Communications with remote machines is via SSH.
### Installation on Ubuntu Servers 14.04 or newer
Installation via the Ansible PPA on Ubuntu servers is recommended.
First make sure your system is up to date.
```
$ sudo apt-get update
$ sudo apt-get upgrade
```
Next you will want to add the following package to your system
```
$ sudo apt-get install software-properties-common
```
Add the ppa:ansible/ansible to your system
```
$ sudo apt-add-repository ppa:ansible/ansible
```
Update your repos again
```
$ sudo apt-get update
```
There are usually a few steps involved in deploying your code into production (to the live site). The number of steps increases as your Site/App/Webapp becomes larger and more complex.
The solution to this is automated deployment. Automation comes in the form of scripts that act as a set of instructions (just as all code does) outlining each of these steps.
Ansible is an automation tool, often used for deployment as mentioned above, but increasingly used for other complex automations.
It uses a language called <a href='https://en.wikipedia.org/wiki/YAML' target='_blank' rel='nofollow'>YAML</a> which allows you to describe the instuctions close to plain english, as you can see in this Ansible module example:
```YAML
---
- yum: name={{contact.item}} state=installed
with_items:
- app_server
- acme_software
- service: name=app_server state=running enabled=yes
```
Finally, Install the package
```
$ sudo apt-get install ansible
```
A significant benefit of using Ansible is that it uses SSH (Secure SHell) by default, and the modules can reside on any machine (computer) not requiring servers, daemons or databases.
The true power of Ansible is in using playbooks. Read more about configuration and use of Ansible on [Ansible's official documentation](https://docs.ansible.com/ansible/latest/index.html).
Ansible modules, which are small task specific programs. Once they serve there intended purpose e.g. running your deploy script, these modules are removed by Ansible.
#### More Information:
- [Learn more about how Ansible works](https://www.ansible.com/how-ansible-works/)
- [Ansible documentation](http://docs.ansible.com/)

View File

@ -0,0 +1,20 @@
---
title: Azure DevOps
---
## Azure DevOps
Azure DevOps Services is a cloud service for collaborating on code development. It provides an integrated set of features that you access through your web browser or IDE client, including the following:
* Git repositories for source control of your code
* Build and release management to support continuous integration and delivery of your apps
* Agile tools to support planning and tracking your work, code defects, and issues using Kanban and Scrum methods
* A variety of tools to test your apps, including manual/exploratory testing, load testing, and continuous testing
* Highly customizable dashboards for sharing progress and trends
* Built-in wiki for sharing information with your team
In addition, the Azure DevOps ecosystem provides support for adding extensions, integrating with other popular services, such as: Campfire, Slack, Trello, UserVoice, and more, and developing your own custom extensions.
Choose Azure DevOps Services when you want quick setup, maintenance-free operations, easy collaboration across domains, elastic scale, and rock-solid security. You'll also have access to cloud load testing, cloud build servers, and application insights.
### Resources
* [Microsoft Azure - Azure DevOps](https://azure.microsoft.com/services/devops)

View File

@ -0,0 +1,15 @@
---
title: Chef Server
---
## Chef Server
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/devops/ansible/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
[Chef Server Docs](https://docs.chef.io)

View File

@ -0,0 +1,190 @@
---
title: Docker
---
## Docker
Docker is an open-source project based on Linux containers. It uses Linux Kernel features like namespaces and control groups to create containers on top of an operating system.
Docker uses containers (a runtime instance of an image) to create environments that can easily build, ship, and run applications. The main benefit is that Docker containers run completely isolated from the host environment by default, only accessing host files and ports if configured to do so. This is a great alternative to virutal machines(VMs) that are often resource intensive. VMs disk image and application state are an entanglement of OS settings, system-installed dependencies, OS security patches, and other easy-to-lose, hard-to-replicate ephemera.
Docker is a computer program that performs operating-system-level virtualization, also known as "containerization".
Docker is a platform for developers and sysadmins to develop, deploy, and run applications with containers. The use of Linux containers to deploy applications is called containerization. Containers are not new, but their use for easily deploying applications is.
Containerization is increasingly popular because containers are:
- Flexible: Even the most complex applications can be containerized.
- Lightweight: Containers leverage and share the host kernel.
- Interchangeable: You can deploy updates and upgrades on-the-fly.
- Portable: You can build locally, deploy to the cloud, and run anywhere.
- Scalable: You can increase and automatically distribute container replicas.
- Stackable: You can stack services vertically and on-the-fly.
Installation for [Mac](https://docs.docker.com/docker-for-mac/install/)
Installation for [Windows](https://docs.docker.com/docker-for-windows/install/)
Installation for [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
_All thoses links are for Docker CE (Community Edition)_
---
## Test Docker Version
For testing if the application went well, run :
```
docker --version
```
Ensure that you have an output which looks like this :
```
Docker version 18.06.1-ce, build e68fc7a
```
---
## Test Docker Installation
Test that your installation works by running the simple Docker image, hello-world :
```
docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
...
```
### What is containerization then:
Simply put, it is nothing more than packaging of a process/application and it's dependencies into a distributable image which can run in isolation.
### Why do we need Docker:
It makes the life of software engineers very smooth as they will always work on the same development environment.
It helps in sharing the final product to customers/other teams without worrying about environment issues.
It reduces the amount of hardware we need to run our applications by not wasting them for unnecessary OS layer.
## Fundamental Docker Concepts
### Docker Engine
Docker engine is the layer on which Docker runs. Its a lightweight runtime and tooling that manages containers, images, builds, and more. It runs natively on Linux systems and is made up of:
1. A Docker Daemon that runs in the host computer.
2. A Docker Client that then communicates with the Docker Daemon to execute commands.
3. A REST API for interacting with the Docker Daemon remotely.
### Docker Client
The Docker Client is what you, as the end-user of Docker, communicate with. Think of it as the UI for Docker.
### Docker Daemon
The Docker daemon is what actually executes commands sent to the Docker Clientlike building, running, and distributing your containers. The Docker Daemon runs on the host machine, but as a user, you never communicate directly with the Daemon. The Docker Client can run on the host machine as well, but its not required to. It can run on a different machine and communicate with the Docker Daemon thats running on the host machine.
### Dockerfile
A Dockerfile is where you write the instructions to build a Docker image. These instructions can be:
**RUN apt-get y install some-package**: to install a software package
**EXPOSE 8000**: to expose a port
**ENV ANT_HOME /usr/local/apache-ant** to pass an environment variable and so forth. Once youve got your Dockerfile set up, you can use the docker build command to build an image from it. Heres an example of a Dockerfile:
```
# Start with ubuntu 14.04
FROM ubuntu:14.04
MAINTAINER freeCodeCamp@gmail.com
# For SSH access and port redirection
ENV ROOTPASSWORD sample
# Turn off prompts during installations
ENV DEBIAN_FRONTEND noninteractive
RUN echo "debconf shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
RUN echo "debconf shared/accepted-oracle-license-v1-1 seen true" | debconf-set-selections
# Update packages
RUN apt-get -y update
# Install system tools / libraries
RUN apt-get -y install python3-software-properties \
software-properties-common \
bzip2 \
ssh \
net-tools \
vim \
curl \
expect \
git \
nano \
wget \
build-essential \
dialog \
make \
build-essential \
checkinstall \
bridge-utils \
virt-viewer \
python-pip \
python-setuptools \
python-dev
# Install Node, npm
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
RUN apt-get install -y nodejs
# Add oracle-jdk7 to repositories
RUN add-apt-repository ppa:webupd8team/java
# Make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
# Update apt
RUN apt-get -y update
# Install oracle-jdk7
RUN apt-get -y install oracle-java7-installer
# Export JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle
# Run sshd
RUN apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo "root:$ROOTPASSWORD" | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
# Expose Node.js app port
EXPOSE 8000
# Create tap-to-android app directory
RUN mkdir -p /usr/src/my-app
WORKDIR /usr/src/my-app
# Install app dependencies
COPY . /usr/src/my-app
RUN npm install
# Add entrypoint
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["npm", "start"]
```
#### More Information:
- [Beginner friendly doc](https://medium.freecodecamp.org/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b)
- [Docker Official docs](https://docs.docker.com/get-started/)
- [Try Docker Online](http://training.play-with-docker.com/)

View File

@ -0,0 +1,24 @@
---
title: DevOps
---
## DevOps
<img src="http://blog.xebialabs.com/wp-content/uploads/2016/03/DevOps-cycle-PPT-COLOURS.png" alt="devops cycle" border="0">
DevOps is the integration of work between Development and Operations functions. One approach in doing this is to automate how software is integrated and deployed as it migrates between development, testing, and production environments. This facilitates the installation processes for the software, thus ideally reducing the chance for error.
Alternatively, software development can be done within silos. One silo is responsible for taking feature requests, then turning them into software components with any programming language, and basic testing is done in an environment with fictious data. When the local testing is completed, the work products are handled off to a separate operations team that is responsible for then reinstalling the software into a separate production environment that supports real user traffic. Once the software is in this environment, the operations teams maintain responsibility for the code, including identifying any product defects. If these defects are found, they are shared back with the development team, who attempts to resolve, then hands off a new version of software to the operations teams.
This section contains articles introducing technologies used in DevOps.
### More Information
* [Read more about DevOps on Wikipedia](https://en.wikipedia.org/wiki/DevOps)
* [See this Video that explains Devops](https://youtu.be/_I94-tJlovg)
### Resources
This section contains links to learning DevOps through a MOOC experience. Courses may be pay-only.
* [edX course](https://www.edx.org/microsoft-professional-program-front-end-development)
### Lab
<a href="https://github.com/Microsoft/TechnicalCommunityContent/tree/master/DevOps">DevOps</a>

View File

@ -0,0 +1,12 @@
---
title: Packer
---
## Packer
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
Packer is an automation tool that aids in creating pre-configured images for Public Clouds and some virtualization software like VirtualBox or VmWare. It is most often used in conjuction with Vagrant for local testing and with Public Clouds to provide faster way to deploy hosting environment. Please note Packer still requires a way to provision such image i.e using configuration management tools like Ansible or Puppet
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
- [Official Documentation](https://www.packer.io/docs/index.html)
- [How to Get Started](https://www.packer.io/intro/)

View File

@ -0,0 +1,16 @@
---
title: Puppet
---
## Puppet
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/devops/docker/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
<a href='https://puppet.com/docs/puppet/5.3/architecture.html' target='_blank' rel='nofollow'>Official Puppet documentation</a>

View File

@ -0,0 +1,14 @@
---
title: Saltstack Server
---
## Saltstack Server
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/devops/saltstack/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
[Saltstack Server Docs](https://saltstack.com/)

View File

@ -0,0 +1,16 @@
---
title: Terraform
---
## Terraform
Terraform is an infrastructure as code software by HashiCorp. It allows users to define a datacenter
infrastructure in a high-level configuration language, from which it can create an execution plan to
build the infrastructure in a service provider such as OpenStack or in a service provider such as
IBM Cloud (formerly Bluemix), AWS, Microsoft Azure or Google Cloud Platform. Infrastructure is defined
in a HCL Terraform syntax or JSON format.
#### More Information:
- <a href="https://www.terraform.io">Official Website</a>
- <a href="https://https://github.com/hashicorp/terraform">Terraform on GitHub</a>