Thanks to visit codestin.com
Credit goes to github.com

Skip to content

godofecht/UnityJenkinsStarter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Unity CI with Jenkins

This project demonstrates how to set up continuous integration for a Unity project using Jenkins.

Prerequisites

  1. Jenkins - Installed and running on your machine
  2. Unity Hub - With at least one Unity version installed
  3. Git - For version control

Project Structure

  • UnityProject/ - The Unity project directory
    • Assets/ - All Unity assets
      • Editor/ - Editor scripts
        • BuildScript.cs - Build script for Jenkins
  • Jenkinsfile - Jenkins pipeline definition

Jenkins Setup

  1. Install Required Plugins:

    • Unity3d Plugin
    • Git Plugin
    • Pipeline
    • Credentials Binding Plugin
  2. Configure Unity in Jenkins:

    • Go to Manage Jenkins > Global Tool Configuration
    • Add a new Unity installation
    • Set the path to your Unity executable (e.g., /Applications/Unity/Hub/Editor/[Version]/Unity.app/Contents/MacOS/Unity)
  3. Create a New Pipeline Job:

    • Create a new Pipeline job
    • Set the Pipeline definition to "Pipeline script from SCM"
    • Select Git as the SCM
    • Enter your repository URL
    • Set the script path to Jenkinsfile

Building Locally

You can trigger a build locally using the Unity command line:

/Applications/Unity/Hub/Editor/[Version]/Unity.app/Contents/MacOS/Unity \
  -batchmode \
  -nographics \
  -quit \
  -projectPath /path/to/UnityProject \
  -executeMethod BuildScript.PerformBuild \
  -logFile build.log \
  -buildTarget StandaloneOSX \
  -buildPath "Builds/Build"

Troubleshooting

  • Unity not found: Update the UNITY_PATH in the Jenkinsfile to match your Unity installation path.
  • Build failures: Check the Jenkins console output and the Unity log file for detailed error messages.

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages