Runtime configuration for create-react-app - configuration

Currently create-react-app supports the .env file for injecting config into the build.
This process is static as everytime the .env variables change, the project has to be built again.
Is there a way to inject configuration at runtime without rebuilding the project?

Related

Passing the ArchiveName to UploadArchives in gradle

Having migrated from Spring Boot 1.5.19 to Spring Boot 2.0.4, we are encountering problems with the build on jenkins. Using gradle 4.2.1. We think the behavioural changes in the spring boot gradle plugin between the versions is causing our issue.
The spring Boot gradle plugin has also been updated from 1.5.19 to 2.0.4
Our target artefact naming convention is :
project-name-<version>-<branch>-RELEASE.jar
The jar file gets generated correctly, having specified the following in the build.gradle file.
bootJar {
baseName = 'project_name'
}
The problem occurs when the uploadArchives task is executed. This task looks for an artefact with the following naming convention.
<path-folder-name>-<version>-<branch>-RELEASE.jar
where is the name of the folder path on the jenkins.
It doesn’t seem to be picking up the baseName config.
The build pipeline runs successfully when we don’t perform the uploadArchives task. Also, prior to the Spring Boot upgrade, this was not an issue.
Is there a way to get uploadArchives task to look for the generated jar file name?
I resolved this eventually by adding a settings.gradle file and defining a a root project name in that
rootProject.name = "project_name"
I think the upgrading of the spring Boot gradle plugin must have changed the way the project was being defined.
The 1.5.* version seemed to be taking the project name from the baseName in the Jar task, but the newer version was using the folder name where the app sits.
That was fun

How to separate development and production environments in shadow-cljs?

I want to separate development and production environment variables for my shadow-cljs which is running in conjunction with a lein app through the Luminus template. My production environment is a docker container running on heroku.
It should work in a way that I can import a map, say config, and so that I can access the keys using (:some-key config), or something similar to this.
There is built-in support for separating release and dev configuration.
https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration
The "import a map and access by key" you are asking for is not supported by shadow-cljs and would be something a library would provide instead.
I also do not recommend using environment variables to configure a build.
Also note that shadow-cljs configuration is about build time. If you want to access the "environment" at runtime you do not make it part of the build at all. Say you create a :node-script build running in node. You can just access js/process.env.SOME_ENV at runtime via normal code.

ServiceStack as Windows Service with Razor - Setup Project

I have a servicestack project using razor exposed through a windows service, and need to create a setup project to install it (as opposed to the batch files in the demo's I've seen).
Any suggestions on how to accomplish this with a packaged setup project? Looking at the folder where the windows service files were installed, it only has the dll's, not the razor views... so I coped those over, and now I see this:
Not sure why you're getting that error, can you double-check that you're deploying the orignal Razor source files and not some interim build.
Otherwise some other options for hosting Razor is to change them to Embedded Resources, that way the original Source files get compiled into your .dll so you don't need to deploy them to your project.
Or you can pre-compile Razor Views that way the implementation is compiled into the .dll.

How to install Yii2 framework - advanced template on shared hosting?

I've tried to download and install the framework but it doesn't have a index file in frontend\web directory.
What i have to do to start using the app?
You can install it locally and run init to generate the missing files, like described here. After that just upload the application to the shared host through FTP.
Also, Yii2 Practical-A App might be useful to you.

How can I add websphere admin jars to Hudson's class path?

I try to use Hudson's Deploy Websphere plug-in to deploy my artifacts to remote websphere.
From the plug-in documentation, I need to do this:
The following WAS JAR files need to be placed into the Hudson class path or dropped into the %project.basedir%/WEB-INF/lib/ directory. These JAR files can be copied from the %WAS_HOME%/runtimes/ directory of your WAS server installation.
com.ibm.ws.admin.client_6.1.0
com.ibm.ws.webservices.thinclient_6.1.0
I have installed hudson as a windows service, how can I add these jars to hudson's class path?
According to Hudson's documentation:
Changing the configuration of services
The JVM launch parameters of these
Windows services are controlled by an
XML file hudson.xml and
hudson-slave.xml respectively. These
files can be found in $HUDSON_HOME and
in the slave root directory
respectively, after you've install
them as Windows services.
The file format should be
self-explanatory. Tweak the arguments
for example to give JVM a bigger
memory.
Stdout and stderr from the service
processes go to log files in the same
directory.
So, it appears you can manipulate the service's JVM classpath using the hudson.xml file.
HTH