your config 3. inspect tools available 4. keep calm while waiting on CI build 5. keep things dry like biscuits a. Parameters b. Matrix builds c. Orbs 6. take the road less travelled a. Scheduled Workflows b. Tag Workflows 7. do Serverless with CircleCI
Docker must be installed on local machine) - Steps like save_cache or persist_to_workspace are skipped - Need to inject encrypted environment variables (e.g., contexts) 👉 https://circleci.com/docs/2.0/local-cli/#limitations-of-running-jobs-locally
🐳 # check out $ docker run cimg/base:2020.01 jq --version $ docker run cimg/ruby:2.5 which openssl $ docker run circleci/ruby:2.5 curl https://example.com
organization in Docker Hub instead So use cimg/ruby rather than circleci/ruby for a quicker build*, for example. https://circleci.com/blog/announcing-our-next-generation-convenience-images-smaller-faster-more-deterministic/
- libraries testing against language versions [link redacted] - Independent and yet, similar jobs workflows: build_test_deploy jobs: - unit_test - deploy: matrix: parameters: client: [A, B, C] region: [jp, au] exclude: # client A is AU only - client : A region: jp # client C is JP only - client : C region: au
context vs DRYable job / command’s time to complete! Parallel jobs are unlikely to be run exactly at same time; expect some delays. Scenario: deploying multiple Lambda functions on multiple AWS regions: Matrix ✔: Time to spin up execution: 2~3 mins Time to deploy Lambda per region: 5 minutes Matrix ❌: Time to spin up execution: 2~3 mins Time to deploy Lambda per region: 5 secs
CircleCI Context: 1. AWS Lambdas run on specific Linux a. https://hub.docker.com/_/amazonlinux/ 2. Native dependencies / extensions thus should be compiled against this runtime environment. 3. Serverless uses LambCI images for invoking local functions for AWS a. LambCI images mirror AWS Linux 4. Serverless package plugins also uses LambCI images to install dependencies a. Python b. Ruby
Deploying for our AWS Lambdas (Ruby) via Serverless Challenge: 1. CircleCI base images differ from AWS Linux 2. Native extensions compiled in CircleCI build may not work a. e.g., mt-slogger’s ruby requires oj gem which has bindings on C