How to author a bower package? - bower

We have created successfully a bower package and it is working great with Subversion and private-bower.
The issue I am facing now, is that we need also the generated files to be commited into (Subversion or Git) to work properly for
bower install
or
bower update
Now every build creates a conflict in the local copy of the repository.
My question is, can I tell bower to do a post install or post update command to execute a build?
In my case it should run a grunt task to build the files locally.
Just wondering if bower is not capable of doing such steps to avoid conflicts on the git/svn repository?
Or what is the suggested way to avoid merge conflicts?

There are postinstall hooks in bower https://github.com/bower/bower/blob/master/HOOKS.md but you can't rely on it as a package provider (they're designed to be used by the developpers who install your package)
For your situation, teams that provide bower packages that require a build step have two main workflows:
The repo tied to the bower registry is the source repo. Sources & build files are in it (like bootstrap). So when you bower install, you retrieve the whole repo with all the sources, build routines, etc ... which can be quite big. That's your case currently.
The repo tied to the bower registry and the repo holding the sources are two different repos (like angular):
Your build directory is in fact the repo tied to bower
Each time you make a new release, you build and then commit from that repo.
If you're having versionning problems, maybe you should switch to the second workflow (which will also let you clean all the unecessary files like build routines).

Related

TFS Incremental build: Clean Repository

I am working with an older version of TFS and am trying to save time by only doing an npm install if the packages have changed or only webpack if the javascript files have been changed. There are a few projects in the repository that are built every time but if we can skip the unchanged projects it will save a bunch of time. After a bit of research I think the answer is an incremental build.
The build's initial Get Sources step has Clean set to false.
I don't see any other places to toggle clean build other than the initial Get Sources. Or any options with the npm build steps to check before doing an install or webpack.
I found this documentation note in the Clean build options:
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/vsbuild-v1?view=azure-pipelines-2018
This option has no practical effect unless you also set the Clean repository to false.
But I don't understand where the Clean repository setting is, or if the Get Sources Clean is the Clean repository setting and I need to find a different Clean option.
If it isn't obvious I'm pretty new to TFS builds so breaking down the answer will be helpful.

Cannot install specific projects in monorepo (RushJS) on BitBucket

I have a monorepo project that is using Rush which each projects can be either both frontend or backend dependencies. Some projects are used by both frontend and backend while some are for only either. Thus, I only want to install each specific dependency on the monorepo.
I first tried to install on the frontend using Git clone url with something like this:
https://bitbucket.myprivateorg.mycountry/scm/#.git/<monorepo_project_subdirectory>.
I also tried some other combinations but of course it did not work. I have looked it up, and I noticed that npm lacks this support. However, some solutions that I saw was GitPkg but it only works for GitHub. All my repos are strictly on BitBucket only.
Is there any equivalent of GitPkg for BitBucket?

Jenkins install plugins offline

Installed Jenkins on a Linux server and want to install some plugins manually.
I want to install Blue Ocean and Artifactory.
For both plugins I downloaded the hpi file and tried to install it, but I get a lot of dependency errors.
Do I now have to install those dependencies manually as well? or is there a better way to do this?
I tried to install one of those dependency and that one also had some dependency errors as well :-(
The Linux server is not able to access the internet.
Thanks!
Robert
You are correct that BlueOcean has a lot of dependencies.
Given you are not able to connect to the internet you will need to download all 21 BlueOcean related hpi files and upload them from the Manage Jenkins > Manage Plugins > Advanced tab.
Alternatively, if you have access to the server that your Jenkins instance is running on you can copy the hpi files into the %JENKINS_HOME%/plugins folder. The corresponding directories (exploded from the hpi, which is just a zip file) will be created on Jenkins restart.
The easiest way to acquire all 21 plugin files is to open The Jenkins plugin page and search for blueocean. Download the same numbered version of all 21 and upload them one by one. Order shouldn't be an issue. As long as they are all present on restart the dependencies will resolve.
Same process goes for any other plugin. If you're able to get the machine connected to the internet it will make the process a lot simpler as you will be able to use the update center, which manages dependencies and update notifications.
Same case here. Our Jenkins is setup in OpenShift which is not allowed to connect to the Internet. Downloading a plugin 1-by-1 is tiresome. Not to mention that each plugins have its own dependencies that needs to be downloaded as well.
Here's what you would do...
Run a Jenkins locally in a machine that can download plugins.
Download and update all the plugins you want using the Update Center.
Go %JENKINS_HOME%/plugins directory. Inside this folder you would see *.jpi. These are your plugins. Its dependencies will be downloaded as well.
Rename it to *.hpi then keep it in some directory.
To test...
In your local Jenkins delete everything in %JENKINS_HOME%/plugins directory then put all *.hpi in this directory.
Restart your local Jenkins.
Verify if the plugins you require are installed and updated.

How can I reference in paket.references a file from a git repository?

I have a TFS git repository in my paket.dependencies file:
git http://mytfs1server:8080/tfs/2015Projects/_git/DEV-Commons
Withing that repository, there is a file "src/Tools.fs"
In the paket.references file, how do I tell Paket to add a reference to a file within that git repository so that Paket can add it to the fsproj file?
Paket seems not to support this at the moment. There is single file dependency functionality for GitHub, but general git dependencies are handled differently.
You can achieve the same semi-manually though. The way it works for GitHub is that it adds the referenced file as a link to the project. As long as you have the repo dependency in paket.dependencies, Paket will clone it under paket-files folder and you can link to the file stored there (Paket will need to clone the whole repo, but you'll find your file there).
This way you will get the same behavior in VS and other IDEs. You will lose some Paket support as there will be no information in paket.references that the project depends on the linked file. But for this kind of dependencies there usually is no problem with this being a transitive dependency for something else, which would require version conflict resolution. You can pin specific commit in paket.dependencies for git dependencies anyway.

Installing rails plugins as git submodules

(Why there is no|Is there a) way to run
./script/plugin install -SOME_HIDDEN_OPTION git://github.com...
So that the plugin is installed as git submodule. The reason for submodules is to keep unrelated code off project's repository.
Perhaps there is a reason not keep plugins as submodules?
./script/plugin install git://github.com/something/something...
Should work without a submodule...
If you want to update the plugin, just navigate into that plugin's folder and do a git pull.
The only advantage of the submodule is that you can see all your submodules from anywhere in the git repository. Otherwise, git just find the nearest git repository and works on that... in te above case, navigating to the plugin's directory will make it the repository you are working on.
Submodules are a bit warty. Also if you clone your repo and one of your submodule remotes is down you're stuck.
I end up tweaking the local code on occasion as well, which necessitates it being in my repo.
Braid makes managing this situation simple.

Resources