Is there any easy way how to show a library version used in project in giltab README.md / badge, parsed directly from repository source code? I mean something automatic, I do not want to increase version in readme everytime it is changed in the source code.
There is no built-in solution (open issue on GitLab)
My suggestion is to build your own script that reads the property from the source code, and replace it on your README.md file.
You can run this script as a job on your "release/deploy" stage.
P.S.
It's best to handle the versions using git-tag and not the source code itself.
Related
We've got an application (Angular/node in GitLab) that has a corresponding freestyle build in Jenkins. In the package.json, we need to reference a separately-built library of our own writing, also in GitLab. Like this:
"dependencies": {
"our-library": "git+ssh://git#ourcompany.com:2222/libraries/our-library.git#master"
}
When we build the application in Jenkins, it pulls the source for our-library, which does not contain the generated lib files. The issue is that ideally we would not like to push the lib files generated by a local our-library build just so that the Jenkins build will be able to find what it needs for the application build. It's almost like we need to be able to reference the /lib folder in the Jenkins our-library workspace instead of referencing the source from GitLab, or something.
The fact that I need to ask this question gives me the feeling that we're going about this all wrong. Any insight on how to build an app in Jenkins while referencing other node projects that we build as well?
Thanks a lot for any feedback!
That looks like a source dependency, which means your Jenkins build needs to also build said dependencies (from its sources)
The other approach is binary dependency, where your package.json references a local dependency that you have copied (from a binary referential like Nexus, or from any other source you want, like a shared folder where you have put the generated libs).
See for instance "Local dependency in package.json".
I have an instance of crafter running with crafter-studio-publishing-receiver-2.5.3-aio.jar, I need to locate the source code for the jar file.
Is this the right repository
What is the significance of the word "legacy" in the name of the project?
You can find the source code here:
https://github.com/craftercms/legacy-deployer
The specific version can be found by checking the manifest of the jar.
- unzip the jar
- open ./META-INF/MANIFEST.MF
- locate the property Implementation-Build: 87c84d58313b2bcbdca306de69758320aee174d0
This value can be placed in github to get the exact code you are looking for.
Example:
https://github.com/craftercms/legacy-deployer/blob/87c84d58313b2bcbdca306de69758320aee174d0/cstudio-publishing-receiver-zip/pom.xml
The reason we renamed the project "legacy-deployer" in github is that with Crafter 3.x we are moving to a new deployment system. Without going too deep on this: The new system is based on Git pulls, as you can imagine, this approach has many benefits. It will support the same concepts (callbacks etc) as the now "legacy" deployer.
Project A contains a few functions and data models I use in diff't repos, all tied to the same product. I'd like to turn them into an npm module, but without extracting the code from project A.
When I see other modules on npm, they generally tie to a github repo that contains all the source code, as well as a full stack to run/modify the module.
Does this mean I have to extract the code from project A into its own repository, build/configure a stack to allow it to run in isolation from project A, and then import it back into project A & other projects?
Or is it possible to just export the functions w/o a full stack, and without moving the code from my main project?
an attempt to pre-empt 'duplicate' comments:
this Q talks about working with an existing module, which doesn't answer my concern, as it has to do w/ worrying about pull requests being merged on time
npm link, discussed here, looks like it'd do the trick if I'd already extracted the code from the project, but I'd like to avoid that.
If you really want to share a snippet through npm but still use the code at the same place in your project, you could extract the code into its own repo, but still use it inside your project as a git sub-module.
Create a submodule repository from a folder and keep its git commit history
Do you know if it's standard for npm modules in their own repos to include the full stack for running them?
Ideally, it's to test them and ease the development, but it's totally optional. You could only put a JavaScript file and the package.json and it would work.
In node js, we import require('library') to use external library. let's say there's a external-file.js inside 'library' that we want to customise for our project. What is the technique that can be use?
In Java, this can be done irreverently through just copying the external file and make sure it adhere to same package path. How can this be done in node.js ?
Ideally if this external library is getting pulled from npm or github, you should create a fork, use that in your project's package.json and modify the file in your own fork. Then when you commit the changes to the file, it'll go into your own version of the third party library. (And if the change is good enough you can even ask the author to incorporate it in their code and get credit for contributing to open source :D)
Additional benefit of doing it like this is that you won't have to commit the dependencies in along with your source code.
I'm using Orchard 1.6 and have a question regarding the build batch file.
When run, the script builds every module within the "Modules" directory, regardless of whether the module project is included in the VS solution.
Is there a setting somewhere so only module projects are built if the corresponding project is loaded in VS? (I'd like to prevent excluded/unloaded projects from being part of the build)
Thank you for any pointers.
Replace the script so that it builds based on the solution instead of the orchard.proj file.