Jenkins parametric construction:

Parameterized build means that the Git Parameter plug-in is used to set parameters before packaging, so as to carry out multi-directional build more flexibly

A: git Param

This is a parameterized build of the Git branch,

  • Name: BRANCH can be understood as the macro definition of this parameterized build

  • Parameter Type: This field indicates whether the selected packaging branch is tag or branch, or both. (Branch is usually used when a large number of apps are released and the Tag can be lengthy. You can set up a separate project to package the historical version.)

  • * does not Filter by default. Regular expressions are supported here. It is recommended that project branches use the Git-flow specification for accurate matching

    • This can be set to when only branches of Release need to be shownorigin/release.*
    • Sometimes the release branch is release or hotfix, which needs to be supported at the same time.origin/((release)|(hotfix)).*(The default re does not require parentheses. Parentheses are required.)
  • Sort Model: Sort Model

  • Selected Value: Indicates the default Value

  • Quick Filter: Searches for branches quickly. You are advised to add branches if there are too many branches. Can improve the efficiency of packaging

When a project sets a branch, it can be retrieved with ${}

Let’s save the Settings and start building the project

Two: the Choice of the Parameter

Defines a simple string parameter that can be selected from a list. Can be used as environment variables during the build processWe can put the projectCONFIGURATIONThe certificate export method can also be used as a parameter (development.adhocEtc.) as parameters, you can package from various angles through different configurations to meet most packaging requirements

3: the File Parameter

File parameterization can be used to replace specified files in a project. For example, replace the plist file of the project with the PList file, so as to achieve the purpose of changing the default configuration of the PList file.

Four: other

${macro} = ${macro} = ${macro} = ${macro}

Work with shell scripts to automate builds

Background: This file is intended to provide an alternative to editing lane commands directly in FastFile

Usage: Just drag the file to the command line

Type: multiple similar scripts can be added, such as development, adhoc, App Store. This can also be done by executing different shell files

#! Export FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT=120 # SECONDS=0 # PWD display the current working directory #project_path=$(PWD) Shell_path =$(CD $(dirname $0); # get project_path=$(dirname "$shell_path") # Take the current time string to add to the end of the file now=$(date) +"%Y_%m_%d_%H_% m_% S") # Specify the scheme name of the project scheme="Micropulse" # specify the configuration name to be packaged configuration=$1 if [-z "$configuration"]; Then echo "configuration is empty" configuration="Debug" fi # Currently supports app-Store, Package, ad-hoc, Enterprise, Development, and Developer-ID, Export_method =$2 if [-z "$export_method"]; Then echo "export_method is empty" export_method="development" fi Workspace_path ="$project_path/${scheme}. Xcworkspace "# specify the output path output_path="$project_path/fast_ignore" # specify the output archive file address Archive_path ="$output_path/archive/${scheme}_${now}. Xcarchive Ipa_path ="$output_path/app/${scheme}_${now}. Ipa "ipa_name="${scheme}_${now}. Ipa ${configuration}===" echo "===workspace path: ${configuration}===" echo "===workspace path: ${workspace_path}===" echo "===archive path: ${archive_path}===" echo "===ipa path: ${ipa_path}===" echo "===export method: ${export_method}===" echo "===commit msg: Build fastlane gym --workspace ${workspace_path} --scheme ${scheme} --clean --configuration ${configuration} --archive_path ${archive_path} --export_method ${export_method} --output_directory ${output_path} - output_name ${ipa_name} # # upload fir fir the publish ${ipa_path} - T "5 dd722b208b7b378bcd9ba3d1f8609ff" - c "${commit_msg}" # output Total available echo "= = = Finished. Total time: ${SECONDS} s = = =" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -Copy the code

This is the parameterized configuration of the project

Specific use: