The original address of this article is Github

Fastlane part: Fastlane packs iOS

The document

Website – Jenkins

Official website – Jenkins Download

MacOS Installers for Jenkins Weekly

Official website – Jenkins User Manual in Chinese

Noun explanation

  • Continuous Integration (CI) code composition, construction, deployment, testing, and Continuous execution of the process and feedback results;
  • Continuous deployment (CD) Deployment to the test environment, pre-production environment, and production environment.
  • Continuous Delivery (CD) is deployed to the production environment for use by customers.

I. Jenkins version selection

Second, macOS installation

macOS Installers for Jenkins Weekly

Install using Homebrew

➜ brew install jenkins
➜ brew install jenkins@YOUR_VERSION
➜ brew services start jenkins
➜ brew services restart jenkins
➜ brew upgrade jenkins
Copy the code

Iii. Enable Jenkins service

  • The command
➜ brew services start jenkins
➜ brew services stop jenkins
➜ brew services restart jenkins
Copy the code
  • In field
➜ XiOS Git :(Master) Qualify Brew Services start Jenkins ==> Successfully started 'Jenkins' (label: ➜ XiOS git:(master) university brew services stop Jenkins Stopping 'Jenkins'... (might take a while) ==> Successfully stopped `jenkins` (label: ➜ XiOS git:(master) university brew services restart Jenkins Stopping 'Jenkins'... (might take a while) ==> Successfully stopped `jenkins` (label: homebrew.mxcl.jenkins) ==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)Copy the code
  • To verify, go to http://localhost:8080/

  • Log in,open /Users/lionsom/.jenkins/secrets/initialAdminPassword Obtaining the Administrator password

4. Install plug-ins

1. Install the recommended plug-in

Because of the first installation, do not understand, so choose the recommended plug-in.

2. Registered

The local user name is linx

Password: 123456

3. Change the port number 8080 -> 8989

  1. Find the Jenkins physical path
➜ which Jenkins/usr/local/bin/JenkinsCopy the code
  1. Open directory/usr/local/bin/
➜  open /usr/local/bin/
Copy the code

  1. Modify thehomebrew.mxcl.jenkins.plist

  1. Restarting Jenkins Service
➜  brew services restart jenkins
Stopping `jenkins`... (might take a while)
==> Successfully stopped `jenkins` (label: homebrew.mxcl.jenkins)
==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)
Copy the code

Login: http://localhost:8989

5. Construction method

1. Use the Xcode plug-in

Conclusion: Not recommended, plugin support is not in place.

2. Use shell scripts

This is fastlane construction. See fastlane next door.

Script construction

5.1. Operation process

5.2. Script construction failed

“Why”

This problem may occur because you have not set the pod run path, the solution is as follows

“Address”

System Management > System Configuration > Global Properties

Enter echo $PATH to obtain local environment variables

Check the environment variables, the key defaults to PATH, and the value is the string you copied from the terminal.

5.3. The rebuild succeeded

7. Remote trigger builds

How do we support HTTP requests to build

1. Configure “Build Trigger”

In the build trigger, we can find “Trigger remote build”, check and set Token.

2. Simulate an HTTP request

Postman is used to simulate HTTP requests. The request fails and the authentication fails. The anonymous user has no permission.

3. Add permissions

Go to Jenkins web page -> System Administration -> Security -> Global Security Configuration -> Authorization Policy to add operation rights for anonymous users.

4. Simulate HTTP request build again, success!