Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MessdatenSilo
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
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
Show more breadcrumbs
Lennard Kloock
MessdatenSilo
Commits
cf2df077
Commit
cf2df077
authored
2 years ago
by
SirWalross
Browse files
Options
Downloads
Patches
Plain Diff
Add support for gitlab ci
parent
eadddf32
No related branches found
No related tags found
No related merge requests found
Pipeline
#763
failed
2 years ago
Stage: convert
Stage: upload
Stage: release
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.github/workflows/convert.yml
+0
-4
0 additions, 4 deletions
.github/workflows/convert.yml
.gitlab-ci.yml
+37
-0
37 additions, 0 deletions
.gitlab-ci.yml
convert.py
+8
-3
8 additions, 3 deletions
convert.py
with
45 additions
and
7 deletions
.github/workflows/convert.yml
+
0
−
4
View file @
cf2df077
name
:
Convert data to .mat file(s)
name
:
Convert data to .mat file(s)
on
:
on
:
push
:
branches
:
-
"
main"
schedule
:
schedule
:
-
cron
:
"
0
1
*
*
*"
-
cron
:
"
0
1
*
*
*"
...
@@ -27,7 +24,6 @@ jobs:
...
@@ -27,7 +24,6 @@ jobs:
-
name
:
Convert data
-
name
:
Convert data
run
:
|
run
:
|
python3 convert.py
python3 convert.py
cd out && zip ../data.zip ./* && cd -
-
name
:
release
-
name
:
release
uses
:
"
./.github/actions/automatic-releases"
uses
:
"
./.github/actions/automatic-releases"
with
:
with
:
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
0 → 100644
+
37
−
0
View file @
cf2df077
stages
:
-
convert
-
upload
-
release
variables
:
PACKAGE_REGISTRY_URL
:
"
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/my_package/latest/data.zip"
convert
:
stage
:
convert
image
:
"
python:3.10"
script
:
-
python3 -m pip install --upgrade pip
-
python3 -m pip install numpy scipy
-
python3 convert.py
artifacts
:
paths
:
-
data.zip
-
CHANGELOG.md
upload
:
stage
:
upload
image
:
curlimages/curl:latest
script
:
-
echo "Compiling the code..."
-
echo "Compile complete."
script
:
-
'
curl
--header
"JOB-TOKEN:
${CI_JOB_TOKEN}"
--upload-file
data.zip
"${PACKAGE_REGISTRY_URL}"'
release
:
stage
:
release
image
:
registry.gitlab.com/gitlab-org/release-cli:latest
script
:
-
|
release-cli create --name "Data" --tag-name "latest" --description "CHANGELOG.md" \
--assets-link "{\"name\":\"data.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}\"}" \
\ No newline at end of file
This diff is collapsed.
Click to expand it.
convert.py
+
8
−
3
View file @
cf2df077
...
@@ -6,8 +6,9 @@ Combines the files from one weak and converts it into a single '.mat' file.
...
@@ -6,8 +6,9 @@ Combines the files from one weak and converts it into a single '.mat' file.
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
pathlib
import
Path
from
pathlib
import
Path
import
glob
import
glob
from
time
import
strptime
,
time
from
time
import
strptime
from
typing
import
Dict
,
Optional
from
typing
import
Dict
import
shutil
import
numpy
as
np
import
numpy
as
np
import
scipy.io
import
scipy.io
...
@@ -47,6 +48,10 @@ for week_start, arr in data.items():
...
@@ -47,6 +48,10 @@ for week_start, arr in data.items():
mdict
=
{
name
:
column
for
name
,
column
in
zip
(
header
,
np
.
split
(
arr
,
arr
.
shape
[
1
],
axis
=
1
))},
mdict
=
{
name
:
column
for
name
,
column
in
zip
(
header
,
np
.
split
(
arr
,
arr
.
shape
[
1
],
axis
=
1
))},
)
)
# zip folder
shutil
.
make_archive
(
"
data
"
,
"
zip
"
,
"
out
"
)
# Update CHANGELOG.md
# Update CHANGELOG.md
with
open
(
str
(
Path
.
joinpath
(
Path
(
__file__
).
parent
,
"
CHANGELOG.md
"
)),
"
w+
"
)
as
f
:
with
open
(
str
(
Path
.
joinpath
(
Path
(
__file__
).
parent
,
"
CHANGELOG.md
"
)),
"
w+
"
)
as
f
:
f
.
write
(
"
# Messdaten vom Silo von den Wochen:
\n
"
+
"
\n
"
.
join
([
"
-
"
+
key
for
key
in
data
.
keys
()]))
f
.
write
(
"
## Messdaten vom Silo von den Wochen:
\n
"
+
"
\n
"
.
join
([
"
-
"
+
key
for
key
in
data
.
keys
()]))
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