Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to compare the current document with document rendered in Confluence #47

Open
hudrid opened this issue Apr 16, 2024 · 6 comments

Comments

@hudrid
Copy link

hudrid commented Apr 16, 2024

Hello!
If possible, please implement a setting in cosmere.json to be able to compare the current document with a document already rendered in Confluence. And if both documents are the same, then stop rendering for the current document.

@hudrid hudrid mentioned this issue Apr 16, 2024
@mihaeu
Copy link
Owner

mihaeu commented Apr 16, 2024

Hey there, can you explain your use case a bit more to understand this? If I'm understanding you correctly, than this is kind of already possible by just looking at the cached files.

@hudrid
Copy link
Author

hudrid commented Apr 16, 2024

Thanks for the quick response!
Our company has a monorepository, where documents (our documents are full of tables and different styles) are collected via pipeline from different repositories. Then the documents are published on our website and in Confluence. We have implemented a check that identical documents should not be published, but the publication of documents in Confluence is always performed, regardless of whether the documents are identical or not. Thus, the last date of changes is different for the document on the site and the document in Confluence.

an example of a document that will always be published
# AdminGuide

### **Document card**

<table>
<tr>
<td> <div style="width:200px"> <b> Doc version </b></div> </td>
<td> <div style="width:300px"> 1.0 </div> </td>
</tr>
<tr>
<td> <b> Date: </b> </td>
<td> 16.08.2028 </td>
</tr>
<tr>
<td> <b> Version </b> </td>
<td> 2.0 </td>
</tr>
<tr>
<td> <b> Document type </b> </td>
<td> AdminGuide </td>
</tr>
<tr>
<td> <b> Customer </b> </td>
<td> Cust </td>
</tr>
<tr>
<td> <b> Document Status </b> </td>
<td> <span style="background-color: #DEEBFF; color: #0747A6"> <b> Validation </b> </span></td>
</tr>
</table>

@mihaeu
Copy link
Owner

mihaeu commented Apr 17, 2024 via email

@hudrid
Copy link
Author

hudrid commented Apr 17, 2024

The cache is not used.

What value should be specified for the paths parameter in pipeline? Maybe:

paths:
      - node_modules/

Сan you provide an example?

@mihaeu
Copy link
Owner

mihaeu commented Apr 17, 2024

This looks like GitLab pipelines if I'm not mistaken. The default cache path is build unless you specified another one in your comere.json configuration. If you add the cache to the cache layer/artifact of your build step/action cosmere will check the cache before doing anything and if things match, won't do any work on Confluence.

paths:
      - node_modules/
      - build/

In case you are using GitLab pipelines make sure to consider which steps write and read from and to your cache. E.g. an npm install step should write to the cache, all other steps should only read from that folder. The step in which cosmere converts and publishes the information has to both read and write,

@hudrid
Copy link
Author

hudrid commented Apr 18, 2024

gitlab-ci.yml:
confluence:
  image: ...
  stage: publish
  tags:
    - pages
  cache:
    paths:
      - node_modules/
      - build/
  before_script:
    - rm -rf $DOCS_DIR
    - cp -R $CI_PROJECT_DIR/release/ $DOCS_DIR
    - ls -la $DOCS_DIR
  script:
    - npm install
    #- npm run lint
    - npm run publish
  artifacts:
    paths:
      - build
  only:
    - master
  needs:
    - job: collect_docs
      artifacts: true

Works only for documents without pictures.

Job Information

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants