Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The purpose of this page is to explain the process of adding new secrets and properties to Synapse.

Properties can be used to set flags and values that should change when building on a different machine. This allows local builds to interact with separate databases, worker queues, etc. from production and staging builds. This can also make local builds more lightweight (by setting certain features to only enable in production). Secrets provide similar benefits, but additionally restrict access to critical information such as credentials.

Overriding a property or a secret from the command line

If you want to be able to override a property or secret from the command line, then you have to modify the integration-tests/pom.xml file

Under the org.codehaus.cargo plugin, you must add a tag of the following form (these tags should already exist and you should merely have to add the leaf tag):

integration-tests/pom.xml
<configuration>
   <!-- Container configuration -->
   <container>
   <systemProperties>
     <org.sagebionetworks.my.property.name>${org.sagebionetworks.my.property.name}</org.sagebionetworks.my.property.name>
   </systemProperties>
   </container>
<configuration>

This property can now be set using the -D command line flag, for example:

mvn cargo:run -Dorg.sagebionetworks.my.property.name=myPropertyValue

Note that if your value has spaces, you must wrap the entire -D flag in double quotes:

mvn cargo:run "-Dorg.sagebionetworks.my.property.name=my property value"

Adding a property to automated builds

If you want your property to be set on Jenkins, add a line to docker_build.sh:

docker_build.sh
bash -c "mvn clean ${MVN_GOAL} \
# ... other properties
-Dorg.sagebionetworks.my.property.name=${org_sagebionetworks_my_property_name} \
# ... other properties

And configure the build on Jenkins to export the property value into org_sagebionetworks_my_property_name:

Jenkins Build Execute Shell
export user=pUser
export org_sagebionetworks_stack_iam_id=<id>
export org_sagebionetworks_stack_iam_key=<key>
export org_sagebionetworks_stackEncryptionKey=<key>
export rds_password=<pwd>
export github_token=<token>
export org_sagebionetworks_my_property_name=myValueForAutomatedBuilds


/var/lib/jenkins/workspace/${JOB_NAME}/jenkins_build.sh

Adding a property

In progress

Adding a secret

We use AWS Secrets Manager to store secrets in Synapse.

In progress

Using the stack builder to override properties in prod

In progress


  • No labels