Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SQL2Linked
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
backend
scripts
SQL2Linked
Commits
8bc01ae7
Commit
8bc01ae7
authored
3 years ago
by
Petar Hristov
Browse files
Options
Downloads
Patches
Plain Diff
Added Pipeline definition (coscine/issues#1781)
parent
307772a8
No related branches found
No related tags found
1 merge request
!1
New: SQL2Linked Application for migrating the structural to linked data
Pipeline
#714455
skipped
Stage: commands
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+34
-0
34 additions, 0 deletions
.gitlab-ci.yml
src/SQL2Linked/Program.cs
+12
-5
12 additions, 5 deletions
src/SQL2Linked/Program.cs
src/SQL2Linked/StructuralData.cs
+6
-3
6 additions, 3 deletions
src/SQL2Linked/StructuralData.cs
with
52 additions
and
8 deletions
.gitlab-ci.yml
0 → 100644
+
34
−
0
View file @
8bc01ae7
include
:
-
project
:
coscine/tools/gitlab-ci-templates
file
:
-
/dotnet.yml
stages
:
-
build
-
publish
-
commands
variables
:
DOTNET_MAIN_PROJECT_FOLDER
:
"
SQL2Linked"
build-branch
:
extends
:
.build-branch
build-nuget-release
:
extends
:
.build-nuget-release
publish-gitlab-release
:
extends
:
.publish-gitlab-release
publish
:
extends
:
.publish-artifact-release
migration
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE != "schedule"
when
:
manual
stage
:
commands
script
:
-
dotnet run --project .\src\$DOTNET_MAIN_PROJECT_FOLDER -- --noDryRun
when
:
manual
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/SQL2Linked/Program.cs
+
12
−
5
View file @
8bc01ae7
using
SQL2Linked.Implementations
;
using
SQL2Linked.Implementations
;
Console
.
WriteLine
(
"Begin SQL 2 Linked Data migration"
);
var
dummyMode
=
!(
args
.
Length
>
0
&&
args
[
0
]
==
"--noDryRun"
);
if
(
dummyMode
)
{
Console
.
WriteLine
(
"\n DUMMY MODE \n"
);
Console
.
WriteLine
(
" To exit dummy mode, execute with the \"--noDryRun\" argument"
);
}
Console
.
WriteLine
(
"\nBegin SQL 2 Linked Data migration"
);
var
roleStructuralData
=
new
RoleStructuralData
();
var
roleStructuralData
=
new
RoleStructuralData
();
roleStructuralData
.
Migrate
();
roleStructuralData
.
Migrate
(
dummyMode
);
var
userStructuralData
=
new
UserStructuralData
();
var
userStructuralData
=
new
UserStructuralData
();
userStructuralData
.
Migrate
();
userStructuralData
.
Migrate
(
dummyMode
);
var
projectStructuralData
=
new
ProjectStructuralData
();
var
projectStructuralData
=
new
ProjectStructuralData
();
projectStructuralData
.
Migrate
();
projectStructuralData
.
Migrate
(
dummyMode
);
var
resourceStructuralData
=
new
ResourceStructuralData
();
var
resourceStructuralData
=
new
ResourceStructuralData
();
resourceStructuralData
.
Migrate
();
resourceStructuralData
.
Migrate
(
dummyMode
);
Console
.
WriteLine
(
"\n Finished."
);
Console
.
WriteLine
(
"\n Finished."
);
This diff is collapsed.
Click to expand it.
src/SQL2Linked/StructuralData.cs
+
6
−
3
View file @
8bc01ae7
...
@@ -20,13 +20,16 @@ namespace SQL2Linked
...
@@ -20,13 +20,16 @@ namespace SQL2Linked
public
abstract
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
S
>
entries
);
public
abstract
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
S
>
entries
);
public
void
Migrate
()
public
void
Migrate
(
bool
dummyMode
)
{
{
var
spacer
=
new
string
(
'-'
,
35
);
var
spacer
=
new
string
(
'-'
,
35
);
Console
.
WriteLine
(
$"\n
{
spacer
}
\n
{
typeof
(
T
).
Name
}
\n
{
spacer
}
"
);
Console
.
WriteLine
(
$"\n
{
spacer
}
\n
{
typeof
(
T
).
Name
}
\n
{
spacer
}
"
);
var
graphs
=
ConvertToLinkedData
(
Model
.
GetAll
());
var
graphs
=
ConvertToLinkedData
(
Model
.
GetAll
());
if
(!
dummyMode
)
{
StoreGraphs
(
graphs
);
StoreGraphs
(
graphs
);
}
}
}
private
void
StoreGraphs
(
IEnumerable
<
IGraph
>
graphs
)
private
void
StoreGraphs
(
IEnumerable
<
IGraph
>
graphs
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment