In Visual Studio SSDT, I have set up multiple Project Configurations, DEV, QA, PROD. Also, I have parameters set up for each configuration, so I can easily deploy to each environment with different parameters. However, when i edit a parameter's value and save, the new value is saved to the parameter for each configuration.
Here are the steps I followed:
First I edit the value in aNewTestParameter
Then, I save the Project.params file and switch to the QA Configuration. Notice it also has the DEV Value.
How do I prevent this save from overwriting the values in my other configurations?
You will need to add the parameter to configurations (third button above the Name field in the screen-shots). Next, set these values accordingly in the "Manage Parameter Values" window that will follow. Upon doing this, the parameter values will correspond to whichever configuration is chosen in the configuration drop-down.
Related
I have two custom build configs development and release with some values defined. Here is what my Development.xcconfig looks like:
//
// Development .xcconfig
//
// Include Pods config.
#include "Pods/Target Support Files/Pods-MyApp/Pods-MyApp.debug.xcconfig"
// Server URL
HOST_NAME = 127.0.0.1:6060
// Use TLS (https, wss)
USE_TLS = NO
// App Settings
APP_NAME = MyApp (test)
APP_BUNDLE_ID = co.my-domain.myapp-test
I reference these values in Info.plist as $(HOST_NAME) and it works fine. But I also want to expose these custom parameters in application preferences as DefaultValue. I.e. I want the app to use localhost:6060 as default host name preference when the target is development and the address of production host when the target is release.
The preferences are defined in Settings.bundle/Root.plist. Unfortunately xcode does not expand references like $(HOST_NAME) in Settings.bundle/Root.plist. I suppose I have to write a build script to update the values. I know how to use PlistBuddy to update entries in Root.plist. What I can't figure out is how to read values from Info.plist and at what point in the build process I should update Root.plist.
I can't read Info.plist early in the build because the values are not yet expanded. The host name still reads as literal string "$(HOST_NAME)".
I suppose I can read the Info.plist as the last step in the build process and then update "$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/Settings.bundle/Root.plist", but which Info.plist to read, the one at
"$TARGET_BUILD_DIR/$INFOPLIST_PATH" or the one at
"$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist"??? Does it matter? Are they always the same? Are they both always present?
Thanks!
Is there any way to set different values for sentry attributes based on the current Spring profile?
The current attributes are located in the sentry.properties file...
Unfortunately naming it like the application.properties method (application-profilename.properties) does not work. Because the changes in a sentry-profilename.properties file aren't recognised.
So ideal would be:
sentry.properties (base information)
sentry-dev.properties (environment attribute = dev)
sentry-prod.properties (environment attribute = prod)
Ok, we defined the systems variable SENTRY_ENVIRONMENT to dev or prod (based on the current deployment pipeline).
So this solved our issue and we got the wanted result in the sentry.io overview!
"You can override the location of the properties file by using either the sentry.properties.file Java System Property or the SENTRY_PROPERTIES_FILE System Environment Variable." this is from "https://docs.sentry.io/clients/java/config/#configuration"
I have a lot of deployment configurations that are adopting root template.
And now I want to change one Parameter (environment variable) in the root template, but to pin the old value in all children deployment configuration.
The goal is to force all new deployment configuration that would be created to have a new value inside their deployment. And then step-by-step move with old deployment configuration and change this value only where it is required.
Option 1:
Create a new template with new value and use it for all new configuration. Let old configuration continues with old root template. Then incrementally you can migrate your old configuration to new template.
Option 2:
If you don't have more configuration from root template, You can change the value in the root template. The movement you change the new value That will be reflected in all children configuration. Then go to each children configuration and manually change the value(old value). I know it is a very tedious job if you have more configuration.
Instead of copying the template, you can change the parameter of your template, to set a variable value.
Your parameter will have inside the template the value of %EnvVarSomething%
Define the value at <Root> level with you old value for the parameter EnvVarSomething.
Then, you can easily migrate your configuration by overriding the parameter EnvVarSomething in each Build Configuration or Project.
Go into the root edit project settings and find the configuration template in question. at the very right of the row containing your template there should be a drop down. Inside the dropdown should be an option called copy template. Make a copy of the template with a different name and make changes to that instead. Then you will have a new template to use that doesn't have children to worry about.
I have one TeamCity project Dac.Test that contains 3 configurations: DEV, QA, PROD.
Also I have some users associated with their Roles. Is this possible to hide / show certains configurations for selected users or groups?
For example: Users associated with group: Testers can see QA configuration, but not PROD and DEV.
There is no way of managing user permissions per-build, this is available on a project level only. You could create a sub-project in the Dac.Test project to cater for this
If you're looking for a way of stopping people from mistakenly running this build, the following approach will work.
This method uses a prompt box that will pop up after you click the run button, it also needs input from the user confirming that they mean to run the build.
No one can run this build by accident
Go to your build configuration in the TeamCity UI
From here, go to Edit Configuration Settings --> Parameters --> Add new parameter
Enter something like 'Confirmation' as the parameter name
Then beside 'Spec:', click the 'Edit...' button
Set up the parameter as shown in the following screenshot:
You will now be prompted and asked for confirmation when you click the run button. The user will have to enter 'YES' in the prompt box that appears, any other value will stop the user from building:
This is best accomplished by using TeamCity's built-in role management. Roles allow you to set fine-grained permissions for users and groups. One potential issue, however, is that roles are scoped to projects (not build configurations). You'll need to create a separate Dac.Test QA project+configuration and provide your Testers the necessary privileges there. You'll also need to make sure that they are stripped of all privileges for the Dac.Test project.
I would like to define a variable on a TC configuration and would like to get its value on a different TC configuration that has a trigger dependency on the first one.
Is it possible to do this?
If both configurations are in the same project, you can define a build configuration template that contains the shared parameter (i.e. variable). Both active configurations must then reference that template -- use the 'Associate with Template' action to accomplish this. The value of the shared parameter must be set in the template in order for the same value to be known to both configurations.
If you're trying to share build numbers (or other system-level parameters) between the configurations, there is a special method for that.
I have to use something like this to actually dynamically change the configuration parameters.
Invoke-WebRequest -Uri "http://build/guestAuth/action.html?add2Queue=bt876&name=env&value=test&name=env.number&value=%target.env.number%" -Method "Get" -Verbose