mapbox-unity-sdk icon indicating copy to clipboard operation
mapbox-unity-sdk copied to clipboard

Unity Cloud Build

Open isiyu opened this issue 9 years ago • 12 comments

The steps we need to take to set-up Unity Cloud build to work with our submodules setup:

  • [ ] in appveyor: build a Unity project that has all the submodules
  • [x] in appveyor: push to a CloudBuild branch
  • [x] a commit comments flag to trigger this
  • [ ] connect CloudBuild to our Unity cloud build

@BergWerkGIS what is your bandwidth like to set this up?

cc @MateoV @david-rhodes

isiyu avatar Mar 30 '17 21:03 isiyu

For context: Unity cloud build is currently not an option with our current subdmoule/dependency paradigm. This is due to syntax errors caused by missing core sdk files that have not yet been copied into the Unity project via update-mapbox-unity-sdk-core.

in appveyor: push to a mapbox-unity-sdk-cloudbuild repo

Another option is to use a special branch, rather than a new repo.

david-rhodes avatar Mar 30 '17 21:03 david-rhodes

Another option is to use a special branch, rather than a new repo.

I like this! (updated original comment to reflect)

isiyu avatar Mar 31 '17 01:03 isiyu

AppVeyor side of things done: put [trigger cloudbuild] anywhere into the commit message.

Is there anything else we would need in branch unity-cloud-build for the Unity Cloud Build to work?

What about the missing .meta files?


~~FYI: it won't work until merged into the default branch as AppVeyor doesn't decode secure variables (GITHUB_TOKEN) on branches.~~

~~It worked for me (https://ci.appveyor.com/project/Mapbox/mapbox-unity-sdk/build/1.0.37) as I manually overruled AppVeyor's default behavior for testing.~~

EDIT: this is only true for PRs not feature branches.

wilhelmberg avatar Mar 31 '17 10:03 wilhelmberg

@BergWerkGIS I need some clarification:

Is this simply copying local repo to a new branch unity-cloud-build with the assumption that a user has already run update-mapbox-unity-sdk-core? If not, where is that being executed?

It appears that the Unity project is being copied into the root folder mapbox-unity-sdk instead of mapbox-unity-sdk/sdkproject. Is this intentional?

.meta files appear to be transferred over already for everything that is a Unity component. For core scripts, this is probably not a concern because they do not need to be serialized.

How are we going to inject an API token for cloud build without checking that in? :man_facepalming: Maybe we do need a separate (private) repo for cloud build?

david-rhodes avatar Mar 31 '17 16:03 david-rhodes

Is this simply copying local repo to a new branch unity-cloud-build with the assumption that a user has already run update-mapbox-unity-sdk-core? If not, where is that being executed

AppVeyor runs update.

It appears that the Unity project is being copied into the root folder mapbox-unity-sdk instead of mapbox-unity-sdk/sdkproject. Is this intentional?

Yes intentional, do we need sdkproject?

How are we going to inject an API token for cloud build without checking that in? :man_facepalming: Maybe we do need a separate (private) repo for cloud build?

I suppose that's a Unity token? Does it offer encryption like AppVeyor or Travis?

wilhelmberg avatar Mar 31 '17 17:03 wilhelmberg

Yes intentional, do we need sdkproject?

I just figured we would use the same project for consistency, but this is not mandatory.

I suppose that's a Unity token?

No, this is the mapbox token. Our SDK expects to find a token in StreamingAssets/MapboxAccess.text. That file is ignored, however.

david-rhodes avatar Mar 31 '17 17:03 david-rhodes

No, this is the mapbox token. Our SDK expects to find a token in StreamingAssets/MapboxAccess.text. That file is ignored, however.

Yes, then another private repo makes sense.

wilhelmberg avatar Mar 31 '17 17:03 wilhelmberg

@BergWerkGIS let's move this to this branch here: https://github.com/mapbox/mapbox-sdk-unity/tree/CloudBuild . (this will the the private repo moving forward)

If you point me to where to make the changes I can take a look today if you need to hop off. thanks!

isiyu avatar Mar 31 '17 17:03 isiyu

@isiyu change {repoName} to mapbox/mapbox-sdk-unity https://github.com/mapbox/mapbox-unity-sdk/blob/BergWerkGIS-prepare-for-cloudbuild/scripts/build.csx#L150

wilhelmberg avatar Mar 31 '17 18:03 wilhelmberg

@BergWerkGIS: went ahead and made a PR: https://github.com/mapbox/mapbox-unity-sdk/pull/6 @david-rhodes: we should be able to [trigger cloudbuild] with any branch since Cloud Build will hook into the CloudBuild branch.

Made two changes:

  • Moved the commit to the private branch
  • Writes the token here (do we need a .meta file for this?): https://github.com/mapbox/mapbox-sdk-unity/tree/CloudBuild/Assets/StreamingAssets

isiyu avatar Apr 01 '17 00:04 isiyu

PR merged. Cloud build is building, but I'm getting null references in examples at runtime. This is weird because when I open the scenes locally from CloudBuild or do a command line build (without .metas), everything works just fine. Will need more time to debug.

david-rhodes avatar Apr 03 '17 17:04 david-rhodes

Closing for now - we will revisit cloud build when we figure out what we need to test.

isiyu avatar Apr 11 '17 19:04 isiyu