1.Jenkins installation and operation

Installed 1.1.

Using terminal installation commands:

brew install Jenkins
Copy the code

1.2. Start and run

Using terminal Commands

jenkins
Copy the code

1.3. Open the Jenkins

Browser input

http://localhost:8080/
Copy the code

1.4. Restart/reload

If you need to restart or reload (typically after plug-in installation and uninstallation), enter

http://loaclhost:8080/restart

http://localhost:8080/reload
Copy the code

1.5. Unlock Jenkins

Let’s copy the path in red, go to the folder, open the file, copy the password inside, and then we can go to the next step.

1.6. Install custom plug-ins

The left side is to install the suggested plug-in, and the right side is to select the required plug-in installation. In this case, we choose the left side by default to install the suggestion plug-in.

1.7. Create a user

After entering the information, save and finish. Jendkins is already installed and configured.

2. Jenkins USES

2.1. Install the plug-in

Click System Administration -> Plug-in Management -> Optional Plug-ins.

Enter KeyChains and Provisioning Profile Management. This plugin is used to configure Xcode Profile files.

Enter git parameter to select the branch information.

Enter Post Build Task to execute the script when the build is complete

Enter Ding Talk to configure the pin robot information.

Appellate plug-ins can be installed according to their own needs, click on the direct install line.

2.2. Configure plug-in information

Keychains and Provisioning Profile Management

  1. Go to System Administration, go to KeyChains and Provisioning Profile Management, and click there.
  2. Found in the visit to/Users/administrator username/Library/keychains/login keychain – db, find the path, change the file to login. The keychain. And upload the changed files.
  3. Found in the visit to/Users/apple/Library/MobileDevice/Provisioning Profiles /, the need to project the Profile file to upload.

2.2.2. Nailing robot configuration

For this, we first went to Dingding and added the dingding robot in the group. The robot set up and filled in the robot name. It can be seen that there is Webhook and there are three security Settings. Here I have chosen keywords (depending on your situation).

Back to Jenkins, to use the Pin push message, go to Administration -> System Configuration to find the Pin configuration. When the notification time is selected, when the construction fails and when the construction succeeds (depending on the individual situation), the robot configuration items, mainly Webhook, name and keyword should be the same as the above configuration. There’s a test button in there, so we can test it and see if it works.

2.2.3. Email configuration

If we need to send emails, we also need to configure the email information.

  1. System Administration -> System Configuration, find the system administration email address, fill in the email address, this email address should be the same as the following email address.
  2. System Administration -> System Configuration, find Extended E-mail Notification, and fill in your SMTP Server and port number, for example, QQ is smtp.exmail.qq.com. We can search it on Baidu, or check it in your mailbox and find the Server Settings. Select Advanced and fill in your email address and password.
  3. Default Recipients, both Recipients can be Recipients.
  4. Default Triggers, the Default trigger, we can choose failure-any here (depending on your situation).
  5. System Management > System Configuration > Email Notification. The SMTP server is the same as 2, including the port, account and password. Test it out, and it’ll work.

2.3. Create a Task

Create a new task, fill in the task name, and choose to build a free-style software project.

2.3.1. General

: Enter the description of a project.

Nail nail configuration (plug-in installation only), click advanced, fill in the phone number of the notifier, multiple notifiers need to newline, fill in the user-defined content.

Parameterize the build process: Select Git Paramter(only available when installing the plug-in), fill in the name, description, and parameter type select branch and tag. So here we can fill in the selected character bool, depending on your situation. We can use the $name elsewhere to get the value you configured before the build. For example (whether or not you send the value of the mailbox can be configured later).

2.3.2. Source management

For code management, choose Git, fill in the Git link of your project, and fill in the credential. For example, if HTTP is used, just fill in the account password. If you’re using SSH, fill in the private key. The $brachName here, which is the designated branch, was created by the parameterized configuration procedure above. Source code library browser, such as our company to fill gitlab and URL path (depending on personal situation).

2.3.3 Building the Environment

Build triggers are not filled in because they are not used, and you can also fill in your own needs.

To build the environment, we choose Keychains, Code Signing Identities and Mobile Provisioning Profiles. Just select the content we configured before.

2.3.4. Build

Here we can choose to execute shell or run with Timeout, which has a set Build timeout. Build Step is the script in the project, which is used in conjunction with Fastlane.

2.3.5. Operation after construction

Post Build Task is used to upload ipA to the SVN of the company after construction. The parameter isImportToSVN is also used to configure whether to upload THE IPA to the SVN. It depends on your personal situation. Fir), you can ignore this operation.

Select Editable Email Notification to specify the Email Notification to be sent. Do not fill in the Project From. The Project Recipient List is the email address of the Recipient, separated by commas. Fill in the Content Type according to the Content format of your Default Content. Pre-send Script is the sending Script and can be omitted without setting parameters. Triggers can be selected as success and failure, as shown in the screenshot.

2.4 Running Tasks

If we do not configure parameters, we click build Now to run. If we configure parameters, we need to select Build with Paramter, fill in our own parameters, and then build.

Then we wait for the build History section to complete the task. Of course we can click on it and see the console output. This displays the Finished: Success message for failures.

3.FastLane

There’s so much Fastlane on the web that I won’t write it here. Provide official document link and the following a few big god link, let everyone refer to it.

4. Conclusion

I am also a novice, write insufficient, please give us more advice. Some of the pictures are obtained from others, if there is infringement, please contact me, I immediately delete, thank you.

5. Reference documents

docs.fastlane.tools/

www.jianshu.com/p/ce600df02…

Juejin. Cn/post / 684490…

www.jianshu.com/p/db5fe7fed…