Commit 3edcfcd0 authored by Gabriel Le Breton's avatar Gabriel Le Breton

Improve activation documentation and make readme easier to follow

parent 8a8bdbd7
Pipeline #95248484 passed with stage
in 41 minutes and 46 seconds
......@@ -28,6 +28,8 @@ This repository is hosted on multiple remotes to provide examples for [Gitlab-CI
- [Test files](#test-files)
- [How to activate](#how-to-activate)
- [Unity Personal](#unity-personal)
- [a. Using gitlab-ci](#a-using-gitlab-ci)
- [b. Locally](#b-locally)
- [Unity Plus/Pro](#unity-pluspro)
- [Unity license per target](#unity-license-per-target)
- [Note about components in recent images](#note-about-components-in-recent-images)
......@@ -51,17 +53,18 @@ This repository is hosted on multiple remotes to provide examples for [Gitlab-CI
If you don't have a Unity project yet:
1. Fork this project from github or gitlab
2. Update the readme and remove undesired CI configurations
3. Follow How to activate instructions
4. Configure your CI
1. Update the readme and remove undesired CI configurations
1. Follow How to activate instructions
1. Configure your CI environment variables (once everything is set, you should only need `UNITY_LICENSE_CONTENT` in your project variables)
If you already have your own project:
1. Copy desired CI file
2. Update the Unity version according to your project version in the CI file. All versions are available at [gableroux/unity3d docker image](https://hub.docker.com/r/gableroux/unity3d/)
3. Copy build script (make sure you use the same path as original project, it must be in an `Editor` folder)
4. Follow How to activate instructions
5. Configure your CI
1. Copy desired ci file (`.gitlab-ci.yml`, or `.travis.yml`, etc.)
1. Copy [`BuildScript.cs`](Assets/Scripts/Editor/BuildCommand.cs) (make sure you use the same path as original project, it must be in an `Editor` folder)
1. Copy [`ci` folder](ci)
1. Update the Unity version according to your project version in the CI file. All versions are available at [gableroux/unity3d docker image](https://hub.docker.com/r/gableroux/unity3d/)
1. Follow How to activate instructions
1. Configure your CI environment variables (once everything is set, you should only need `UNITY_LICENSE_CONTENT` in your project variables)
## Points of interest
......@@ -120,10 +123,23 @@ See [HERE](https://docs.unity3d.com/ScriptReference/BuildOptions.html) for Build
## How to activate
You'll first need to run this locally. All you need is [docker](https://www.docker.com/) installed on your machine.
There are a few methods available, if you're using gitlab-ci, the easiest method in the current documentation is using gitlab-ci.
### Unity Personal
#### a. Using gitlab-ci
Once you've added all required files to your project (mainly `.gitlab-ci.yml`), there should be a manual step that can be triggered for activation.
1. Visit your project's settings > CI/CD > Variables and add `UNITY_USERNAME` and `UNITY_PASSWORD` with your credentials
1. Push your first commit to your project and visit CI/CD Pipelines.
1. Locate your latest job, there should be a `play` button, click on it and click `get-activation-file`
1. Wait for the job to run and follow instructions in the console
#### b. Locally
All you need is [docker](https://www.docker.com/) installed on your machine.
1. Clone this project
2. Pull the docker image and run bash inside, passing unity username and password to env
......
......@@ -29,38 +29,19 @@ if [[ ${exit_code} -eq 0 ]]; then
echo "${activation_file} was generated successfully!"
echo ""
echo "### Next steps ###"
echo "From here, you have two options:"
echo ""
echo "a. Complete the activation process manually"
echo " difficulty: easy"
echo "Complete the activation process manually"
echo ""
echo " 1. Download the artifact which should contain ${activation_file}"
echo " 2. Visit https://license.unity3d.com/manual and answer questions"
echo " 3. Upload ${activation_file} in the form (after you answered the questions)"
echo " 4. Download 'Unity_v2019.x.ulf' file (year should match your unity version here, 'Unity_v2018.x.ulf' for 2018, etc.)"
echo " 5. Copy the content of 'Unity_v2019.x.ulf' license file to your CI's environment variable 'UNITY_LICENSE_CONTENT'. (Open your project's parameters > CI/CD > Variables and add 'UNITY_LICENSE_CONTENT' as the key and paste the content of the license file into the value)"
echo " 2. Visit https://license.unity3d.com/manual"
echo " 3. Upload ${activation_file} in the form"
echo " 4. Answer questions (unity pro vs personal edition, both will work, just pick the one you use)"
echo " 5. Download 'Unity_v2019.x.ulf' file (year should match your unity version here, 'Unity_v2018.x.ulf' for 2018, etc.)"
echo " 6. Copy the content of 'Unity_v2019.x.ulf' license file to your CI's environment variable 'UNITY_LICENSE_CONTENT'. (Open your project's parameters > CI/CD > Variables and add 'UNITY_LICENSE_CONTENT' as the key and paste the content of the license file into the value)"
echo ""
echo "b. Complete the activation process using docker gableroux/unity3d-activator"
echo " difficulty: intermediate"
echo "Once you're done, hit retry on the pipeline where other jobs failed, or just push another commit. Things should be green"
echo ""
echo " 1. Download the artifact which should contain ${activation_file}"
echo " 2. Open a shell in the folder where you downloaded the activation file"
echo " 3. Run these commands:"
echo ""
echo "git clone https://gitlab.com/gableroux/unity3d-activator"
echo "cp ${activation_file} ./unity3d-activator/"
echo "cd ./unity3d-activator"
echo "cp .env.example .env"
echo "# Edit and fill in your secrets in .env (open with an editor or whatever) and make sure UNITY_ACTIVATION_FILE is set to ${activation_file}, then"
echo "docker-compose run activate"
echo ""
echo " 4. Locate the newly generated license file in the current folder"
echo " 5. Copy the content of 'Unity_v2019.x.ulf' license file to your CI's environment variable 'UNITY_LICENSE_CONTENT'. (Open your project's parameters > CI/CD > Variables and add 'UNITY_LICENSE_CONTENT' as the key and paste the content of the license file into the value)"
echo ""
echo " You can find more details about the unity activator image here:"
echo " https://gitlab.com/gableroux/unity3d-activator"
echo ""
echo "Visit https://gitlab.com/gableroux/unity3d-gitlab-ci-example/issues/73 for more details"
echo "(optional) For more details on why this is not fully automated, visit https://gitlab.com/gableroux/unity3d-gitlab-ci-example/issues/73"
else
echo "License file could not be found at ${UNITY_ACTIVATION_FILE:-./unity3d.alf}"
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment