Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Hotfix/2259-correctPIDUpdate
  • Issue/2259-updatePids
  • Issue/2312-oldPIDScript
  • Issue/2518-docs
  • Product/505-pidPage
  • Sprint/2020-19
  • Sprint/2022-01
  • Topic/1063-changeUrl
  • dev
  • gitkeep
  • master
  • v1.1.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
15 results

Target

Select target project
  • coscine/backend/scripts/pid-migrator
1 result
Select Git revision
  • Hotfix/2259-correctPIDUpdate
  • Issue/2259-updatePids
  • Issue/2312-oldPIDScript
  • Issue/2518-docs
  • Product/505-pidPage
  • Sprint/2020-19
  • Sprint/2022-01
  • Topic/1063-changeUrl
  • dev
  • gitkeep
  • master
  • v1.1.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
15 results
Show changes
Commits on Source (2)
## Integrator
# PID Migrator
The integrator can deploy projects specified in a json file by downloading the artifacts of the specified job (default is `release`).
### Config
The config (json) file can look like the following:
```json
{
"apis":[
{
"name":"Coscine.Api.Project",
"version":"v1.3.0",
"url":"coscine/api/project"
},
{
"name":"Coscine.Api.User",
"version":"v1.1.0",
"url":"coscine/api/user"
},
{
"name":"Coscine.STS",
"version":"v1.2.1",
"url":"coscine/api/sts"
}
],
"apps":[
{
"name":"usersview",
"version":"v1.0.2",
"url":"coscine/app/usersview"
},
{
"name":"resourceview",
"version":"v1.0.1",
"url":"coscine/app/resourceview"
},
{
"name":"projectview",
"version":"v1.2.1",
"url":"coscine/app/projectview"
},
{
"name":"project2",
"version":"v1.3.1",
"url":"coscine/app/project"
},
{
"name":"login",
"version":"v1.1.0",
"url":"coscine/app/login"
}
]
}
```
Make sure to have the names prefix free (hence project2 and projectview).
The name must be the executable name for apis.
The above example would deploy all specified versions and remove any integrations wich is currently deployed, but not specified.
The version describes the tag or branch for the job artifacts.
When using a branch, also specifiy the job name.
Example for prerelease:
```json
{
"name":"login",
"version":"Topic-123/BranchNameTest",
"url":"coscine/app/login",
"job":"pre_release"
}
```
```
The artifacts of the job `pre_release` will be downloaded and used instead of the default job `release`. The job needs to be added to the pipeline definition of each project and run manually(see this [.gitlab-ci.yml](.gitlab-ci.yml) under `pre_release`).
Example for migrator:
```json
{
"scripts":[
{
"name":"Migrations",
"version":"v1.3.0",
"url":"coscine/cs/migrations",
"job":"cake:Release",
"scriptType":"Powershell.exe",
"command":"DEST_PATH\\Migrator.exe --migrate_up"
}
]
}
"DEST_PATH" will be replaced by the path of the downloaded and extracted folder.
scriptType defines the core command. Here we will use powershell to run the following command.
command takes in the arguments for script type. Here starting an executable with powershell.
Example for cron:
{
"cron":[
{
"name":"CronTest",
"version":"v1.17.1",
"url":"coscine/api/project",
"job":"cake:Release",
"cron":"*/5 * * * * *"
}
]
}
Runs a nomad job as a cron job.
The cron parameter defines the repetition cycle.
[Cron definitions](https://github.com/gorhill/cronexpr#implementation)
### Running
Start the integrator by running integrator.exe and specify the json file with `--s` or `--source` and the destination of the integrations with `--d`" or `--destination`.
Use `-h` or `--help` for help.
Use `--purge` to force a redeploy of all integrations.
The parameter `--source` and `--destination` are mandatory, `--purge` is optional.
To start a integration run:
```powershell
.\integrator.exe --source "integrator.json" --destination "C:\Integrations"
```
For a redeploy run:
```powershell
.\integrator.exe --source "integrator.json" --destination "C:\Integrations" --purge
```
## Building
Build this project by running either the build.ps1 or the build<span></span>.sh script.
The project will be build and tested.
## Necessary Keys
The key "coscine/local/app/additional/url" is necessary for specifying the host url of the apps.
\ No newline at end of file
This repository migrates all existing PIDs to the current URL, METAURL and DATAURL definition for them.
......@@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.0.0</Version></PropertyGroup>
<Version>2.0.1</Version></PropertyGroup>
<ItemGroup>
<PackageReference Include="Coscine.Action" Version="3.*-*" />
......