02-16-2021 06:28 AM
Hi everyone,
i’m having the following challenge: I’m documenting files on Gitlab which are at some point then promoted from the Dev organization to the Prod org. This promotion runs in the Dev organization.
It turns out that the File Writer cannot write between the origanizations (between projects even according to the documentation) even though it does not throw an error. The file writer snap says that it has overwritten the files, but in the Prod instance the files don’t show up.
The file content is retrieved from gitlab in base64 encoding, which is decoded and then the file is created with the File writer. It works properly when staying in one organization.
Does anyone have a suggestion on how to create files in a different organization?
Best regards
Thomas
Solved! Go to Solution.
02-16-2021 09:02 AM
@Spiro_Taleski - you are correct - you cannot create a file in a different org directly.
However, you could create a pipeline with a triggered task that is located in the target org that simply has a formatter (ex: CSV Formatter) and file writer snap. Then call that triggered task from your source org using a REST POST snap, pushing the file contents.
The Project Migration API will also move files between orgs with a REST call.
02-16-2021 06:33 AM
Looks like it really just uses the local context.
Just verified that when staying within the same Org, it works as intended. However i couldn’t figure out how to leave the org boundaries yet.
02-16-2021 07:06 AM
I am not sure that with the file writer you can create a files across different organizations.
If you want to move/migrate the files(or any other assets like pipelines, tasks, accounts) to another Org, then you can use the Project Migration API:
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1982373/Project+Migration+API
Regards,
Spiro Taleski
02-16-2021 09:02 AM
@Spiro_Taleski - you are correct - you cannot create a file in a different org directly.
However, you could create a pipeline with a triggered task that is located in the target org that simply has a formatter (ex: CSV Formatter) and file writer snap. Then call that triggered task from your source org using a REST POST snap, pushing the file contents.
The Project Migration API will also move files between orgs with a REST call.
03-15-2021 02:20 AM
I’ve tested both yours and Spiros suggestion, i ended up having a pipeline in Prod, which takes care of the file creation for me, as i don’t just want to push over all files i have in the project, but only those files which were committed to git.
Thanks and best regards
Thomas