Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scripts
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
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
Specification Tools
Scripts
Commits
c2df77e5
Commit
c2df77e5
authored
2 years ago
by
Miguel Angel Reina Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Adding publication scripts
parent
c19cc023
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+20
-0
20 additions, 0 deletions
.gitlab-ci.yml
publish_spec.sh
+35
-0
35 additions, 0 deletions
publish_spec.sh
with
55 additions
and
0 deletions
.gitlab-ci.yml
+
20
−
0
View file @
c2df77e5
...
@@ -7,11 +7,13 @@
...
@@ -7,11 +7,13 @@
workflow
:
workflow
:
rules
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_COMMIT_TAG
variables
:
variables
:
stages
:
stages
:
-
generation
-
generation
-
publication
Word CR text
:
Word CR text
:
stage
:
generation
stage
:
generation
...
@@ -35,3 +37,21 @@ Word CR text:
...
@@ -35,3 +37,21 @@ Word CR text:
paths
:
paths
:
-
docs/
-
docs/
expose_as
:
'
Word
CR
text'
expose_as
:
'
Word
CR
text'
Publish spec
:
stage
:
publication
only
:
-
tags
before_script
:
-
|
curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/publish_spec%2Esh/raw?ref=publication" >> publish_spec.sh
-
chmod +x publish_spec.sh
#- |
# curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/onem2m_spec_template%2Edocx/raw?ref=master" >> onem2m_coversheet_template.docx
script
:
-
echo 'Publishing spec'
-
./publish_spec.sh ${CI_PROJECT_URL} ${CI_COMMIT_TAG}
#onem2m_spec_template.docx
artifacts
:
name
:
"
${CI_PROJECT_NAME}_${CI_COMMIT_TAG}"
paths
:
-
"
${CI_PROJECT_NAME}_${CI_COMMIT_TAG}.docx"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
publish_spec.sh
0 → 100755
+
35
−
0
View file @
c2df77e5
#!/bin/bash
DOCKER_IMAGE
=
pandoc/core:3.0
echo
"
\n
------ Checking for docker image --------"
docker pull
"
$DOCKER_IMAGE
"
echo
"------ Removing previous outputs --------"
rm
**
/
*
.docx
echo
"------ Parsing repo URL --------"
HOST_URL
=
$(
echo
$1
|
cut
-d
'/'
-f
1-3
)
PROJECT_NAME
=
$(
echo
$1
|
cut
-d
'/'
-f
5- |
cut
-d
'.'
-f
1
)
echo
"HOST URL:"
$HOST_URL
echo
"PROJECT NAME:"
$PROJECT_NAME
echo
"TAG NAME:"
$2
echo
"------ Getting .md file(s) ------"
# If there are no .md files, then simply exit
ls
|
grep
-q
'md'
specs
=
$?
if
[
!
$specs
]
;
then
echo
"-- No Markdown files."
exit
0
fi
for
i
in
*
.md
;
do
echo
"
\n
------ Publishing spec --------"
docker run
--rm
-v
$(
pwd
)
:/data
-u
$(
id
-u
)
:
$(
id
-g
)
"
$DOCKER_IMAGE
"
"/data/
$i
"
-f
markdown
-t
docx
--reference-doc
"Spec-template.docx"
-o
"
${
PROJECT_NAME
}
_
${
2
}
.docx"
done
echo
"
\n
------ Publishing spec --------"
exit
0
\ 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