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
stefan judis
June 28, 2018
Technology
220
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
380
Playwright can do this?
stefanjudis
0
260
Things you should know about Frontend Development in 2022
stefanjudis
0
570
Throw yourself out there for fun and profit
stefanjudis
0
140
Back to Boring
stefanjudis
1
540
Wanna scale up? Make sure your CMS is ready for it!
stefanjudis
0
290
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
630
Other Decks in Technology
See All in Technology
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
150
V8コントリビュート超入門
riyaamemiya
0
140
『止めない』を設計する — 制約の中で、事業の根幹を支える判断
hiroyaterui
0
220
IoTハンズオンの舞台裏
shirouz
2
150
Bet AI Day 2026丨How We Bet AI: AIとともに働く場をつくる
layerx
PRO
2
2.7k
GoCon2026 - Open Source, Open World
sanposhiho
1
130
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
3
260
Azure App Service / Container Apps の組み込み認証
kuniteru
0
210
Webとヘルスデータ
yukukotani
1
190
データエンジニアリングワークショップ:Auto LoaderとSparkで学ぶデータパイプライン構築
databricksjapan
PRO
0
210
Backstageでつくるセルフサービスな社内開発基盤
kikunosuke75
1
350
Multica × 長期記憶:40個のミニプロジェクト管理
eiei114
0
190
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
55
8.3k
GraphQLとの向き合い方2022年版
quramy
50
15k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
690
GitHub's CSS Performance
jonrohan
1033
470k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
Designing for Performance
lara
611
70k
Navigating Weather and Climate Data
rabernat
0
510
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Documentation Writing (for coders)
carmenintech
77
5.5k
The Cost Of JavaScript in 2023
addyosmani
55
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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