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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
360
Playwright can do this?
stefanjudis
0
240
Things you should know about Frontend Development in 2022
stefanjudis
0
550
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
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
3
220
AIプラットフォームを運用し続けるための可観測性
tanimuyk
4
1.2k
AI Testing Talks: Challenges of Applying AI in Software Testing: From Hype to Practical Use
exactpro
PRO
1
140
チームで実践する AI-DLC 思考の軌跡を残すチェックポイント設計
belongadmin
0
3k
新アーキテクチャ「TiDB X」解説とDedicated比較 TiDB Cloud Premiumのゲーム運用活用を検証
staffrecruiter
0
120
作って終わりにしない タイミーのセマンティックレイヤー育成の現在地
chanyou0311
1
420
BigQuery の Cross-cloud Lakehouse への歩み
phaya72
2
600
新しいVibe Codingと”自走”について
watany
5
110
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
3
610
【Gen-AX】20260530開催_JJUG CCC 2026 Spring
genax
0
440
もりもり新機能を一挙紹介! AgentCoreに入門して、AWS上にAIエージェントを構築しよう
minorun365
PRO
6
850
Microsoft Build Keynoteふりかえり
tomokusaba
0
110
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
380
New Earth Scene 8
popppiees
3
2.3k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
Thoughts on Productivity
jonyablonski
76
5.2k
Facilitating Awesome Meetings
lara
57
6.9k
We Are The Robots
honzajavorek
0
240
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
440
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
KATA
mclloyd
PRO
35
15k
Abbi's Birthday
coloredviolet
2
8k
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