Idea

me@mikevanriel.com avatar image
me@mikevanriel.com suggested

GitLab integration for CloudScript Content Management

I saw that someone else requested support for BitBucket to host the CloudScript files; I would additionally like to request support for hosting the CloudScript files at GitLab (http://gitlab.com).

CloudScript
1 comment
10 |1200

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

mooldi avatar image mooldi commented ·

Me too i would love to deploy my serverSide code and still keep it from others t access it through github so please take a look at this if you have time cheers ^^

0 Likes 0 ·

4 Comments

·
Dylan Hunt avatar image
Dylan Hunt commented

Gahh no votes left, but YES!! They are famous for competing insanely with GitHub on every level. Best of all (for playfab devs), they are pros at migration and API's. You can even import a project from GitHub in 1 click. They make everything easy.

* Free, unlimited 10gb repos (GitHub is 1gb per repo)

* Both private and public (GitHub is public only, then charges for private)

* You can host your own server (complicated, but has many benefits, including unlimited storage + pipelines)

* They have their own native pipeline. So I could build a Unity game, push it, have the pipeline push it straight to Steam.

They are godsend, and recently (today) transferred everything to GitLab to prep to cancel my private github monthly fee.

2 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.

Dylan Hunt avatar image Dylan Hunt commented ·

(Even NASA uses them)

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt commented ·

(doh, can't edit)

Gah, actually ... I realized that I can move ALL of my files to GitLab ... EXCEPT for my cloudscript, which has secret keys on it. If I cancel my GitHub private subscription, it either gets exposed or I need to delete it (and cloudscript without versioning sort of sucks).

Alternately, I can simply not use secret keys for my api, but ... eh... my game's already on piratebay, don't want to spoonfeed their progression lol.

I'd much rather spend money on PlayFab monthly than GitHub. I wish this feature would come into existence soon :)

0 Likes 0 ·
Montana Tuska avatar image
Montana Tuska commented

I'm gonna bump this up so that PlayFab can move this to the Add-on Marketplace forum that I just realize existed. +1 on Gitlab though.

10 |1200

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

rnakrani avatar image
rnakrani commented

This would be very helpful. GitHub doesn't have private repositories in a free tier, but GitLab does, and all of our other web based stuff is in GitLab, so it would make it convenient. I am guessing this is going to be hard to get PlayFab to do since they are now owned by Microsoft and Microsoft also has or will be purchasing GitHub.

As it stands the ability to use GitHub is useless to us, but the ability to use GitLab would be very beneficial.

10 |1200

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

Tom Johnstone avatar image
Tom Johnstone commented

If anyone's interested this is how we setup CloudScript source control with GitLab:

You just need to set the following variables in your CI/CD settings: PLAYFAB_TITLE_ID_RETAIL, PLAYFAB_TITLE_ID_SANDBOX, PLAYFAB_SECRET_KEY, CI_PRIVATE_TOKEN

workflow:
    rules:
        - if: $CI_COMMIT_TAG
          when: never
        - when: always
    
stages:
    - deploy

.DeployToPlayFab: &DeployToPlayFab |
    $ErrorActionPreference = "Stop"

    $apiHeaders = @{ 'X-SecretKey'=$PLAYFAB_SECRET_KEY }
    
    $body = @{
        CustomTags = @{
            BranchName = $CI_COMMIT_REF
            CommitSha = $CI_COMMIT_SHA
        }
        Files = @()
        Publish = $false
    }
    
    Get-ChildItem -Filter *.js -Recurse | % {
        $body.Files += @{
            FileContents = Get-Content -Path $_.FullName -Raw | Out-String
            Filename = $_.Name
        }
    }
    
    $body = $body | ConvertTo-Json
    
    if ($CI_COMMIT_REF -eq "master")
    {
        $playFabTitleId = $PLAYFAB_TITLE_ID_RETAIL
    }
    else
    {
        $playFabTitleId = $PLAYFAB_TITLE_ID_SANDBOX
    }
    
    $apiUrl = "https://$playFabTitleId.playfabapi.com/Admin/UpdateCloudScript"
    Write-Output "apiUrl > $apiUrl"
    $result = Invoke-RestMethod -Headers $apiHeaders -Uri $apiUrl -Method POST -ContentType 'application/json' -Body $body
    $result = $result | ForEach-Object { $_ }
    if ($result.code -eq 200)
    {
        $version = $result.data.Version
        Write-Output "version > $version"
        $revision = $result.data.Revision
        Write-Output "revision > $revision"
        
        $tagName = "$PLAYFAB_TITLE_ID-rev$revision"
        $apiUrl = "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/tags?tag_name=$tagName&ref=$CI_COMMIT_SHA"
        Write-Output "apiUrl > $apiUrl"
        $apiHeaders = @{ 'PRIVATE-TOKEN'='$CI_PRIVATE_TOKEN' }
        $result = Invoke-RestMethod -Headers $apiHeaders -Uri $apiUrl -Method POST
    }
    else
    {
        Write-Output "code > $result.code"
        Write-Output "error > $result.error"
    }

deploy:
    stage: deploy
    when: manual
    script:
        - *DeployToPlayFab
10 |1200

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

Write a Comment

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.