Git configuration and Jenkins packaging under Mac

Source: Internet
Author: User
Tags git clone build gradle

Today I configured the next Jenkins, it is quite smooth, the whole process and share with you.

1. See if the secret key exists

Open terminal to see if an SSH key already exists: CD ~/.SSH

If there is no key then there will be no such folder, there is a backup to delete, can also be deleted directly.

2. Generate a new key, the command is as follows

$ssh-keygen-t rsa-c "[Email protected]"

Press ENTER to generate Id_rsa and id_rsa.pub two files, enter the file directory with a command and copy the key in Id_rsa.pub

$CD ~/.ssh

$cat id_rsa.pub

And then paste it into your own github

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702213405211-423439644. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Add SSH

If you don't have repositories on GitHub, you'll need to create your own repositories and then generate your own remote address for a GitHub project, like this: [email protected]:xxx/xxx.git

Then create a local directory for your project, using the following command

$git Init

$git commit-a-M "Readme.md"

$git Push Origin Master

$git Clone [Email protected]:xxx/xxx.git

Pull the remote code to the local directory. If there is no project remotely, you can push the local code to the remote server

$git Add.

$git commit-a-M "Update"

$git Push--rebase

Each subsequent change to the commit can be used normally.

Next I say I first configured Jenkins today, is also a reference to the next online many articles, the following:

First we open the terminal and install Jenkins, the command is as follows:

$brew Install Jenkins

Post-Install with commands

After the $jenkins appears as follows

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702214344258-1800390786. PNG "style=" margin:0px;padding:0px;border:0px; "/>

The installation is successful, after we open the browser input URL localhost:8080 after using the local Administrator admin login to install the relevant plug-ins, mainly Git Plugin
Gradle Plugin and Android Lint Plugin (I was all installed). Below, refresh the next page to see this page.

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702214918899-1816745942. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Of course we can also manage the plugins we have downloaded in System management, and we can download the plugins we need again.

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702215056899-152858278. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Then we open system management inside the system settings

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702215138102-8711114.png "Style=" margin:0px;padding:0px;border:0px; "/>

Setting Global System Variables

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702215259118-1715074208. PNG "style=" margin:0px;padding:0px;border:0px; "/>

The key can be any string, such as the Android_home value is your Android SDK directory path, input after the application save.

And then we can start a new project.

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702215442243-475261778. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Click New to enter the name of the build project for the first project and select the first item

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702215648149-773017650. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Click OK when you're finished.

Then we configure GitHub remote address

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702215801352-1406344164. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Enter your own GitHub remote project address in the input box and click Save.

Immediately after the build, the construction of the project exists directory in the configuration can be set,

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702220747164-1863755557. PNG "style=" margin:0px;padding:0px;border:0px; "/>

After the build we can again Jenkins root directory. Jenkins/workspace folder below you can see our built projects

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702220245852-743349568. PNG "style=" margin:0px;padding:0px;border:0px; "/>

This is built after we have configured the build Gradle, not configured this gradle when workspace the following project does not have a build folder, we also need this step configuration,

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702221045133-1021193190. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Once again, we see all the tasks we build under the home build queue:

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702221503368-1503933199. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Then we can see the Gradle folder in the previous workspace directory, which is the Gradle file under our build Project wrapper/dists, you can copy directly to this folder.

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702221233789-1475317507. PNG "style=" margin:0px;padding:0px;border:0px; "/>

Then the built-in file apk will be found in the following directory:

650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/337690/201707/337690-20170702221612524-1412463303. PNG "style=" margin:0px;padding:0px;border:0px; "/>


Git configuration and Jenkins packaging under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.