How do I change a promotion strategy in one of my Jenkins X environments? - jenkins-x

I've used the "jx create spring -d web -d actuator" command to create a simple Spring java application but I can't figure out how I'd change the promotion strategy from Auto to Manual. Can't see how it's being set in the environment configuration.
https://jenkins-x.io/about/features/#promotion

you can use jx edit env to edit your Environment configurations. Or you can use kubectl edit env staging if you want and edit the custom resource directly.
See: https://jenkins-x.io/commands/jx_edit_environment/

Related

How to use environment variables in prisma

From this document, Prisma cli try to download binaries from prisma s3. But as my corporate firewall rules this download was blocked, Following this document,I must change source binary file location by using PRISMA_ENGINES_MIRROR variable.
to utilize this variable,I must set environment variables. my build environment is like ElasticBeanstalk,after git push, build will start. from now on,I couldn't configure env variables in build environment. so that I consider to configure and write PRISMA_ENGINES_MIRROR variable to .env files and push them.
Is it possible? and how can I utilize these variable by .env ?
If someone has opinion,please let me know.
Thanks
You can configure environment variables in Elastic BeanStalk by going to
Configuration > Software Configuration > Environment Properties
You can add PRISMA_ENGINES_MIRROR in Environment Properties and it will be picked up by .env

How can I override quarkus.security.users.embedded.users on docker run command line?

I have a quarkus based webapp that uses Basic Authentication with Embedded Realm Configuration. The webapp runs in a docker container. The authentication properties are specified in application.properties like this:
quarkus.http.auth.basic=true
quarkus.security.users.embedded.enabled=true
quarkus.security.users.embedded.plain-text=true
quarkus.security.users.embedded.users.test=mypass
quarkus.security.users.embedded.roles.test=admin
I would like to override quarkus.security.users.embedded.users.test to specify a password at docker runtime.
I tried to do this by overriding the quarkus property using an environment variable at docker runtime.
docker run -p 9999:9999 -e QUARKUS_SECURITY_USERS_EMBEDDED_USERS_TEST=newpasswd mywebapp
This does not work. When I access mywebapp using http://locahost:9999 I must login using test/mypass. I expected to login using test/newpasswd.
Any help greatly appreciated.
I suggest you report an issue for this problem. While Quarkus won't be able to "enumerate" any new users from environment variables (the correct property names cannot be deduced), I think it should still be possible to override the password of a user that has already been specified in application.properties using an environment variable like you try to do.

Can Cloud Foundry user-defined env variables set from buildpack?

In Cloud Foundry, user-defined env variables can be set using "cf set-env" command.
Can the same be set from buildpack programmatically?
Are you asking about creating a custom buildpack, or using one of the available CF buildpacks?
A buildpack sets the command that is used to launch an application, so if you are creating your own buildpack or customizing an existing one you can set env vars as part of that startup command. For example a startup command could like like this:
VAR1=VALUE1 VAR2=VALUE2 some-command

multiple parameters not getting passed when I start my spring boot application in command line

I want to override certain properties during deployment of my spring boot application.
when I try the following it works
sudo /etc/init.d/myapp start --app.env=prod
I see the app.env is correctly set to prod (my /health just echoes this values)
however when I set more than one property it did not work,
sudo /etc/init.d/myapp start --app.env=prod --version=2.3.4
I see only app.env is correctly set. the version value is not overridden.
why is it so? what is the right way to pass multiple parameters.
NOTE: I want to pass username and password for datasources. but for testing purposes, I kept it simple to override these properties.
You would want to read the section around Customizing the startup script. Specifically that you can include a myapp.conf file beside the jar file. In that .conf file is a JAVA_OPTS variable. You would then use -Dapp.env=prod -Dversion=2.3.4

Accessing Meteor Settings in a Self-Owned Production Environment

According to Meteor's documentation, we can include a settings file through the command line to provide deployment-specific settings.
However, the --settings option seems to only be available through the run and deploy commands. If I am running my Meteor application on my own infrastructure - as outlined in the Running on Your Own Infrastructure section of the documentation - there doesn't seem to be a way to specify a deployment-specific settings file anywhere in the process.
Is there a way to access Meteor settings in a production environment, running on my own infrastructure?
Yes, include the settings contents in an environmental variable METEOR_SETTINGS. For example,
export METEOR_SETTINGS='{"privateKey":"MY_KEY", "public":{"publicKey":"MY_PUBLIC_KEY", "anotherPublicKey":"MORE_KEY"}}'
And then run the meteor app as normal.
This will populate the Meteor.settings object has normal. For the settings above,
Meteor.settings.privateKey == "MY_KEY" #Only on server
Meteor.settings.public.publicKey == "MY_PUBLIC_KEY" #Server and client
Meteor.settings.public.anotherPublicKey == "MORE_KEY" #Server and client
For our project, we use an upstart script and include it there (although upstart has a slightly different syntax). However, if you are starting it with a normal shell script, you just need to include that export statement before your node command. You could, for example, have a script like:
export METEOR_SETTINGS='{"stuff":"real"}'
node /path/to/bundle/main.js
or
METEOR_SETTINGS='{"stuff":"real"}' node /path/to/bundle/main.js
You can find more information about bash variables here.

Resources