Skip to content

Environment specific deployment of files #126

@daust

Description

@daust

Depending on the environment (e.g. dev, int, prod) we want to install different files.

The naming convention could be:

  • script1.sql (will be installed on all environments)
  • script1-env(dev) (will only be installed on environment dev)
  • script1-env(int,prod) (will only be installed on environments int and prod)

We will achieve this through a naming convention based on the filename or directory name.
When we use it on the directory level, this will be used for all included files and subdirectories.
Local configurations will override this.

E.g. Directory install-env(int,prod) will determine that all files will be installed on the environments int and prod. Yet, the file script1-env(prod).sql will only be installed on prod, not int.

We can specify this in the files SourceFilesCopy.conf and SourceFilesReference.conf using a new directive /env <environment1>,<environment2>
e.g.

# Package Bodies
demo/packages => europipe/100_package_bodies
fu_apex.pkb /env int,prod

# Preinstall => demo/010_preinstall
../sql-manual => demo/010_preinstall

-- all .sql files in the directory analysis (and all subdirectories) 
--   are tagged for the environment int only
analysis/*.sql /env int

-- the subdirectory ddl-int (including all files and subdirectories) 
--   is tagged for the environment int only
ddl-int /env int

-- the subdirectory ddl-prod (including all files and subdirectories) 
--  is tagged for the environment prod only
ddl-prod /env prod

This also works when this naming convention is applied to a directory. When the directory is tagged and the including file is having a different tag, then the more local configuration will override the more generic one, e.g.

-- this file file-env(int).sql will be installed on int and not prod, 
-- even if the directory says so. 
/directory-env(prod)/file-env(int).sql

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions