Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TOP Extras
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TDL Open Source
TOP Extras
Commits
fd88abec
Commit
fd88abec
authored
1 year ago
by
Philip Makedonski
Browse files
Options
Downloads
Patches
Plain Diff
+ fixes for script
parent
abb4dd4a
No related branches found
No related tags found
1 merge request
!2
+ added yang tools wrapper
Pipeline
#4057
passed
1 year ago
Stage: build
Stage: prepare
Stage: upload
Stage: release
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prepare.sh
+21
-6
21 additions, 6 deletions
prepare.sh
with
21 additions
and
6 deletions
prepare.sh
+
21
−
6
View file @
fd88abec
...
...
@@ -4,21 +4,23 @@ BASE_URL=$1
TARGET_CHANNEL
=
$2
SITE_PATH
=
$3
RELEASE_BASE_PATH
=
$4
#$BASE_URL="https://top.etsi.org/top-extras/updatesite"
update_contents
()
{
local
TARGET_PATH
=
$1
# Escape slashes in the variable
CLEAN
=
$(
echo
"
$TARGET_PATH
"
|
sed
's/\//\\\//g'
)
echo
$TARGET_PATH
CLEAN
=
$(
echo
"
$TARGET_PATH
/"
|
sed
's/\//\\\//g'
)
echo
$CLEAN
# Use the escaped variable in a sed command
find
.
-type
f |
sed
-e
"s|
$CLEAN_URL
||g"
>
"
$TARGET_PATH
/content.txt"
echo
"find . -type f | sed -e
\"
s|
$CLEAN
||g
\"
>
\"
$TARGET_PATH
/content.txt
\"
"
find
$TARGET_PATH
-type
f |
sed
-e
"s|
$CLEAN
||g"
>
"
$TARGET_PATH
/content.txt"
}
process_contents
()
{
local
base
=
"content"
local
channel
=
$1
local
file
=
"
$base
-
$channel
.txt"
curl
"
$BASE_URL
/
$channel
/
$base
.txt"
-o
"
$file
"
curl
"
$BASE_URL
/
$channel
/
$base
.txt"
-o
"
$file
"
mkdir
$channel
# Fetch files from page
...
...
@@ -26,6 +28,10 @@ process_contents() {
while
IFS
=
read
-r
line
;
do
# Execute your command for each line
echo
"Processing:
$line
"
if
[
"
$line
"
==
""
]
;
then
echo
"Empty line, aborting."
exit
0
fi
# make parent dirs
mkdir
-p
`
dirname
"
$line
"
`
# get file
...
...
@@ -33,16 +39,25 @@ process_contents() {
# update contents
done
<
"
$file
"
update_contents
$channel
mkdir
-p
$RELEASE_BASE_PATH
/
$channel
cp
-r
-f
$channel
/
*
$RELEASE_BASE_PATH
/
$channel
}
# process opposite channel
if
[
"
$TARGET_CHANNEL
"
==
"beta"
]
;
then
if
[
"
$TARGET_CHANNEL
"
==
"beta"
]
;
then
process_contents
"main"
else
process_contents
"beta"
fi
# update conte
i
nts
# update contents
update_contents
"
$SITE_PATH
"
# Debugging
# BASE_URL="https://top.etsi.org/top-extras/updatesite"
# TARGET_CHANNEL="beta"
# SITE_PATH="updatesite/org.etsi.mts.tdl.extras.updatesite/target/repository"
# RELEASE_BASE_PATH="public/updatesite"
# # process_contents beta
# update_contents "$SITE_PATH"
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