question

joe.lavoine@gmail.com avatar image
joe.lavoine@gmail.com asked

GitHub and Cloud Scripts -- how does it work?

Hello,

How does the GitHub + CloudScript integration work? I added GitHub to my PlayFab project and selected my project repository, but all that happened was the "Upload New Revision" button on CloudScript disappeared (as it seems it should), but any commits I make to my script don't show up in the latest revision on the cloud script tab.

I even created another empty repository just for storing the cloud scripts, linked that via the GitHub add-on, but still had the same results.

I had made numerous (30) revisions to the cloud script the old fashioned way before deciding to try using git. Is there something I'm missing? Do the script files need to be in a certain folder or named a certain way for the cloud script feature to pick up on them?

Regards,

Joe

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

One you have connected a GitHub repo to your title's Cloud Script, every time you commit to master, the contents of the files will be concatenated and pulled in as a new Revision. That Revision will not automatically be deployed as the live Revision (so that you can test it before deploying) though, so you may want to check your drop-down for the Revision to find your latest updates.

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

joe.lavoine@gmail.com avatar image joe.lavoine@gmail.com commented ·

Ah, I knew I was going to feel silly at the answer. That's exactly it, sorry. Thanks for the fast response Brendan!

0 Likes 0 ·
undertheweatherllc avatar image undertheweatherllc commented ·

Hmm, how do you test cloudscript without deploying first? I probably missed that documentation somewhere.

0 Likes 0 ·
brendan avatar image brendan undertheweatherllc commented ·

In the call to ExecuteCloudScript, you can run a specific revision for testing by setting RevisionSelection to either "Latest" (which will run whatever is the most recent revision, regardless of which one has been promoted to Live) or "Specific", if you also then set the SpecificRevision parameter to the revision you want to test.

2 Likes 2 ·
yannka avatar image yannka commented ·

Hey!
@Brendan I may have a silly question about this topic, but I cannot find the answer nowhere.
When you say that the files will be concatenated, what do you mean exactly? What is the logic behind the concatenation? Are the import and require statements resolved to create a single file? Are the files simply concatenated in an aphabetic order based on their names?
Working on a single file is quickly not possible in js. But I don't find any resource explaining what are the best practice in splitting the js files to work with CloudScript.
Thank you very much!

0 Likes 0 ·
brendan avatar image brendan yannka commented ·

The files are just concatenated directly - take the string content of each and just append them. I believe the files are processed in the order they're listed in the project, but it shouldn't really matter, as long as you're not splitting a single function or class across files.

0 Likes 0 ·
yannka avatar image yannka brendan commented ·

Ok, thanks a lot for your answer :)

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.