Developing OpenWhisk applications, I'm often switching between a local instance of the platform for development & testing and IBM Cloud Functions for production.
The OpenWhisk CLI uses a configuration file (~/.wskprops) to store authorisation parameters for the current platform endpoint.
How can I use the CLI tool with different environments without having to manually update the configuration properties each time?
The OpenWhisk CLI supports overriding the configuration file location using an environment variable (WSK_CONFIG_FILE).
Store platform credentials in separate configuration files and use this environment parameter to choose the platform instance to target.
$ WSK_CONFIG_FILE=~/.wskprops-dev wsk action invoke ...
Related
I want to read my Msbuild path from my self hosted build agent as system defined capabilities, is there any way out to do so ?
You can get that information by leveraging the Agents - Get API call and specifying includeCapabilities=true on the parameter list.
Worth noting that if you add new capabilities (like installing nodejs for example), you will have to restart the agent for the capabilities to show available.
We build a SCP native java application based on SAP cloud SDK. if we later on migrate to SCP kubernete env., would the app runs without migration? if changes needed, how much effort would it be? thanks.
Applications using the Java libraries of the SAP Cloud SDK can also run on a local machine and, as a consequence, as part of an application running in a container in Kubernetes. Additionally, the SDK already today provides abstractions that allow to run the same code on Cloud Foundry and Neo when accessing services of SAP Cloud Platform.
I cannot yet say how the access to specific functionality of SAP Cloud Platform works in Cloud Foundry versus a future Kubernetes environment, but this should be the blueprint.
We have now come to the point in our Service Fabric application development where we need to add a custom parameter that can be overridden at run time (as described in https://azure.microsoft.com/en-us/documentation/articles/service-fabric-manage-multiple-environment-app-configuration/). We're still in the development stage...no azure production environment, yet, so this question mainly concerns running the service fabric cluster from visual studio or thru a powershell script in a VM. I know that Deploy-FabricApplication.ps1 is ran during debug and per its usage instructions in that file I can override custom parameters. However, I can't seem to figure out where I do that in Visual Studio so that when different developers start a debug session they can set the custom parameter value to whatever makes sense in their dev environment. Any ideas? We have a task to research how to better handle secrets storage but we're not quite there, yet.
You can add multiple publish profiles (optionally without checking them in). One for every developer if needed.
For secrets: you can encrypt settings and/or use Azure Key Vault combined with a Service Principal, similar to what is shown here.
I am currently tinkering with Cloud Foundry. I understand the basic principles of the tool but can't find what cf push actually does to a manifest file.
Does it read the file just once or is it stored as a static file with the application?
Also, is it possible to retrieve a manifest from a deployed app?
The cf push command reads the manifest file and uses the attribute values (instances, memory, disk etc) for the current deployment. The manifest helps to automate the app deployment. It can also be used for deploying multiple applications at once. As stated here: https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html, when you deploy an application for the first time, Cloud Foundry reads the variables described in the environment block of the manifest, and adds them to the environment of the container where the application is deployed. When your app is running, your environment variables can change depending on your setting. For example, if you have an auto-scaler, it could have increased/decreased your no. of instances/memory/disk (environment variables). If that is the case, when you stop and then restart an application, its environment variables persist.
The manifest file is read only when the "cf push" command is executed. As stated in the Cloud Foundry Documentation (https://docs.cloudfoundry.org/devguide/deploy-apps/prepare-to-deploy.html#exclude), the manifest file is just read and not actually stored as a file, hence it could not be accessed for a deployed app. However, if the purpose for accessing your manifest is to read your current environment setting, it can be accessed through the Cloud Foundry API's Get App Summary (or) Get detailed stats for a STARTED App: https://apidocs.cloudfoundry.org/234/
I've got a Liberty Profile app that I am building/deploying with the devops pipeline, and I don't see any mechanism for determining the current build that is running. I've dumped all the environment vars, and nothing appears to indicate the build number.
Is the value someplace I am just not finding or is it really just not available?
Build and Deploy Jobs in Bluemix DevOps Services offer and environment variable called: BUILD_NUMBER. This variable is not propagated automatically to Bluemix runtimes.
Perhaps in the deploy script, you can add a Cloud Foundry environment variable associated to your app. Something like:
cf set-env "${CF_APP}" BUILD_NUMBER "${BUILD_NUMBER}"
so you will have such info accessible from the running code.
Hope it helps!