Code Monkey home page Code Monkey logo

devops-pipeline's Introduction

devops-pipeline

DevopsFlow

ssh localhost setup

ssh localhost

if not then setup ssh by running the below commands:

sudo apt-get install openssh-server openssh-client -y

for local user

SSH - secure shell

ssh localhost setup

ssh localhost

if not then setup ssh by running the below commands:

sudo apt-get install openssh-server openssh-client -y

for local user

cd ~

ssh-keygen -t rsa -P "" (press enter without typing anything)

cp .ssh/id_rsa.pub .ssh/authorized_keys

ssh localhost

for admin/sudo/root user

sudo su

cd ~

ssh-keygen -t rsa -P "" (press enter without typing anything)

cp .ssh/id_rsa.pub .ssh/authorized_keys

ssh localhost

setting up ansible via docker

docker build -t sathyadev/ubuntu-ansible:18.04 .

sudo docker run --net=host --rm -it -v $(pwd)/app/:/app:ro -v $HOME/.ssh:/root/.ssh 07acb63e26a9 bash

pip2 & ansible installation for ubuntu

sudo apt install python-pip

pip install ansible

Ansible version check

ansible --version

ansible 2.8.5
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0]

Ansible playbook run

git clone https://github.com/Sathiyarajan/devops-pipeline.git

cd devops-pipeline/ansible

ansible-playbook install-site.yml -vv -i hosts

incaseof any issues, follow the commands

  pip list
  pip uinstall docker 
  pip uninstall docker
  pip install docker==="2.5.1"
  pip install dockerpty==="0.4.1"

docker installation

remove older version

sudo apt-get remove docker docker-engine docker.io containerd runc

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io

to build a code & docker image:

git clone https://github.com/Sathiyarajan/devops-pipeline.git

cd devops-pipeline/docker

docker build -t <dockerhub_username>/flaskapp:1.1 .

docker run -ti 5103c1f975dc /bin/bash

docker run -d -p 5000:5000 8f6adb7689b5

docker logs 5103c1f975dc

docker logout

docker login

curl http://localhost:5000
Hello World!#

docker push sathyadev/flaskapp:1.1

docker pull sathyadev/flaskapp:1.1

docker rmi -f <imaegeId>

docker rm -f <containerId>

Jenkins

jenkins installation in ubuntu:

https://medium.com/@Marklon/how-to-install-jenkins-on-ubuntu-16-04-on-aws-e584c45c2684

installation steps

sudo apt install default-jdk

sudo apt install default-jdk

sudo wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

sudo apt-get update

sudo apt-get install jenkins

to check the status of jenkins installation

sudo systemctl status jenkins

enable the 8080 port for Jenkins CI UI

sudo ufw allow 8080

sudo ufw status

sudo ufw enable

to start jenkins

sudo systemctl start jenkins

login to jenkins and proceed with the next steps:

https://localhost:8080

get the password & proceed with the next steps:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

git & git repo commands:

to download a repo:

git clone https://github.com/Sathiyarajan/best-project.git

to create a branch

git checkout -b besant_sathya

check the files added

git status

check the difference between local files & remote git repo files

git diff

to add files to a local repo

git add .

commit a fies to local repo

git commit -m "commit message"

push the code to remove git repo

git push origin besant_sathya

devops-pipeline's People

Contributors

itisrarun avatar sathiyarajan avatar srimanaws avatar tharanesh21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.