Bower registration ignores .bowerrc's register value - bower

I've setup a simple bower project with the following ".bowerrc"-file in the project directory:
{
"directory": "app/bower_components",
"register": "http://1.1.1.1:1337/nexus/repository/TestBower/"
}
I use the following command to register the package to my repository:
bower register bowertestcomponent http://user#myBitbucket.a.b.c:1337/scm/btc/bowertestcomponent.git
The output is as follows:
bower bowertestcomponent#* resolve http://user#myBitbucket.a.b.c:1337/scm/btc/bowertestcomponent.git#*
bower bowertestcomponent#* checkout master
bower bowertestcomponent#* resolved http://user#myBitbucket.a.b.c:1337/scm/btc/bowertestcomponent.git#48c28acc11
? Registering a package will make it installable via the registry (https://bower.herokuapp.com), continue? No
Please mention the last line. Instead of using the value given as "register" in the ".bowerrc"-file, bower tries to upload the component to "https://bower.herokuapp.com".
The "bowerrc"-file in my user-profile (the per-user config file) looks like this:
{
"registry" : {
"search" : [ "http://1.1.1.1:1337/nexus/repository/bower-all/" ]
},
"register" : "http://1.1.1.1:1337/nexus/repository/bower-internal/",
"resolvers" : [ "bower-nexus3-resolver" ],
"nexus" : {
"username" : "deploy-user",
"password" : "aPassword"
}
}
Git-server: Bitbucket
Repository-server: Nexus 3.0

I'm pretty sure your bowerrc is not set up correctly.
In your example you seem to have the "register" value outside of the "registry" object. It should be setup like this though:
"registry" : {
"search" : [ "http://1.1.1.1:1337/nexus/repository/bower-all/" ],
"register" : "http://1.1.1.1:1337/nexus/repository/bower-internal/"
},
This way bower should be able to find your internal registry when deploying.

Related

Electron-forge package generates an empty out folder

I am working on app with electron and electron-forge, this app is being built on a virtual machine with no internet connection, so I got electron binaries files, and set the electron_config_cache to the path where I located the new binaries as well as for cacheRoot for packagerConfig in the package.json file, the problem is that:
When I run yarn package (electron-forge package) I am getting Done with green check next to each step which had been called by yarn package .. but the out folder is empty, while it should has appName-win32-x64 folder which contains .exe.
so does anyone have an idea regarding this?
Be sure that your package.json has the correct settings, including the "main" attribute as well as build directories. It seems electron forge uses electron-packager as its packaging platform so:
Following these instructions:
From Electron forge,Electron forge - packager options, Electron-packager options
Without a forge.config.js file:
Add this to your package.json:
"config": {
"forge": {
"packagerConfig": {dir:"./path/to/your/dir"},
"makers": [
{
"name": "#electron-forge/maker-zip"
}
]
}
Or with a forge.config.js file:
In your package.json, make sure to have:
{
"name": "my-app",
"version": "0.0.1",
"config": {
"forge": "./forge.config.js"
}
}
In your forge.config.js:
{
packagerConfig: {dir:"./path/to/your/dir"},
electronRebuildConfig: { ... },
makers: [ ... ],
publishers: [ ... ],
plugins: [ ... ],
hooks: { ... },
buildIdentifier: 'my-build'
}
I think it is most probable that forge is just not pointed to the correct dir, add the dir setting shown above.
The problem was a virtual machine problem, nothing related to electron forge itself, the VM was not able to copy the content from the temp folder to the out folder, this can be solved by changing the temp folder

nexus bower registry download to a wrong place

I have setup a nexus proxy registry for bower. I am using Debian 9.
bower version is 1.8.8, installed bower-nexus3-resolver (version 1.0.4).
My .bowerrc is like this:
{
"directory": "components",
"registry" :
{
"search" : [ "http://myserver.com:8081/repository/my_bower_pub/" ]
},
"resolvers" : [ "bower-nexus3-resolver" ]
}
under ~/temp/bower_tst directory, I do bower install q. Then I see ~/temp/bower_tst/q-2.0.2, which has all the package files. However, under ~/temp/bower_tst/components/q the directory is empty.
I switched to use https://registry.bower.io and removed bower-nexus3-resolver, the .bowerrc is like:
{
"directory": "components",
"registry" :
{
"search" : [ "https://registry.bower.io" ]
}
}
Then bower successfully downloaded q and installed it under the components directory. Please help, is this a bug of the bower-nexus3-resolver?
It's because buggy bower-nexus3-resolver#1.0.4. After switching to version 1.0.2, it works just fine.

How to get the dockerTag label via the Artifactory API?

I am using Artifactory Version 4.16.0 and need to retrieve the Docker Info Label used to tag my image using the Artifactory API.
The label is definitely set as it appears in the Artifactory UI, under the Docker Info panel, in the Label key-value section.
Using the following API I can see the manifest.json
curl -uadmin:pass https://artifacts.mycompany.com/artifactory/api/storage/my-docker-dev/my-component/my-image-1.0.0-1498449060
but this does not contain the Docker Label I am after. I read the documentation, but cannot figure out how I can achieve this.
The access the build properties, which include the Docker labels, the name of the artefact must be followed by /manifest.json?properties
e.g.:
curl -uadmin:pass https://artifacts.my-company.com/artifactory/api/storage/my-docker-dev/my-component/my-image-1.0.0-1498449060/manifest.json?properties
returns something like
{
"properties" : {
"docker.label.com.my-company.repository.commit.full" : [ "4fb524c0cb2139b15074b348bddb1952fa68deb1" ],
"docker.label.com.my-company.repository.commit.short" : [ "4fb52" ],
"docker.manifest" : [ "develop-1.0.0-1498449060" ],
"docker.manifest.type" : [ "application/vnd.docker.distribution.manifest.v2+json" ],
"docker.repoName" : [ "my-component" ],
"sha256" : [ "0c8f855fbd7f6065972eec9a8ca7e48980f19sd3db07c47751bbe17043ddda4d" ]
},
"uri" : "https://artifacts.my-company.com/artifactory/api/storage/my-docker-dev/my-component/develop-1.0.0-1498449060/manifest.json"
}

No components are shown in the nexus bower proxy repository

I had setup a proxy repository for bower (http://bower.herokuapp.com) as per Nexus Document. After running bower install command, nothing was shown in the components section.
All the files were downloaded to bower_components of my local directory. But it is not available in the nexus components.
It always try to download libraries directly from internet instead of caching it.
My .bowerrc configuration,
{
"directory": "bower_components",
"registry": {
"search": [
"http://localhost:8081/repository/repo-all"
],
"register": "http://usr:pas#localhost:8081/repository/repo-internal"
},
"resolvers": [
"bower-nexus3-resolver"
],
"nexus": {
"username": "usr",
"password": "pas"
}
}

Bower install an ignored file

I would like my code to include just one file from nvd3. I could just grab that file and include it in my source directly. But I wanted to have it loaded automatically as a bower dependency.
bower info nvd3 shows that all the individual src files will be ignored. bower install is going to give me to whole library. I don't suppose there's a way to say in my bower.json something like:
"dependencies": {
"nvd3": {
"version": "~1.1.15-beta",
"ignore": ["all the stuff I don't want", "**/*"],
"but-include": ["that one src file I still want", "src/models/tooltip.js"]
}
Just thought I'd ask.
But, assuming this is impossible, should I just put the file in my source, or is there some better way. Like depend on the path to that file in the GitHub repo?
Try Bower Installer. You can use it to basically pull all the required files for a package into a folder of your choice using your bower.json file.
Sample syntax
{
"name" : "test",
"version": "0.1",
"dependencies" : {
"backbone" : "latest",
"requirejs" : "latest"
},
"install" : {
"path" : "some/path",
"sources" : {
"requirejs" : "bower_components/requirejs/require.js"
}
}
}

Resources