O SlideShare utiliza cookies para otimizar a funcionalidade e o desempenho do site, assim como para apresentar publicidade mais relevante aos nossos usuários. Se você continuar a navegar o site, você aceita o uso de cookies. Leia nosso Contrato do Usuário e nossa Política de Privacidade.
O SlideShare utiliza cookies para otimizar a funcionalidade e o desempenho do site, assim como para apresentar publicidade mais relevante aos nossos usuários. Se você continuar a utilizar o site, você aceita o uso de cookies. Leia nossa Política de Privacidade e nosso Contrato do Usuário para obter mais detalhes.
Pipelines vs traditional CI
• Pipelines enhances traditional CI
• Steps for targets
• Reduces cost of running a CI by containerizing CI
• Pipelines should encompass CI and CD
• Continous Integration
• Builds ability to deliver at will
• Continous Delivery
• Ability to automate the delivery
• Bitbucket Pipelines runs pipelines using Docker containers.
• Use the validator to check format
Name The name of the file must be bitbucket-pipelines.yml
Location The file must be located in the root directory of the repository that you want to build.
Format The content of the file must be compliant with our bitbucket-pipelines.yml guidelines
YAML : Quick overview
• Key value pairs in the familiar key: value syntax
• Value can also be a associative array – set of key values either in curly
braces or one per line
• Value can be a list [item, item] OR each item starts with a hyphen
• Indentation is important
• Indentation is spaces
• # makes a comment to the end of line
Defining pipelines contd
• You can define the following types of pipelines in the bitbucket-
• You can refer to branches, tags, and bookmarks in a pipeline using their
name, or by using glob patterns.
• If you want to trigger some build pipelines manually, you can add them in
the custom section.
• Every pipeline can have up to 10 steps. Each step contains a script which
defines the actions that should be performed to execute a build.
Our Demo : Magento 2 application
• In order to move code to production Magento requires
• Deploy static (less->css)
• Compile (moves files to generated, resolves conflicts, some checks)
• Do more checks
• Minify css / js / (static) html
• Run tests
• Steps are executed in the order that they appear in the bitbucket-
• Each step runs in separate Docker container
• Use artifacts to pass built folders down to next step
Each step can be configured to:
• Use a different Docker image.
• Use specific caches
• Uses services
• Produce artifacts that subsequent steps can consume.
Note on separation of concerns
• There is an overlap on what can be done in a step and in docker
• Docker Image
• Closely match a environment you want the application to run in
• Specific to the application
• Focus on build steps rather than image
• Might be a good idea to put the Dockerfile(s) in use in the git
Service : mysql
• Mysql will be a separate docker instance called a service instance
• Ofcourse you can make a single docker image with mysql but that would
break the idea of containerization
• Bitbucketpipeline maps ALL ports from the service to the main
Service 1 : mysql
Service 2 : redis
Security of passwords
• Use environment variables for things like AWS keys, clusterinfo,
docker user, etc.
• Environment variabes are at the project level
• Use keys to ssh to
• get authentication files from a remote server
• ssh to deploy built objects
• Devops aims to banish “It works
on my machine” syndrome
• Breaks barriers between
developer and operations
• Bitbucket Pipelines help speed
up the process
• Using docker it reduces the cost
of each test and improved
Resources used in this presentation
• Docker Image used in the pipeline
• Bitbucket pipeline yaml file
See the branch for variation
Where to find us