Skip to content

isabella232/atlas-jenkins-pipeline

 
 

Repository files navigation

Atlas Jenkins Pipeline Shared Library

This repository contains a series of steps and variables for use by Wooga's WDKs.

Usage:

At the root of each WDK there's a Jenkins configuration file, Jenkinsfile which is used by our Jenkins CI in order to make a build pipeline for the repository:

jenkinsFileExplorer

#!groovy
// Imports the library from the github repository
@Library('github.com/wooga/atlas-jenkins-pipeline@1.x') _

...

These build pipelines can be triggered manually or can be configured to be triggered automatically by specific actions (commits, pull requests, etc):

jenkinsPipeline

Some build pipelines provide parameters which can be set before starting the build from the interface:

pipelineParameters

Steps:

gradleWrapper

Invokes the gradle wrapper for the current platform (Windows/Unix);

Arguments:

  • command: string
  • returnStatus: boolean = false
  • returnStdout: boolean = false

Usage:

gradleWrapper "testEditMode -P unity.testBuildTargets=android"

buildWDKAutoSwitch

Constructs a pipeline that will build an Unity WDK for a set of given Unity versions, running any available tests. If the build is successful it will then generate a paket package and publish it to our artifactory, where it then can be used by other WDKs or game projects.

buildwdkauto

Parameters:

  • RELEASE_TYPE: The type of release (snapshot by default)
  • RELEASE_SCOPE: The version for the build (relevant for rc/final)
  • LOG_LEVEL: If assigned, the log level that will be used by gradle
  • REFRESH_DEPENDENCIES: If true, will refresh the upstream dependencies before starting the build (rather than using the cache)

Configuration:

  • unityVersions: BuildVersion[]
  • labels : string[]
  • testLabels : string[]
  • testEnvironment: string[]
  • logLevel: string (quiet, warn, info, debug) = info
  • refreshDependencies: boolean = false

BuildVersion

Each build version can be defined by just the string of the version or by a map with the following properties:

  • version: string
  • optional: boolean
  • apiCompatibilityLevel: net_standard_2_0, net_4_6

Usage:

// Build and unit the wdk package with custom step
def args = 
[
    logLevel: info,
    unityVersions: 
    [
        '2019.4.19f1', 
        '2018.4.23f1', 
        [version : '2020.2.4f1', optional : true, apiCompatibilityLevel : 'net_standard_2_0'], 
        [version : '2020.2.4f1', optional : true, apiCompatibilityLevel : 'net_4_6']
    ]
]
buildWDKAutoSwitch args

buildGradlePlugin

Builds a Gradle plugin, either releasing it to the gradle plugin directory or building it locally.

Configuration:

  • platforms: string[]
  • testEnvironment: string[]
  • testLabels: string[]
  • labels: string[]
  • dockerArgs: [:]

buildGradlePlugin

Usage:

def testEnvironment = [ 'osx':
       [
           "ATLAS_GITHUB_INTEGRATION_USER=${githubUser}",
           "ATLAS_GITHUB_INTEGRATION_PASSWORD=${githubPassword}"
       ],
     'windows':
       [
           "ATLAS_GITHUB_INTEGRATION_USER=${githubUser2}",
           "ATLAS_GITHUB_INTEGRATION_PASSWORD=${githubPassword2}"
       ],
     'linux':
       [
           "ATLAS_GITHUB_INTEGRATION_USER=${githubUser2}",
           "ATLAS_GITHUB_INTEGRATION_PASSWORD=${githubPassword2}"
       ]
]
buildGradlePlugin plaforms: ['osx','windows','linux'], testEnvironment: testEnvironment

Development

Whenever work is done to update these pipelines, the changes are propagated like so:

  1. The changes are added as a feature PR based on master. They must be merged into master.
  2. A release must be made on the Jenkins CI for the job corresponding to this repository. As consequence, a new branch is made named after the newer version.
  3. Any jobs that use the pipeline must do a run before the newer changes are loaded. The simplest is to trigger a build with default parameters. Any builds after that should reflect the changes that the newer pipeline introduces.

License

Copyright (C) Wooga GmbH 2018-2022 - All Rights Reserved Unauthorized copying of this work, via any medium is strictly prohibited Proprietary and confidential

About

Jenkins Pipeline shared Library

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 100.0%