0% found this document useful (0 votes)
34 views18 pages

Redhat CI CD

Redhat CI/CD book 101

Uploaded by

yusran_iero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views18 pages

Redhat CI CD

Redhat CI/CD book 101

Uploaded by

yusran_iero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Leveraging Red Hat Ansible Automation

for CI/CD
Jonathan Lozada De La Matta
Senior Consultant, Red Hat Consulting Automation Practice

Andrew Huffman
Senior Consultant, Red Hat Consulting Northeast Region
WHAT IS CI/CD?

CONTINUOUS CONTINUOUS CONTINUOUS


INTEGRATION DELIVERY DEPLOYMENT
...means that the developer's ...is described as the logical ...is described as the logical
working copies are evolution of continuous next step after continuous
synchronized with a shared integration. Always be able to delivery. Automatically deploy
mainline several times a day. put a product into production. the product into production
whenever it passes QA.
POPULAR CI/CD TOOLS
JENKINS

Jenkins® is an open source automation server


(The butler formerly known as Hudson)

With Jenkins, organizations can accelerate the software


development process by automating it. Jenkins manages
and controls software delivery processes throughout the
entire lifecycle, including build, document, test, package,
stage, deployment, static code analysis and much more.
TRAVIS CI

Travis CI is a hosted, distributed continuous


integration service used to build and test software
projects hosted at GitHub.
GITLAB CI/CD

GitLab Continuous Integration (GitLab CI/CD) The


benefits of Continuous Integration are huge when
automation plays an integral part of your workflow.
GitLab comes with built-in Continuous Integration,
Continuous Deployment, and Continuous Delivery
support to build, test, and deploy your application.
WHAT DOES A TYPICAL CI/CD
WORKFLOW LOOK LIKE?
Credit Joseph Pisciotta
TESTING ANSIBLE CODE IN A
CI/CD PIPELINE
MOLECULE

Now an official part of the Ansible open-source


project, Molecule is designed to aid in the
development and testing of Ansible roles.

Molecule can be used to test Ansible code on a


variety of providers.
- Bare-metal
- Virtual
- Cloud
- Containers

Project can be found at:


https://github.com/ansible/molecule
ON DEMAND INFRASTRUCTURE PROVISIONING & EVENT
SOFTWARE TESTING

Using automation with CI/CD can be a great way to test your


code and deploy infrastructure.

● While building your code used for testing, you can also
deploy virtual machines to install and configure the
application.
● Your CI/CD application can make API calls to Ansible
Tower to deploy the infrastructure and application.
● You can use the same model to automatically build
different versions and stages of the code.
HOW DO YOU CONNECT ALL THE PIECES TOGETHER?

After creating automation code in the role you are


writing, you are probably wondering how can you
test them automatically?

You can add the commands in your CI/CD file. This


includes .travis.yml, .gitlab-ci.yml and jenkinsfile
respectively.
TRAVIS-CI MOLECULE EXAMPLE

# source of .travis.yml

---

sudo: required
language: python
services:
- docker
before_install:
- sudo apt-get -qq update
install:
- pip install molecule
# - pip install required driver (e.g. docker,
python-vagrant, shade, boto, apache-libcloud)
script:
- molecule test
GITLAB-CI MOLECULE EXAMPLE

# source of .gitlab-ci.yml molecule:


stage: test
--- tags:
stages: - pip36
- test - docker
script:
variables: - docker -v
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip" - python -Vx
- pip install ansible molecule docker
cache: - ansible --version
paths: - molecule --version
- .pip/ - molecule test
- virtenv/

before_script:
- pip3.6 install virtualenv
- virtualenv virtenv
- source virtenv/bin/activate
# source of .travis.yml

---

sudo: required
language: python
services:
- docker
before_install:
- sudo apt-get -qq update
install:
- pip install molecule
# - pip install required driver (e.g. docker,
python-vagrant, shade, boto, apache-libcloud)
script:
- molecule test
RED HAT CONSULTING METHODOLOGY

ITERATE

DESIGN

DISCOVER

DEPLOY
ENABLE
ACCELERATE IT WITH ANSIBLE AUTOMATION OFFERING PORTFOLIO

BEGIN

Unify and Evolve Automate I.T. Standardize & Standardize & Compliance
Systems Workflows Automate App Automate Automation
Management Delivery Network
Simplify virtual Streamline Configuration
Standardize
and/or cloud current process Coming soon...
application
service and Enable network
definition,
provisioning and procedure automation within
dependencies and
lifecycle workflows traditional and
deployment by
management by using Ansible to virtual networking
leveraging tools Implement full environments
create reusable
such as Ansible CI/CD pipeline by leveraging Ansible
components and
Core, Ansible leveraging best in
coupling them to a
Tower and breed third party
defined workflow
CloudForms open source tools
within Ansible
with Ansible
Tower

~3 Months ~3 Months ~2-3 Months ~3-4 Months


Automation Offerings

Business Value Delivered Via Automation


RED HAT
CONSULTING
THANK YOU

You might also like