P
P
Pavel2016-06-03 19:26:26
git
Pavel, 2016-06-03 19:26:26

How can you use gulp-git at all?

The task is quite simple. You need to pull from the repository, and then minify the files and put them in the directory.
There is a directory /var/builder, there are gulpfile.js, package.jsonand node_moduleswith all the gulp modules and gulp itself (version 4.0). In package.json, I set the path to gulp and run gulp from the /var/builder.
I use standard gulp-git tasks, I run: gulp init -> gulp addremote -> gulp pull, everything is fine, but it spams everything into the /var/builder. And this is bad, because in the case of gulp push, it will try to send node_modules to the server.
Let's say we forget about it, add them to .gitigore, but the gulp checkout command does not work. That is, if the files are deleted, he will simply say

[19:02:43] Starting 'checkout'...
[19:02:43] D	.gitattributes
D	index.html
D	scrollTo.jquery.js
 Already on 'master'

Why when I put gulp clone it creates a folder with the name of the repository in /var/builder, but then gulp pull does not work, even if I do gulp init, gulp addremote?
What is the sequence of actions to do so that gulp pulls the repository into the folder /var/repo, checks for missing files, and then, in case of 100% identity of the repository, performs my tasks minification, less, babel, destination ?
Those. Roughly speaking, you need to do this for the first time: Copy the repository -> Run minification -> Copy to public
And each subsequent one is: Check for new commits -> Download them -> Check if something has been deleted -> Repository 100% identical -> Minify -> Copy to puclic
The problem is added by the fact that the repository is large, it is private in BitBucket, and the password should not be requested every time. Using https://login:[email protected]/company/repo - still asked for password. And it’s very strange: once clone was successful, once pull, once asked for a password again, and once it gave an error, even crack.
PS I have been struggling with this for the third day, I can not understand why this is happening. I'm already thinking of writing my own wrapper for gulp to use git commands directly, without this damn gulp-git.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
littleguga, 2016-06-03
@littleguga

I think you are trying to make your own implementation of continuous integration . Take it ready.
Travis/Jenkins, here's how-to:
Website Continuous Integration with Travis CI, Jek...
Building a Node.js project
First Steps In Setting Up Travis CI To Your Javasc...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question