Method for realizing continuous delivery of iOS APP
Technical Field
The invention belongs to the technical field of computer APP, and particularly relates to a method for realizing continuous delivery of an iOS APP.
Background
The conventional iOS packaging method is now manual compilation and manual packaging by the Xcode tool because iOS packaging is relatively time consuming, where each step requires a developer to operate, and no intermediate developers can do anything else. After the Xcode gets out the package, the developer needs to manually upload the package to a third-party platform for publishing and configuring the related information. Therefore, it can be seen that the conventional packing manner is complicated in process, and careless mistakes are easily caused when relevant configuration is performed on the exported packages, which requires a developer to perform operations step by step, which results in low working efficiency. If it is straightforward for a developer to nightmare when items need to be packaged frequently.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a method for realizing continuous delivery of iOS APP, which can realize convenient and quick packaging, improve the efficiency and reduce the error rate.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a method for realizing continuous delivery of iOS APP comprises the steps of exporting an iOS installation package through fastlane, and then realizing platform delivery through a swift language script; registering GitLab Runner, and binding the started Runner and GitLab CI; and configuring a gitlab-ci.yml file in a project root directory, so that when a developer prints a tag version of the project, the project can automatically renew a pod library of the project, then triggering the previous operation of exporting an iOS installation package by fastlane, and combining tag version maintenance and iOS APP continuous delivery in the development process. The method specifically comprises the following steps:
step S1: registering a GitLab Runner for a local project, binding the started Runner with a GitLab CI on a corresponding remote Gitlab project, generating a Gitlab-ci.yml file in a project root directory, and waiting for configuration;
step S2: packaging local projects through a fastlane script and exporting an iOS installation package;
step S3: uploading the package printed by the fastlane to a specified external platform through the swift script;
step S4: yml file in step S1 is configured to execute fastlane script in step S2;
step S5: the user marks a specified tag version on the gitlab remote item, thereby automatically triggering the fastlane script in step S2 and the swift script in step S3.
According to the method for realizing continuous delivery of the iOS APP, multiple project ends can be copied in the operation of leading out the iOS installation package by fastlane before triggering, and the multiple projects are subjected to tag printing so as to realize continuous delivery in batches.
According to the method for realizing continuous delivery of the iOS APP, the package printed by the fastlane is uploaded and simultaneously accessed into a third party notification system, and the uploading is completed and then the related personnel are notified.
According to the method for realizing continuous delivery of the iOS APP, the third-party notification system is a nailing robot or a mail.
According to the method for realizing continuous delivery of the iOS APP, a packing and exporting command and a swift script command are configured in a fastlane script, and the script in the swift is continuously executed after the fastlane packing and exporting script is executed.
According to the method for realizing continuous delivery of the iOS APP, files required by a user can be uploaded in a swift script and appointed to an external platform; the files required by the user are version files of the project or files for triggering the version updating detection function in the APP, so that the APP of the old user is updated to prompt operation.
The method for realizing continuous delivery of iOS APP is configured in a gitlab-ci.yml file as follows: when a tag operation is performed on a specified branch, a fastlane script operation is triggered.
According to the method for realizing continuous delivery of the iOS APP, when a tag version of a specified item is printed, a user uses visual SourceTree packaging, or uses SVN to package, or uses a command line, or directly operates on a gitlab server manually.
The method for realizing continuous delivery of the iOS APP automatically packages and uploads the iOS APP to an appointed external download platform, integrates a download address of the appointed external download platform into a third-party notification system through a swift script, generates a two-dimensional code and notifies related personnel of downloading; the third party notification system is a nailing robot or an email, and the external download platform is dandelion or fir.
Has the advantages that: compared with the prior art, the invention has the advantages that:
(1) compared with the traditional Xcode packing method (the Xcode is manually compiled firstly, then manually packed and exported, and then uploaded to a third-party platform), the integrated automatic packing method has the advantages that the system configuration is adopted as an input parameter, the whole-process automatic packing mode is adopted, the packing can be conveniently and rapidly carried out, the efficiency is improved, and the error rate is reduced.
(2) The invention combines tag version maintenance and iOS APP continuous delivery in the development process of a plurality of projects, greatly liberates the complicated packaging and releasing process of the ordinary iOS, reduces the error of packaging and releasing the tundish versions of a plurality of projects of personnel, and greatly improves the working efficiency.
Drawings
FIG. 1 is a flow chart of the main steps of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with examples are described in detail below.
The noun explains:
and (3) continuous delivery: (Continuous delivery, abbreviated as CD) is a software engineering technique, which completes the production process of software products in a short period to ensure that the software can be stably and continuously maintained in a state of being released at any time. His goal is to make the construction, testing, and release of software faster and more frequent. This way, the cost and time of software development can be reduced, and the risk is reduced.
gitlab: the web service is an open source project for a warehouse management system, uses Git as a code management tool and is built on the basis of Git.
gitlab-ci: i.e., gitlab continuous integration, means continuous integration. For managing the build state of each project.
GitLab Runner: for performing the build task.
Fastlane: fastway is a set of automation tools written by Ruby, aiming at simplifying the deployment process of Android and iOS and automating the workflow. It can simplify some tedious, repetitive work like screenshots, code signing and publishing apps.
Packaging APP: and compiling and outputting the code into an installable apk file.
Example 1
As shown in fig. 1, the technical solution of the method for automatic packaging and releasing of APP of the present invention is as follows:
a method for realizing continuous delivery of iOS APP comprises the following steps:
step S1: firstly installing GitLab Runner in the local environment, and firstly operating a command at a Mac terminal: curl-Lhttps:// packaging. gitlab. com/install/retrieval/runner/gitlab/runner. rpm. sh | sudo bash, then execute the command at the Mac terminal: sudo yum install gitlab-runner.
Step S2: and then registering GitLab Runner for the local project, binding the started Runner with GitLab CI on the corresponding remote Gitlab project, generating a Gitlab-ci.yml file in a project root directory, and waiting for configuration. The registration specifically comprises the following operations:
(1) opening a project page in the GitLab, and finding Runners in the project setting, wherein the specific path is setttings-CI/CD-Runners-right side expansion button-Setup a specific Runner menu;
(2) running a gitlab-runner-register at the terminal;
(3) inputting CI URL (specific the following URL along the Runner setup), and returning;
(4) inputting Token (Use the following registration Token setting setup: the corresponding Token behind it), and returning;
(5) inputting the name of Runner (unimportant, can input and make a mark), and returning;
(6) if a tag mark is input, returning; (note: because this embodiment uses the native machine as the service address, here tag thousands of things input, otherwise the following operation is always blocked, the corresponding server can not be found, default to Docker, go back directly.)
(7) The type of Runner is selected, input Shell, enter.
Step S3: realizing automatic packaging of local projects through fastlane scripts; configuring an automatic packing and execution swift script command in the fastlane script, and continuing to execute the script in the swift after the execution of the automatic script packing of the fastlane is finished;
step S4: uploading a package printed by fastlane or a file required by a user to a third-party platform through a swift script, simultaneously accessing a third-party notification system, such as a nail robot, and notifying related personnel after uploading is completed; the file required by the user can be a version file of a project, or a version updating detection function in the APP can be triggered, so that the APP of an old user can perform updating prompt operation;
step S5: yml file in S2 is configured to execute fastlane script in S3; yml document is configured as follows: when tag operation is carried out on the appointed branch, fastlane automatic packaging operation is triggered;
step S6: the user marks a specified tag version on the gitlab remote item, so that a fastlane script in the step S3 and a swift script in the step S4 are automatically triggered; note that, here, the user can make multiple corresponding tag versions for multiple items at the same time, thereby achieving the purpose of batch continuous delivery. The tag version is printed, and a user can use visual SourceTree or SVN to package, or use a command line, or directly operate manually on a gitlab server;
step S7: after the package is automatically packaged and uploaded to a third party, the download address of the third party platform is integrated into a third party notification system, namely a nail robot, through the swift script, a two-dimensional code is generated, and relevant personnel are notified to download the two-dimensional code.
Compared with the traditional Xcode packing method (the Xcode is manually compiled firstly, then manually packed and exported, and then transmitted to an externally specified download platform), the packing mode of the invention adopts the mode that the system is configured as input parameters and the whole-process automatic packing is adopted, thereby being capable of conveniently and rapidly packing, improving the efficiency and reducing the error rate.
It should be noted that all of the features disclosed in this specification, or all of the steps in any method or process so disclosed, may be combined in any combination, except combinations where mutually exclusive features and/or steps are present.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention as defined in the appended claims. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.