Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Entwicklungsportal - ARCHIVED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
FIT-Connect
Entwicklungsportal - ARCHIVED
Commits
fc54a078
Commit
fc54a078
authored
1 year ago
by
Jürgen Voskuhl
Browse files
Options
Downloads
Patches
Plain Diff
Provide unzip/import PS script
parent
79f2b5f8
No related branches found
Branches containing commit
No related tags found
1 merge request
!86
planning#1203: Standards
Pipeline
#58040
failed
1 year ago
Stage: lint
Stage: cve-scan
Stage: build
Stage: deploy
Stage: .post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
update-md.ps1
+77
-0
77 additions, 0 deletions
update-md.ps1
with
77 additions
and
0 deletions
update-md.ps1
0 → 100644
+
77
−
0
View file @
fc54a078
# Import Markdown files from fit-standards folder
#
# Work flow:
# ===========
# Aftermanually downloading the file standards-markdown-files.zip from
# https://git.fitko.de/foederale-it/standardisierungsagenda/standards/-/tree/markdown-files,
# the invocation of this script will perform the following actions:
# - Expand the zip archive
# - Copy md files from /standards-markdown-files/fit-standards/**/**
# into the corresponding folder in your local dev environment
# - Copy an available image file into /public/img/fit-standards/icons in your dev environment
# - Delete all arbitrary files (inluding the zip file itself)
#
# Author/last update: J. Voskuhl, 2023-10-16
#
# The folder containing the zip archive after downloading it
$downloadFolder
=
'C:\Users\Jürgen\Downloads\'
# File name of the archive, without extension
$zipFilename
=
'standards-markdown-files'
# The root folder of our local information plattform (used to calculate destination folders)
$infoPlatformRoot
=
'D:\MyProjects\FITKO\Informationsplattform\Entwicklungsportal\'
# ======================= NO ADJUSTABLE PARTS BELOW THIS LINE! =============================
$sourceFolder
=
$downloadFolder
+
'fit-standards\'
# ***** Process the zip archive *****
$archive
=
$downloadFolder
+
$zipFilename
+
'.zip'
Write-host
$archive
$warn
=
$null
Expand-Archive
-Path
$archive
-Destination
$downloadFolder
-Force
-WarningVariable
warn
if
(
$warn
.
Count
-gt
0
)
{
throw
'The zip file does not exist ($warn)!'
}
remove-item
-Path
$
(
$sourceFolder
)
-Recurse
-ErrorAction
SilentlyContinue
Move-Item
-Path
$
(
$downloadFolder
+
$zipFilename
+
'\fit-standards\'
)
-Destination
$
(
$sourceFolder
)
-Force
$destFolder
=
$infoPlatformRoot
+
'content\fit-standards\'
$destFolderImages
=
$infoPlatformRoot
+
'public\img\fit-standards\icons\'
$filters
=
'*.jpg'
,
'*.png'
,
'*.svg'
$folders
=
Get-ChildItem
-Path
$
(
$sourceFolder
)
-Recurse
-Directory
-Force
-ErrorAction
SilentlyContinue
|
Select-Object
BaseName
foreach
(
$folder
in
$folders
)
{
$newFolder
=
$destFolder
+
$folder
.
BaseName
$mdFile
=
$folder
.
BaseName
+
".md"
Write-Host
$newFolder
New-Item
-ItemType
Directory
-Force
-Path
$newFolder
|
Out-Null
Copy-Item
-Path
$
(
$sourceFolder
+
$folder
.
BaseName
+
"\"
+
$mdFile
)
-Destination
$
(
$newFolder
+
"\"
)
$imageFile
=
$filters
|
%
{
Join-Path
$
(
$sourceFolder
+
$folder
.
BaseName
+
"\"
)
$_
}
|
Resolve-Path
if
(
-not
([
string
]::
IsNullOrEmpty
(
$imageFile
)))
{
Write-Host
"copying '
$imageFile
'..."
Copy-Item
-Path
$imageFile
-Destination
$destFolderImages
}
}
# Cleanup
remove-item
-Path
$archive
remove-item
-Path
$
(
$downloadFolder
+
$zipFilename
)
-Recurse
\ No newline at end of file
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