Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
courses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
R3
school
courses
Commits
425b501a
Commit
425b501a
authored
1 year ago
by
Laurent Heirendt
Browse files
Options
Downloads
Plain Diff
Merge branch 'lh-no-matomo' into 'develop'
Option to not use matomo See merge request
R3/school/courses!187
parents
271d5adb
88e6f4f6
No related branches found
Branches containing commit
No related tags found
1 merge request
!187
Option to not use matomo
Pipeline
#79291
passed
1 year ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contribute.py
+9
-5
9 additions, 5 deletions
contribute.py
contribute.sh
+6
-4
6 additions, 4 deletions
contribute.sh
with
15 additions
and
9 deletions
contribute.py
+
9
−
5
View file @
425b501a
...
...
@@ -7,8 +7,9 @@ from shutil import copyfile
@click.command
()
@click.option
(
'
--date
'
,
default
=
datetime
.
datetime
.
today
().
strftime
(
'
%Y-%m-%d
'
),
help
=
'
Date of the presentation - format: YYYY-MM-DD
'
)
@click.option
(
'
--name
'
,
default
=
'
myPresentation
'
,
help
=
'
Short name of the presentation.
'
)
@click.option
(
'
--analytics
'
,
default
=
'
yes
'
,
help
=
'
Analytics setting
'
)
def
main
(
date
,
name
):
def
main
(
date
,
name
,
analytics
):
"""
Copies the template folder
"""
# validate the date
...
...
@@ -86,11 +87,14 @@ def main(date, name):
click
.
echo
(
'
> All dependencies already installed.
'
)
# add analytics
os
.
system
(
'
sed -i
"
/matomohead/r./../../.ci/analytics/head.html
"
theme/templates/_index.html
'
)
os
.
system
(
'
sed -i
"
/matomopolicy/r./../../.ci/analytics/policy.html
"
theme/templates/_index.html
'
)
os
.
system
(
'
sed -i
"
/matomobanner/r./../../.ci/analytics/gdpr-banner.html
"
theme/templates/_index.html
'
)
if
analytics
==
"
yes
"
:
os
.
system
(
'
sed -i
"
/matomohead/r./../../.ci/analytics/head.html
"
theme/templates/_index.html
'
)
os
.
system
(
'
sed -i
"
/matomopolicy/r./../../.ci/analytics/policy.html
"
theme/templates/_index.html
'
)
os
.
system
(
'
sed -i
"
/matomobanner/r./../../.ci/analytics/gdpr-banner.html
"
theme/templates/_index.html
'
)
click
.
echo
(
'
> Matomo added.
'
)
click
.
echo
(
'
> Matomo added.
'
)
else
:
click
.
echo
(
'
> No analytics.
'
)
# launch the server
os
.
system
(
'
grunt server
'
)
...
...
This diff is collapsed.
Click to expand it.
contribute.sh
+
6
−
4
View file @
425b501a
...
...
@@ -7,28 +7,30 @@ dockerPort="9000"
helpFunction
()
{
echo
""
echo
"Usage:
$0
-d parameterDate -n parameterName"
echo
"Usage:
$0
-d parameterDate -n parameterName
-a parameterAnalytics
"
echo
-e
"
\t
-d Date of presentation"
echo
-e
"
\t
-n Name of presentation"
echo
-e
"
\t
-a [yes/no] for integration of analytics"
exit
1
# Exit script after printing help
}
while
getopts
"d:n:"
opt
while
getopts
"d:n:
a:
"
opt
do
case
"
$opt
"
in
d
)
parameterDate
=
"
$OPTARG
"
;;
n
)
parameterName
=
"
$OPTARG
"
;;
a
)
parameterAnalytics
=
"
$OPTARG
"
;;
?
)
helpFunction
;;
# Print helpFunction in case parameter is non-existent
esac
done
# Print helpFunction in case parameters are empty
if
[
-z
"
$parameterDate
"
]
||
[
-z
"
$parameterName
"
]
if
[
-z
"
$parameterDate
"
]
||
[
-z
"
$parameterName
"
]
||
[
-z
"
$parameterAnalytics
"
]
then
echo
"Some or all of the parameters are empty"
;
helpFunction
fi
# launch the docker file
cmd
=
"python contribute.py --date=
\"
$parameterDate
\"
--name=
\"
$parameterName
\"
"
cmd
=
"python contribute.py --date=
\"
$parameterDate
\"
--name=
\"
$parameterName
\"
--analytics=
\"
$parameterAnalytics
\"
"
docker run
-p
$dockerPort
:
$dockerPort
--user
$(
id
-u
)
:
$(
id
-g
)
-it
-v
$(
pwd
)
/:/presentation
$dockerImg
/bin/bash
-c
"
$cmd
"
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