Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vl-dcc
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vaclab
vl-dcc
Commits
7ffabd12
Commit
7ffabd12
authored
2 years ago
by
Thomas Bock
Browse files
Options
Downloads
Patches
Plain Diff
readme update
parent
24524016
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+66
-66
66 additions, 66 deletions
README.md
with
66 additions
and
66 deletions
README.md
+
66
−
66
View file @
7ffabd12
# vl-dcc
DCC generation for the vacumm laboratory.
## install & activate
The DCC generation of the vacuum laboratory.
Create a file
`.git/hooks/pre-push`
in the GIT repository with the following
## API
### `vl-dcc/<cer_doc_id>` (GET)
Returns a
`xml`
version (the DCC) of a pre-generated
`json`
document:
```
shell
curl
-s
http://localhost:5006/vl-dcc/2019-75046
>
dcc-2019-75046.xml
```
Returns the DCC and validation at once:
```
shell
curl
-s
http://a73434:5006/vl-dcc/2019-75046 |
\
curl
-s
-X
POST
-H
"Content-Type: text/xml"
-d
@- http://a73434:5005/validate
```
### `update` (POST)
The update endpoint pulls the latest program version from origin master
```
http://server:port/update
```
This URL has to be specified in the GitLab server under "Settings /
Webhooks" (no secret token). "Tag Push Events" need to be activated. The
following information sent by GitLab is evaluated in order to obtain
all files of the repository:
```
json
{
"repository"
:
{
"homepage"
:
"https://a75436.berlin.ptb.de/vaclab/vl-dcc"
,
"name"
:
"vl-dcc"
}
}
```
### `version` (GET)
```
shell
curl
-s
http://localhost:5006/version
```
## Installation and activation
Create a file
`.git/hooks/pre-push`
in the GIT repository with the following
content:
```
shell
#!/bin/bash
# In the case of "git push --tags", writes the short tag value to the
# In the case of "git push --tags", writes the short tag value to the
# VERSION file in the top level directory of the Git repository
toplevel
=
$(
git rev-parse
--show-toplevel
)
...
...
@@ -38,7 +84,7 @@ Then make this file executable:
chmod
755 .git/hooks/pre-push
```
Do the following steps with root permission on the server installation:
Do the following steps with root permission
or sudo
on the server installation:
```
shell
mkdir
-p
/usr/local/share/vl-dcc
...
...
@@ -46,7 +92,7 @@ cd /usr/local/share/vl-dcc
curl
--silent
--insecure
--output
-
\
https://a75436.berlin.ptb.de/vaclab/vl-dcc/-/archive/master/vl-dcc-master.tar
\
|
tar
xf -
--strip-components
=
1
# only once
sudo
apt
install
python3-pip
# openSUSE: sudo zypper in python3-pip
sudo
apt
install
python3-pip
# openSUSE: sudo zypper in python3-pip
python3
-m
venv
.
source
bin/activate
pip3
install
pip-tools
...
...
@@ -56,83 +102,37 @@ chown -R nobody.nogroup $PWD # openSUSE: chown -R nobody.nobody $PWD
systemctl daemon-reload
# if already exist
systemctl
link
$PWD
/vl-dcc.service
systemctl
enable
vl-dcc.service
# make permanent
systemctl start vl-dcc.service
systemctl start vl-dcc.service
systemctl status vl-dcc.service
# running?
journalctl
-f
--unit
vl-dcc.service
# run-time check
```
## api
### vl-dcc/<cer_doc_id> (GET)
Returns a xml version of a certificate-document:
```
curl -s http://localhost:5006/vl-dcc/2019-75046 > dcc-2019-75046.xml
```
Returns a xml version of a certificate-document with validation at once:
```
curl -s http://a73434:5006/vl-dcc/2019-75046 | \
curl -s -X POST -H "Content-Type: text/xml" -d @- http://a73434:5005/validate
```
### zz (GET)
returns a xml version based on the dummy certificate-document (
`zz.json`
)
for test purpose.
```
curl -s http://localhost:5006/zz > zz.xml
```
### update (POST)
pulls the latest program version from origin master
```
http://server:port/update
```
This URL must be specified in the GitLab server under "Settings / Webhooks" (no
secret token). "Tag Push Events" must be activated. The following information
sent by GitLab is evaluated in order to obtain all files of the Ropositorium
via the requested tar stream:
```
json
{
...
"repository"
:
{
"homepage"
:
"https://a75436.berlin.ptb.de/vaclab/vl-dcc"
,
"name"
:
"vl-dcc"
}
...
}
```
### version (GET)
```
curl -s http://localhost:5006/version
```
## More hints
## Hints
Canonicalization and prettifying:
```
ba
sh
```
sh
ell
./pretty_c14n.py before.xml after.xml
```
Pretty printing the xml code:
```
bash
```
shell
cat
foo.xml | tidy
-xml
--indent
auto
--indent-cdata
yes
--quiet
yes
\
--wrap
0
--tab-size
2 -
>
bar.xml
```
The /zz (GET) endpoint
```
shell
curl
-s
http://localhost:5006/zz
>
zz.xml
```
returns a xml version based on the dummy certificate-document (
`zz.json`
)
for test purpose.
## TODO
*
update
`zz.json`
*
allow json POST
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