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
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
620
Other Decks in Technology
See All in Technology
人を動かすのは時間ではなく、納得感 〜新任EMが入社3ヶ月、組織を2回変えた話〜
kakehashi
PRO
3
200
ポストモーテム! DDoSからサイトは守れた。 でもビジネスは守れなかった。
bengo4com
0
2.4k
アカウントが増えてからでは遅い? ~ マルチアカウント統制の勘所 ~
kenichinakamura
0
210
Claude Codeとハーネスについて考えてみる
oikon48
18
9k
小さいから、全部わかる。— 常駐AI "xangi" のすすめ
sugupoko
0
290
プロンプト_きのこカンファレンス2026_LT
yurufuwahealer
0
150
環境凍結という Toil を倒す -セルフサービス型 Ephemeral テスト環境の 設計と実践
shirouz
1
2k
次世代ランサムウェア対策の考察 / 20260704 Mitsutoshi Matsuo
shift_evolve
PRO
5
1.7k
Road to SRE NEXTの今までとこれから
hiroyaonoe
0
260
End-to-Endで考える信頼性 —LINEアプリにおけるクライアント開発×SRE連携の実践
maruloop
4
3.7k
cccccc
moznion
0
1.8k
AIに「使われる」時代のSaaS戦略 〜既存WebAPIのMCPサーバー化における開発ノウハウ〜
ekispert_api
0
300
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Technical Leadership for Architectural Decision Making
baasie
3
440
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
A Tale of Four Properties
chriscoyier
163
24k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
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