Skip to content
Snippets Groups Projects

create replace_ciserver.txt

Merged Hahn Axel (hahn) requested to merge 7030-ci-projectvars-for-replacement into master
2 files
+ 37
3
Compare changes
  • Side-by-side
  • Inline

Files

+ 17
2
@@ -103,7 +103,9 @@ For hooks you can create files with pre defined names. A hook script must have e
* profiles/myapp/tasks_config.sh - replace config files (see below)
* profiles/myapp/tasks_postinstall.sh - do postinstall actions before finishing
## Create configs for an application: tasks_config.sh
## Create configs for an application
### Run script tasks_config.sh
The script `./bin/create_config.sh` can read config templates and create an output file.
@@ -125,7 +127,9 @@ During execution the working directory is the target directory of your applicati
* "${selfdir}/bin/create_config.sh" is the script that replaces config data in a template.
* In your software repsoitory put a template into ./hooks/templates/. It will be found if the archive was extracted.
* the target file is relative to your application root.
* files with replacement data.
* files with replacement data. You can use file globbing, eg. `${profiledir}/replace*.txt`
### Replacements
A sample replacement file is profiles/example/replace.txt:
@@ -158,6 +162,17 @@ their replacement data:
* developers add api keys and other internal values
* ...
### Ciserver project values
After extracting the software there is an atomatic step that generates a replacement from [PROJECTID].json in the install directory.
It generates a replacement file named `replace_ciserver`.txt in the profile directory and contains the branch name and the revision id of the last commit:
```shell
ci-branch=origin/master
ci-revision=9f041d5f3fe9faa43769da97f3eb46d5c553e3fe
```
## Pre and post install actions
Example: A simple tasks_postinstall.sh can contain the start of a script that is delivered in the tgz archive.
Loading