How can I get application.yml information from jenkins? - jenkins

Build by integrating Jenkins with GitHub's public repository.
However, the application.yml file with important information does not exist in the repository because it is included in the gitignore file
How can I get application.yml information from jenkins?

Related

Using environment variables in Github, NOT in actions

I am working on setting up CI/CD for my organization. I am trying to build an automated system that will deploy our changes to our Shopify theme when we push to a branch.
I have a config.yml file that contains information like password, themeID and so on. I am trying to find a way to hide these variables in our repo. Github secrets have not seemed to work, as I can't figure out how to pass those secrets from my workflow yaml file to my root level config.yml file. Any help would be greatly appreciated!

Deploying a app to kubernetes through jenkins

I'm trying to deploy a app to kubernetes cluster through jenkins using Kubernetes Continuous Deploy plugin. I copied the config .yml file into jenkins machine and gave the path in the build step and I'm getting a error:
"No matching configuration files found"
screenshots of the plugin and console out are in links.
I saw same error on my jenkins server then i fixed it by correcting the path.
Can you put your .yml files to your source control. Because Kubernetes Continuous Deploy plugin will check your workspace.
And plugin will check your path and it will not find it. I attached images and you can see my working configurations.
config path
project structure
Add the .yml file to the github repository
Put the following as the path for the file
$workspace/deployment.yml
Checkout the repository from the git url to the job's workspace.

Is there a way to store the whole build.xml file within Jenkins?

Current Setup: Ant deployments to salesforce using Jenkins for CI. Pulls from BitBucket repository with paramaterized build.xml stored in the repo. The build properties are set individually for each job in Jenkins.
The Problem: Build properties could be modified if someone changes the build.xml to not reference the variables set in Jenkins. Developers have the ability to change the testlevel, which we would like to prevent. Also, if we ever need to modify the build.xml, we don't want to have to cascade the changes across all of our branches.
Is there a way to remove the build.xml file entirely from the repo and store everything in Jenkins?
I think you are looking for the Config File Provider plugin:
https://wiki.jenkins.io/display/JENKINS/Config+File+Provider+Plugin
I have only played with it a little, but I think it will do exactly what you want. You will just have to copy the file in to the workspace before you run your build.

Jenkins ArtifactDeployer simple creates a new dir in base dir?

I am in Jenkins and using ArtifactDeployer. The console output tells me that the remote repo is http:// myrepo but all it does is create a new folder in my base directory which I also specify in this plugin. It correctly finds only one file to copy but strangely just creates a new directory and copies it in there. I thought this would enable me to deploy artifacts to another server... Can I do that?
No you can not do that with artifacts deployer but there are other ones you can use - read below:
Jenkins provides by default a feature for archiving artifacts generated by the build of a Jenkins Job. These artifacts are archived in the JENKINS_HOME directory. However, this directory contains also tool configurations (global and job configurations). Therefore, there is no separation between infrastructure data, jobs data and generated elements. It is often considered to be a bad practice and it doesn't help to manage it from an administrator point of view.
Unfortunately, it's not possible to extend the 'archived artifacts' feature to archive artifacts in a location other than JENKINS_HOME.
The main goal of the ArtifactDeployer plugin is to archive artifacts in your desired locations (other than JENKINS_HOME directory).
There are many Jenkins plugins close to ArtifactDeployer such as CopyArtifact plugin or CopyArchiver plugin for publishing artifacts from Jenkins resources (from the current workspace, from the old builds of the same job or other jobs, ...) to remote locations with the protocol file://
There are also others plugins for managing other protocols such as ftp://, ssh:///.

Jenkins userContent files

We have a Jenkins master-slave model. Each job that is being run on slaves require a certain amount of configuration files. These files must be copied from master to each slave before the build step. So far I have been able to accomplish this with the Config File Provider Plugin. The drawback of this plugin is that it doesn't support folders, I would like to be able to put the configuration files for slave1 in the folder slave1 and so on. Now I have a huge list of files in the dropdown menu when creating a job and asked to provide configuration files.
This plugin comes with something handy: the configuration files can be edited via the web interface.
On the other hand Jenkins provides a userContent folder on the master accessible via http://[jenkins-server]/userContent that resolves my need for folders, but I haven't found a way to edit these files from the provided web interface.
I must mention that the master is a remote machine and I don't want to connect to it everytime I need to modify a file there. Is there any way to edit the files in the userContent folder, or to organize the files uploaded to the Config File Plugin into folders?
Thanks!
If possible put all the configuration into your SCM system and allow Jenkins to fetch them when needed/as they change.
Then your configuration files are managed just like your source code. As a bonus you can add a new node easily and developers can access and use they configuration files to test their build.
Supporting evidence:
Martin Fowler
Andrew Binstock
Darryl Bowler
If you have environment specific config files you can either load all of the individual config files into into your SCM system (this becomes unmanageable if you have a lot). Alternatively you can still store them in your SCM system and then do some combination of scripting with Jenkins parameters to update them on the fly.

Resources