Upload
daniel-cerecedo
View
146
Download
0
Embed Size (px)
Citation preview
AgendaAgenda
What is CI? Differences with Cd & CD Why should I implement CI? How to implement CI? Virtualization & Containerization Drone Hands on Drone Drone vs Jenkins
bins & libs bins & libs bins & libs
Guest OS Guest OS Guest OS
Hypervisor
Host Operating System
Hardware
APP1 APP2 APP3
Guest OS Guest OS
Docker Engine
Host Operating System
Hardware
bins & libs bins & libs bins & libs
APP1 APP2 APP3
bins & libs bins & libs bins & libs
Guest OS Guest OS Guest OS
Hypervisor
Host Operating System
Hardware
APP1 APP2 APP3
Guest OS Guest OS
Docker Engine
Host Operating System
Hardware
bins & libs bins & libs bins & libs
APP1 APP2 APP3
Run some testsStatically analyze codeVerify quality gatesBuild binariesDeploy binariesBuild Docker imageDeploy containerNotify results
A typical pipeline
Run some testsStatically analyze codeVerify quality gatesBuild binariesDeploy binariesBuild Docker imageDeploy containerNotify results
Our sample pipeline
Sample 3Sample 3
Activate a repo Review the simplest Drone pipeline Generate a trigger via git push Show build logs Show how the workspace is mounted in build steps
Sample 5Sample 5
Using services The problem with credentials. Managing secrets Base pipeline: executing tests against a real database
Services are dependencies of the build
Drone Workspace
Git Container
Step 1 Container
Step N Container
Drone Environment Variables Drone Secret Variables
Drone Service Container 1
Docker Networking
Docker Networking
Docker Networking
Docker volume mount
Docker volume mount
Docker volume mount
Steps can read Drone envars & Drone secrets
Drone Workspace
Git Container
Step 1 Container
Step N Container
Drone Environment Variables Drone Secret Variables
Drone Service Container 1
Docker Networking
Docker Networking
Docker Networking
Docker volume mount
Docker volume mount
Docker volume mount
CI=drone DRONE=true DRONE_ARCH DRONE_REPO DRONE_REPO_OWNER DRONE_REPO_NAME DRONE_REPO_SCM DRONE_REPO_LINK DRONE_REPO_AVATAR DRONE_REPO_BRANCH DRONE_REPO_PRIVATE DRONE_REPO_TRUSTED DRONE_REMOTE_URL DRONE_COMMIT_SHA DRONE_COMMIT_REF DRONE_COMMIT_BRANCH DRONE_COMMIT_LINK DRONE_COMMIT_MESSAGE DRONE_COMMIT_AUTHOR DRONE_COMMIT_AUTHOR_EMAIL DRONE_COMMIT_AUTHOR_AVATAR
DRONE_BUILD_NUMBER DRONE_BUILD_EVENT DRONE_BUILD_STATUS DRONE_BUILD_LINK DRONE_BUILD_CREATED DRONE_BUILD_STARTED DRONE_BUILD_FINISHED DRONE_PREV_BUILD_STATUS DRONE_PREV_BUILD_NUMBER DRONE_PREV_COMMIT_SHA DRONE_JOB_NUMBER DRONE_JOB_STATUS DRONE_JOB_EXIT_CODE DRONE_JOB_STARTED DRONE_JOB_FINISHED DRONE_YAML_SIGNED DRONE_YAML_VERIFIED DRONE_BRANCH DRONE_COMMIT DRONE_TAG DRONE_PULL_REQUEST DRONE_DEPLOY_TO
Sample 6Sample 6
Using plugins Caching between build steps Caching between builds Conditional execution
when: branch:
include: [ master, release/* ] exclude: [ release/1.0.0, release/1.1.* ]
event: [push, pull_request, tag, deployment] status: [ failure, success, changed ] platform: [ linux/*, windows/amd64 ] environment: production
Sample 7Sample 7
Developing plugins Structure of a plugin Building a plugin to check Sonar quality gates
Run some testsStatically analyze codeVerify quality gatesBuild binariesDeploy binariesBuild Docker imageDeploy containerNotify results
Our sample pipeline
Drone vs JenkinsDrone vs Jenkins
Developer owned vs Sysadmin owned Local build testing vs No testing Container centric vs Supports containers Extensible plugin model vs Hard to code plugins Native security vs Ad hoc security Native matrix builds vs Plugin matrix builds Trigger upstream/downstream builds via plugin
Containers from scratch - https://ericchiang.github.io/post/containers-from-scratch/
Docker – https://docker.io Drone documentation – https://readme.drone.io Drone gitter channel – https://gitter.im/drone/drone Software costs - https://www.linkedin.com/post/edit/hidden-cost-speed-
statically-vs-dynamically-typed-daniel-cerecedo
ReferencesReferences
?