Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Patience and the right tools II – ways to handl...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
stefan judis
June 28, 2018
Technology
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Patience and the right tools II – ways to handle content model changes
stefan judis
June 28, 2018
More Decks by stefan judis
See All by stefan judis
Back to boring (part 2)
stefanjudis
0
370
Playwright can do this?
stefanjudis
0
240
Things you should know about Frontend Development in 2022
stefanjudis
0
560
Throw yourself out there for fun and profit
stefanjudis
0
140
Back to Boring
stefanjudis
1
530
Wanna scale up? Make sure your CMS is ready for it!
stefanjudis
0
280
Did we(b development) lose the right direction?
stefanjudis
6
2.2k
Regular expressions – my secret love
stefanjudis
1
1.1k
Write a Function
stefanjudis
0
620
Other Decks in Technology
See All in Technology
MySQL & MySQL HeatWave Report - June 2026
freshdaz
0
230
Why is RC4 still being used?
tamaiyutaro
0
250
product engineering with qa
nealle
0
100
【FinOps】データドリブンな意思決定を目指して
z63d
3
540
Zenoh on Zephyr on LiteX
takasehideki
2
140
Terraform 101 (初心者向け) 資料
shuadachi
0
110
徹底討論!ECS vs EKS!
daitak
3
1.8k
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
20
8.1k
作る力から、見極める力へ — AI時代に広がるエンジニアの価値と役割
rince
0
380
トークン最適化のためのユーザーストーリー分析 / User Story Analysis for Token Optimization
oomatomo
0
150
AWS PrivateLink × SCIM で実現する セキュアで運⽤負荷の低い Databricks 基盤の構築
tsuda7
0
110
“ID沼入口” - 基本とセキュリティから始める、考え続けるためのID管理技術勉強会 告知&イントロ
ritou
0
300
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
Done Done
chrislema
186
16k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
Why Our Code Smells
bkeepers
PRO
340
58k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
Transcript
Patience and the right tools @stefanjudis Ways to handle content
model changes
Stefan Judis Frontend Developer, Occasional Teacher, Meetup Organizer ❤ Open
Source, Performance and Accessibility ❤ @stefanjudis
NOBODY(!) GETS IT RIGHT THE FIRST TIME...
4 WAYS TO SURVIVE SHARE & REUSE ANALYSE EVOLVE
5 WAYS TO SURVIVE SHARE & REUSE ANALYSE EVOLVE
github.com/contentful/contentful-migration
github.com/contentful/contentful-migration PROGRAMMATIC CONTENT MODEL CHANGES
MIGRATION CLI CONTENT TYPE OPERATIONS Create a content type 01
02 03 04 05 Delete a content type Edit a content type Create/edit/delete fields Change a field ID
Transform an entry in place 01 02 Derive an entry
from another MIGRATION CLI CONTENT TRANSFORMATIONS
MIGRATION CLI ADVANTAGES Repeatable 01 02 03 04 Can be
kept in VC Includes sanity checks Perfect for CI
None
speakerdeck.com/stefanjudis/patience-and-the-right-tools-ways-to-approach-content-modelling youtu.be/eX2FzlA-QnQ
13 How to DISCARD TEST PREVIEW a migration?
Sandbox Environments
None
CREATE MULTIPLE VERSIONS OF A SPACE CHANGE/TEST THEM IN ISOLATION
cdn.contentful.com/spaces/{space_id}/entries const contentful = require('contentful'); const client = contentful.createClient({ space:
'<space_id>', accessToken: '<content_delivery_api_key>' }); client.getEntries();
cdn.contentful.com/spaces/{space_id}/environments/{environment_id}/entries const contentful = require('contentful'); const client = contentful.createClient({ space:
'<space_id>', environment: '<environment_id>', accessToken: '<content_delivery_api_key>' }); client.getEntries();
COPIED Content types Entries Assets Locales UI-extensions Saved views SHARED
Users & space memberships Roles & permissions API keys Web hooks
youtu.be/7DE6PQ3tPyI
21 Common use cases LOCAL DEVELOPMENT STAGING/QA CONTINUOUS INTEGRATION
22 Common use cases LOCAL DEVELOPMENT STAGING/QA CONTINUOUS INTEGRATION
None
24 Common use cases LOCAL DEVELOPMENT STAGING/QA CONTINUOUS INTEGRATION
FEATURE SANDBOXES
FEATURE SANDBOXES ENVIRONMENT SANDBOXES
ENVIRONMENT SANDBOXES FEATURE SANDBOXES CI SANDBOXES
www.contentful.com/r/knowledgebase/cms-as-code/ www.contentful.com/developers/docs/concepts/multiple-environments/
www.contentful.com/r/knowledgebase/cms-as-code/ www.contentful.com/developers/docs/concepts/multiple-environments/ BUT HOW TO DO THIS?
None
migrations 0_0_4.js 0_0_5.js 0_0_6.js 0_0_7.js 0_0_8.js
0_0_8.js module.exports = function runMigration(migration) { const post = migration.editContentType("post");
post .createField("rating") .name("Rating") .type("Number") .required(false); return; };
- run: name: Preparing environment for testing command: | .
venv/bin/activate python scripts/migration_prep.py "CI_$CIRCLE_BRANCH" scripts/migrate.js $SPACE_ID "CI_$CIRCLE_BRANCH" $MANAGEMENT_API_KEY
- run: name: Preparing environment for testing command: | .
venv/bin/activate python scripts/migration_prep.py "CI_$CIRCLE_BRANCH" scripts/migrate.js $SPACE_ID "CI_$CIRCLE_BRANCH" $MANAGEMENT_API_KEY client = contentful_management.Client(MANGEMENT_API_KEY) environment = client.environments(SPACE_ID).create(TESTING_ENV, {"name": TESTING_ENV})
- run: name: Preparing environment for testing command: | .
venv/bin/activate python scripts/migration_prep.py "CI_$CIRCLE_BRANCH" scripts/migrate.js $SPACE_ID "CI_$CIRCLE_BRANCH" $MANAGEMENT_API_KEY const {default: runMigration} = require('contentful-migration/built/bin/cli'); await runMigration({ /* ... */ }); client = contentful_management.Client(MANGEMENT_API_KEY) environment = client.environments(SPACE_ID).create(TESTING_ENV, {"name": TESTING_ENV})
Keep code and content model in sync
Demo
Feedback? Ideas?
Integrate your content model into your delivery pipeline
Thanks. @stefanjudis Slides ctfl.io/ci-environments Example ctfl.io/ci-environments-example