Unity Cloud Build
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
CloudBuildbranch - [x] a commit comments flag to trigger this
- [ ] connect
CloudBuildto our Unity cloud build
@BergWerkGIS what is your bandwidth like to set this up?
cc @MateoV @david-rhodes
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.
Another option is to use a special branch, rather than a new repo.
I like this! (updated original comment to reflect)
AppVeyor side of things done: put [trigger cloudbuild] anywhere into the commit message.
- feature branch: BergWerkGIS-prepare-for-cloudbuild
- branch AppVeyor pushes the contents of
sdkprojectto: unity-cloud-build
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.
@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?
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?
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.
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.
@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 change {repoName} to mapbox/mapbox-sdk-unity
https://github.com/mapbox/mapbox-unity-sdk/blob/BergWerkGIS-prepare-for-cloudbuild/scripts/build.csx#L150
@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
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.
Closing for now - we will revisit cloud build when we figure out what we need to test.