Adding gitlab ci file.

This commit is contained in:
Dan Chadwick
2024-03-10 21:44:34 +00:00
parent d55838a927
commit 0d77a3eeea
219 changed files with 15260 additions and 130 deletions

View File

@@ -0,0 +1,54 @@
id: images
label: 'Import remote images.'
source:
plugin: url
data_fetcher_plugin: http
data_parser_plugin: json
urls: 'https://jsonplaceholder.typicode.com/photos'
item_selector: /
constants:
file_dest_dir: 'public://migrated-images/'
jpeg: '.jpeg'
ids:
image_id:
type: string
fields:
-
name: image_id
label: 'Image ID'
selector: /id
-
name: image_title
label: 'Image URL'
selector: /title
-
name: image_url
label: 'Image URL'
selector: /url
process:
_prep_filename:
-
plugin: callback
callable: basename
source: image_url
filename:
plugin: concat
source:
- '@_prep_filename'
- constants/jpeg
_prep_file_destination:
plugin: concat
source:
- constants/file_dest_dir
- '@filename'
uri:
plugin: file_copy
source:
- image_url
- '@_prep_file_destination'
status:
plugin: default_value
default_value: 1
alt: image_title
destination:
plugin: 'entity:file'

View File

@@ -0,0 +1,37 @@
id: json_posts_to_posts
label: 'JSON Migrate - Posts to Posts'
migration_group: migrate_posts
source:
plugin: url
data_fetcher_plugin: http
data_parser_plugin: json
urls: 'https://jsonplaceholder.typicode.com/posts'
item_selector: /
ids:
post_id:
type: string
fields:
-
name: post_id
label: 'Post ID'
selector: /id
-
name: post_title
label: 'Post Title'
selector: /title
-
name: post_body
label: 'Post Body'
selector: /body
process:
title: post_title
body/value: post_body
field_image:
plugin: migration_lookup
migration: images
source: post_id # this gets an image with the same ID as the post.
destination:
plugin: 'entity:node'
default_bundle: post
migration_dependencies: { }