Question

New code group for ‘Execute source code’ but not in a deployment package


Userlevel 3
Badge +9

I’ve created a new code group called ‘BACKUP’. This code group is placed just before the ‘UPGRADE’ code group to create a back-up of the chosen database (runtime configuration).

The new code group should be automatically ON in the ‘Execute source code’ screen, but must be excluded from a deployment package.

 

I expected that the checkbox ‘Show at deployment’ may solve this problem but unchecking it will also remove the code file from the ‘Execute source code’ screen.

What does this checkbox do? And what does ‘Fixed file’ do?


3 replies

Userlevel 7
Badge +5

Show at deployment affects both the execution screen as well as the manifest generated when a deployment package is created. There is no setting to exclude a code file from a deployment package but include the code file in the Execute source code screen.

‘Fixed file’ affects the Functionality screen and the Code overview screen. It basically indicates that a code file must always be executed as a whole. All program objects will be generated and executed as one package; individual program objects cannot be executed separately. This is used in applications using the Oracle RDBMS.

 

Userlevel 3
Badge +4

You could try to include a check in your backup script so it only executes when run from the Software Factory. You could for instance check the branch_id or model version. That way you may be able to exclude running a backup when using the deployer on a version from prod or on your prod branch.

Alternatively if you have your software factory database on the same server as your software factory projects but have your production project on a different server, you could check for the existence of the software factory database: (replace “software_factory” with the name of your Software Factory database)

if db_id('Software_factory') is not null
begin
print 'run your backup here'
end

 

Badge +2

Thank you for your comments, due to Kevin’s vacation i will respond to the reply’s.

In our CiCd pipeline and our layered branch set-up, Kevin's question about making a backup is an example. There are more situations in which the execution of certain code parts, that have been merged upto main, may only take place on the internal development system, but where this code parts may never be deployed.

 

We are going to convert the question into an idea.  Specifying in the model that certain parts of code may not be included in a deploy package is preferable to including protections in the code.

Reply