Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Deploy the project to the server from GitHub     - CentOS 6.5 / Linux restart network card being given Determining if ip address x.x.x.x is already in use (Linux)

- Find details block device with Linux blkid command (Linux)

- Linux iostat command example explanation (Linux)

- Grep, Ack, Ag searches Efficiency Comparison (Linux)

- Linux Mint 17.2 64 bit installation Docker and management software seagull (Linux)

- Ubuntu 14.04 modify environment variables (Linux)

- Git Tutorial Comments (Linux)

- rpm package specify the installation path (Linux)

- Ubuntu Tutorial: How to Upgrade a New Linux Kernel 3.12.7 on Ubuntu (Linux)

- Production Environment MongoDB Fragmentation and Cluster Solution (Database)

- Management Linux Container with Docker in Ubuntu (Linux)

- CentOS7 complete step to install Hadoop2.7 (Server)

- Availability Hadoop platform - Oozie Workflow (Server)

- Installation Sublime Text 3 (Build 3065) text editor in Ubuntu (Linux)

- Linux security settings (Linux)

- Shell script to delete empty folders recursively (Linux)

- Tmux Getting Start (Linux)

- CentOS 7.0 Automatic installation CD-ROM production Comments (Linux)

- How to manage Vim plugin (Linux)

- Node.js installed on Ubuntu Upstream version (Linux)

 
         
  Deploy the project to the server from GitHub
     
  Add Date : 2018-11-21      
         
         
         
 

GitHub and it depends on the version control system Git, is definitely a very good project management and collaboration tools, whether the project is not associated with the code.

This article will discuss what options allow Git and Github better integrate into the workflow of the project which, in order to achieve a smooth automated process.

I put these options into different toolsets, these collections include automatic test run, and pull the code deployed to the server and so on.

Why do this?

With these automated processes running, you and your team can focus only associated with pure coding and code, rather than build each time have to spend a few hours to do such a thing repeated deployments.

Automation shortcomings

The main problem of automation deployment change is the change will automatically be deployed. You have to trust your team as well as they write code. That is why the automated deployment and automated testing with a typical, and the tool provided below reflects this.

More from the author's text

Blink (1), a Programmable Indicator for All Developer Needs

The Next Full Stack Language? Server-side Swift with Perfect

Of course, this also means that small problems remain the same and be a quick fix. Automation should cooperate and communicate. If pushed to the main library branch will lead to a building housing, we need to be clear, when this happens who do this thing.

An automated initial setup process may take some time. So weigh your team workflow or whether it really needs is an important thing. You spent on the testing and deployment of new build on the combined time - - if it is more than a few minutes each time, then it is worth it.

Git Hooks (hook)

Git built a framework called the expansion of the hook (http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) to automate the deployment process, and these hooks are generally specific the Git event (certain points) trigger called after our first port to handle the task. Hooks can be divided into server and client side hook hook.

server-side event is used to monitor network operation - - for example, when a repository receive push. And the client linked to the trigger because the developer performs an operation, such as committing and merging.

This is the complete list of hooks in the Git documentation (http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks). I'll comment a couple in here to get you started. Hope this make you become very useful in their current project workflow manually deployed. Hooks can be run in any language project deployment, powerful and flexible.

  pre-commit

This hook runs before all the other hook, and change before submission. It can be used to check the code for errors before submitting.

We are here to write a small JavaScript project description (of course, I deliberately left you can find a bug).

Rename hooks / pre-commit.sample   to   hooks / pre-commit, and the following test commands to such content:

#! / Bin / shjshint index.js

try to commit this change:

git commit -m "adding Javascript file"

You can see the error message:

index.js: line 5, col 25, Missing semicolon.1 error

After you add the missing semicolon resubmitted, is not being given.

post-receive

When push remote Git repository is complete, the server side of the hook trigger. In this example, we launched the latest version of a simple Web site to your Web server directory is actually a (basic) deployment.

I have an existing website contains an index.html page - as well as other pages that we will use in the examples that follow. You can also create your own using a warehouse set up here.

clone warehouse, created by specifying --bear tag contains only a version control repository of information, but not our code repository:

git clone --bare https://github.com/sitepoint-editors/GitHub-Auto-Deploy.git GitHub-Auto-Deploy.git

Now we add hooks:

cd GitHub-Auto-Deploy.git / hooksvi post-receive

to add them to the file:

#! / Bin / shgit --work-tree = / var / www / html --git-dir = / var / repo / GitHub-Auto-Deploy.git checkout -f

Note: These paths are based on the following Ubuntu environment is complete, so remember to change the path to suit your path.

This command will launch a warehouse to define the current working directory, but there is no version control data.

Change the file attributes allow it to perform:

chmod + x post-receive

Tip: The location of the installation path Ubuntu related, so be sure to remember to change the path to suit your settings. This command will check the repository to define the current working directory, but there is no version control data.

Add the executable file permissions:

chmod + x post-receive

In your local side, as usual cloning this library, using the tool of your choice, and add a new remote real-time server (remember details change the server to the details of your Web servers and users):

git remote add prod ssh: //user@domain.com/var/repo/GitHub-Auto-Deploy.git

To deploy to servers of our production environment to replace the warehouse, enter the following command:

git push prod master

You can look at server ls   var / www / html   directory, you can see the index.html file is automatically copied into your web folder inside it.

If you are using your own Git repository, you can configure it to use on the same server, and automate deployment. If you are using Git on GitHub or other external services, then the hook is not yet fully automated, but it has been reduced to one step. This can be further simplified.

GitHub of post-receive hook can be used in a reync or scp option. This is another kind of choice - - especially when your application needs to build (GitHub limits the possible commands) - - the use of post-receive hook to trigger, and then use the -f option to check out from scripts and run on an application server GitHub codebase some other necessary commands. This time, automated deployment became complicated, we have to use the next set of tools to better complete.

Automatic Deployment directly from GitHub

GitHub has its own documentation to automated deployment to the integrated platform here, including some hosting providers.

To be honest, most of the documents have some errors, inaccuracies or not play a role,   in some mainstream hosting providers there, I did some search link to official documents, for a number of other providers, I recommend you use the   post-receiveor continuous integration methods:

Heroku

AWS

Azure

Continuous Integration (CI) services

There are many able to see numerous changes repurchase agreements GitHub project applications, not only for you to deploy, and can perform other functions, such as running the test for you and build process.

Once you move to a new and more complex examples, we can use the CI

build process automation projects. First, draw a repository Master branch, and then trigger a bash script to run a build and deployment process as well as micro-blog updates. Or CI and web services can run on different servers on the same server, it all depends on your preference.

Let's quickly glance its most popular part of it.

Jenkins

You need to build your own Jenkins server, which means you can completely control over it, but it must be maintained. Fortunately, it offers multi-platform support, if you just want to try a simple case, such support also includes Docker.

Jenkins using plug-ins to achieve most of its functions, and because of its age-old, open-source nature of the wide popularity, it has a lot of plug-ins. For example, there are some   Git, GitHub   and   Twitter   of related plug-ins.

Jenkins takes a lot of configuration, and sometimes, if you want to take a combination to build your desired workflow instructions you need, you may need a lot of research.

Jenkins distributed for building and deploying - - node  

Jenkins detailed description: click here
Jenkins download address: Click here

Travis

In addition, GitHub documentation, the GitHub Travis integrated instruction outdated. Now, it is more simple: Read the documentation to find out more Travis.

Travis does not require any host server settings, so you do not need to put too much effort, you can try and keep the CI, which is a good starting point. However, extended beyond the (integrated) default integration will involve some additional configuration work. For example, microblogging requests access to the webhooks.

In repo, you'll notice Travis-- especially in their own configuration files, it has a habit of slow updates. When you do not have access to own Travis server, then the problem is difficult to solve.

Other commercial services

Continuous integration has become increasingly popular, so have a lot of new services and applications -- a lot through you may have in the creators of the tools released, and will be very harmonious integration existing tool chain and workflow among. Here are some examples:

https://buddy.works/ https://www.atlassian.com/software/bamboo/ https://www.jetbrains.com/teamcity/ https://codeship.com/ https://circleci.com/ https://saucelabs.com/ https://about.gitlab.com/gitlab-ci/ http://deploybot.com/

summary

     
         
         
         
  More:      
 
- Android in the event delivery and handling mechanism (Programming)
- CentOS build JDK environment (Linux)
- Using IntelliJ IDEA 13 integrated development environment to build Android (Linux)
- php for Linux the MySQL extension module installation and configuration (Database)
- Upgrade Goldengate 11.1.1.1.2 to 11.2.1.0.1 (Database)
- Create a custom pixel format based on an existing image data BufferedImage (Programming)
- CentOS use wget (Linux)
- JavaScript closures and the scope chain (Programming)
- Android Unzip the ZIP / GZIP data (based on the InflaterInputStream implementation) (Programming)
- Getting the Linux shell flow control statements (Programming)
- To learn linux security (Linux)
- MongoDB Study Notes (1) - Install MongoDB on Windows systems (Database)
- Quick Install software RAID on Linux (Linux)
- Ubuntu users to install household financial management tools HomeBank 5.0.0 (Linux)
- Linux compiler of GCC (Linux)
- Oracle archive log summary (Database)
- Linux file system data file deletion problem space is not freed (Database)
- Teach you to diagnose problems with strace (Linux)
- SSH Filesystem use a secure connection for network file system (Linux)
- Use apt-p2p up a local Debian package cache (Server)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.