• Jenkins. IO /zh/doc/pipe…

Jenkins setup process

One: preparation

Install Java8 (JRE or JDK can be installed), but after trying to install JRE 8 does not work, install JDK, also must be JDK 8, install a higher version also does not work

To query the Java version: ~ java-version

Two: Download and run

Follow the steps to download the software and run the following command to install the software. If port 8080 fails to be used, change the port.

Open thehttp://localhost:8080Enter the page:

You need to enter the password. You can obtain the password from: CLI:sudo vim /Users/xxx/.jenkins/secrets/initialAdminPassword

Duplicate the password above and type it in Administrator Password on the web page.

The next step

Select the plug-in on the left.

The page for automatically downloading the plug-in is displayed. Wait until the page is complete and go to the next step.

After downloading, you will enter the Settings administrator page. Look at the Settings yourself

And then set Jenkins’ URLOf course, this can be set later.

Ok, now enter the main interface.

Three: Project configuration

Let’s create a new project and choose free style

Enter the project setting page, first set the project information, second, set Git

SSH authentication is recommended. You can also use your account and password for authentication.

Set the SSH mode, the private key is ⁨ ⁨ user ⁩ / ⁨, SSH /id_rsa⁩, and copy the content.

Set up, save, so far, the basic configuration has been preliminarily completed.

Four: Automatic build with Fastlane /shell script

We can’t run projects directly yet, we need fastlane/shell scripts to automate packaging. Two plug-ins are required: Build Environment and shell.

Build Environment configuration:

Directory system management – Plug-in management – Search for Injector and install it

Then go back to the project page and see that the Build Environment is already there.

Enter:echo $PATH, write the value into the content, and assemble the format as shown in the figure below:

Add shell commands and embed fastlane package-related code:

Now it has been preliminarily built. You can try to see if it can succeed

When running a Fastlane project, two authorizations are required:

  1. Enter the AppID password to get and update the Provisioning File (this can be set in an environment variable or in a Fastlane file)
  2. Codesigh authorization requires a computer password.

The easiest way to do this is to run the project on the command line after installing Fastlane, and then run it directly on Jenkins.

V. Upload package to distribution platform (FIR. Im, dandelion, etc.)

Here to fir. Im platform as an example, dandelion process is similar

Log on to the official website of fir.im, download the fir. Im for Jenkins plugin, and then go to System Administration – Plugin Management – Advanced

Upload plug-ins

Then go to the project Settings, mainly APIToken and update information

Six: packing status notification

Accesstoken, the robot will be notified to specific groups when packing starts/succeeds/failsJenkins URL: This parameter is usually the Jenkins project address, which can be accessed on the LOCAL area network of the current computer

Seven: Jenkins server management

Generally, Mac Mini is used as Jenkins server under macOS platform. Sometimes, it is necessary to enter Macmini for Apple account management, description file management, etc. We can set screen sharing for Macmini, so that we can directly access Macmini within the LAN.

As shown in the picture, set up remote login and remote management, other computers in the LAN can access and control the computer through apple’s own “screen sharing” software.

Jenkins build problems

Error: [31m❌ error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target’s code sign Settings match the parent app’s.� 0m

By changing the certificate from full trust to system default —

Source: blog.csdn.net/yaojinhai06…

Jenkins unloading process

// Go to the following directory: Double-click the mand / / run/Library/Application Support/Jenkins/Uninstall.com also can run this sh "/ Library/Application Support/Jenkins/Uninstall.com mand "/ / delete configuration, This optional sudo rm - rf/var/root /. Jenkins ~ /. Jenkins sudo launchctl unload/Library/LaunchDaemons/org. Jenkins - ci. Plist sudo rm  /Library/LaunchDaemons/org.jenkins-ci.plist sudo rm -rf /Applications/Jenkins "/Library/Application Support/Jenkins" /Library/Documentation/Jenkins sudo rm -rf /Users/Shared/Jenkins sudo dscl . -delete /Users/jenkins sudo dscl . -delete /Groups/jenkins sudo rm -f /etc/newsyslog.d/jenkins.conf pkgutil --pkgs | grep 'org\.jenkins-ci\.' | xargs -n 1 sudo Pkgutil --forget // Brew uninstall JenkinsCopy the code

Stackoverflow.com/questions/1…

Jenkins set the boot to start automatically

Write a script

Write a startup script with Notepad (text editing), such as here I am starting Jenkins service, write:

# start Jenkins service Java - jar/Users/XXX/Desktop/Jenkins. The war (if encounter failure, designated ports, such as a suffix - httpPort = 8080)Copy the code

Sh file, for example, startup.sh.

This file does not have execute permission initially, so you need to grant execute permission to it.

Run the chmod +x startup.sh command

Once you have permissions, right-click the file, choose “Show Introduction”, and set the opening mode to Terminal open.

Add boot

Finally, add the startup file to the login item of System Settings (Settings -> Users and Groups -> Login Items) :The Jenkins service will be automatically started by executing a command on the terminal after the next power-off or restart.