Skip to content

Commit

Permalink
Merge pull request #104 from shreelakshmijoshi/project-d
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
Gokul-KG authored Oct 28, 2024
2 parents 20b91a7 + ad49e23 commit 4463218
Show file tree
Hide file tree
Showing 44 changed files with 1,738 additions and 615 deletions.
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: 🐞 Bug
about: File a bug/issue
title: '[BUG] <title>'
labels: Bug
assignees: ''

---

* To report vulnerabilities please refer [SECURITY.md](https://github.com/datakaveri/dx-acl-apd/blob/main/SECURITY.md)

### Current Behavior:
<!-- A concise description of what you're experiencing. -->

### Expected Behavior:
<!-- A concise description of what you expected to happen. -->

### Steps To Reproduce:
<!--
Example: steps to reproduce the behavior:
1. In this environment...
1. With this config...
1. Run '...'
1. See error...
-->

### Screenshots or videos (optional)

### Environment:
<!--
Example:
- OS: Ubuntu 20.04
- Node: 13.14.0
- npm: 7.6.3
-->

### Anything else:
<!--
Links? References? Anything that will give us more context about the issue that you are encountering!
-->
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/new-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: ✨ Feature
about: a new feature request
title: '[Feature] <title>'
labels: feature
assignees: ''

---

Thank you for filling out this feature request report :vulcan_salute:


### Description:
<!-- A concise and clear description of feature you're interested in. -->

### Suggestion:
<!-- Describe a solution you'd like. A concise description of what you expected to happen. -->

### Alternatives:
<!-- Describe the alternative solution or feature -->

### Anything else:
<!--
Links? References? Anything that will give us more context about the feature that is being requested!
-->
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
* Please refer to the code of conduct : [link](https://github.com/datakaveri/dx-acl-apd/blob/main/CODE_OF_CONDUCT.md)

* **Please check if the PR fulfills these requirements** :clipboard:
- [ ] The commit message follows our guidelines : [link](https://github.com/datakaveri/dx-acl-apd/blob/main/CONTRIBUTING.md)
- [ ] Tests for the changes have been added (for bug fixes/features)
- [ ] Docs have been added/updated (for bug fixes/features)
- [ ] A new branch is created for the change(s) and the changes are not committed on the main or master branch
- [ ] No credentials or secrets are committed

* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, refactor, chore, test, config) :information_desk_person: :scroll:

Describe the changes <br>

* **Fixes** :wrench: # (issue)

* **Checklist for the current PR** :page_with_curl:
- [ ] I have made corresponding changes to the documentation
- [ ] I have added the respective changes in the [example-config](../example-config/config.json) if the changes are made in [config](../secrets/all-verticles-configs/config.json)
- [ ] For the changes made in example-config, backend components (elasticsearch, flyway files for postgres, immudb schema, rabbitmq) I have notified DX DevOps team by mentioning [at-sign]datakaveri/devops as a PR comment to help facilitate the further necessary changes
- [ ] I have mentioned the DX Catalogue items required in [resources-used](../src/test/resources/DX-Catalogue-Items/RESOURCES_USED.md)
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] pmd, check style issues are resolved locally
- [ ] I have added reviewers to check the proposed changes

* Please delete the content that is not relevant.
60 changes: 60 additions & 0 deletions .github/workflows/docker-image-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This github workflow will automatically update docker image tags of dmp-apd-depl in the datakaveri/iudx-deployment repository files, whenever docker image is pushed to ghcr.io/datakaveri/dmp-apd-server-depl .Based on tag it will update the 1.0.0 stable branch (if its 1.0.0-)

name: Update DMP APD docker image tags (release)

# This trigger will run the workflow whenever a new package is published to the registry
on:
registry_package:
types: [published]

permissions:
packages: read

jobs:
update-release:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
repository: datakaveri/iudx-deployment
token: "${{ secrets.JENKINS_UPDATE }}"
fetch-depth: 0

- name: Update ACL APD docker image tags (release)
env:
GH_TOKEN: ${{ secrets.JENKINS_UPDATE}}
run: |
# Get the latest version of 1.0.1 tag from the container registry using GitHub API
export newtag1_0_1=`(head -n 1 <(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/orgs/datakaveri/packages/container/acl-apd-depl/versions | jq ' .[].metadata.container.tags[0]' | grep 1.0.1 | grep -v alpha | sed -e 's/^"//' -e 's/"$//'))`
# Get the old tag from the YAML file
export oldtag1_0_1=`yq -r .services.acl-apd.image Docker-Swarm-deployment/single-node/acl-apd/acl-apd-stack.yaml | cut -d : -f 2`
git checkout 1.0.1
# Set Git user
git config --global user.name 'jenkins-datakaveri'
git config --global user.email "[email protected]"
# Update the YAML files and create a new branch for the tag update
if [ "$newtag1_0_1" != "$oldtag1_0_1" ]
then
git checkout -b cat-1.0.1-automatic-updates/$newtag1_0_1
sed -i s/$oldtag1_0_1/$newtag1_0_1/g Docker-Swarm-deployment/single-node/acl-apd/acl-apd-stack.yaml
# Update the application version
export oldappversion=`yq -r .version K8s-deployment/Charts/acl-apd/Chart.yaml`
export newappversion=`yq -r .version K8s-deployment/Charts/acl-apd/Chart.yaml | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}' `
sed -i s/$oldappversion/$newappversion/g K8s-deployment/Charts/acl-apd/Chart.yaml
sed -i s/$oldtag1_0_1/$newtag1_0_1/g K8s-deployment/Charts/acl-apd/values.yaml
git add Docker-Swarm-deployment/single-node/acl-apd/acl-apd-stack.yaml K8s-deployment/Charts/acl-apd/values.yaml K8s-deployment/Charts/acl-apd/Chart.yaml
git commit --allow-empty -m "updated ACL APD docker image tag to $newtag1_0_1"
git push --set-upstream origin cat-1.0.1-automatic-updates/$newtag1_0_1
# Create a new pull request on the datakaveri/iudx-deployment repository with the base branch 1.0.1
gh pr create -R datakaveri/iudx-deployment --base 1.0.1 --fill
fi
65 changes: 65 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This github workflow will automatically update docker image tags of acl-apd-depl in the datakaveri/iudx-deployment repository files, whenever docker image is pushed to ghcr.io/datakaveri/acl-apd-depl .Based on tag it will update the master/latest branch (if its 1.1.0-alpha-)

name: Update ACL APD docker image tags (main)

# This trigger will run the workflow whenever a new package is published to the registry
on:
registry_package:
types: [published]

permissions:
packages: read

jobs:
update-master:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
repository: datakaveri/iudx-deployment
# Jenkins token to perform git operations
token: "${{ secrets.JENKINS_UPDATE }}"
fetch-depth: 0

- name: Update ACL APD docker image tags (master/main)
env:
GH_TOKEN: ${{ secrets.JENKINS_UPDATE}}
run: |
# Get the latest version of 1.1.0-alpha tag from the container registry using GitHub API
export newtag1_1_0=`(head -n 1 <(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/orgs/datakaveri/packages/container/acl-apd-depl/versions | jq ' .[].metadata.container.tags[0]' | grep 1.1.0-alpha | sed -e 's/^"//' -e 's/"$//'))`
# Get the old tag from the YAML file
export oldtag1_1_0=`yq -r .services.acl-apd.image Docker-Swarm-deployment/single-node/acl-apd/acl-apd-stack.yaml | cut -d : -f 2`
git checkout master
# Set Git user
git config --global user.name 'jenkins-datakaveri'
git config --global user.email "[email protected]"
# Update the YAML files and create a new branch for the tag update
if [ "$newtag1_1_0" != "$oldtag1_1_0" ]
then
git checkout -b cat-automatic-updates/$newtag1_1_0

sed -i s/$oldtag1_1_0/$newtag1_1_0/g Docker-Swarm-deployment/single-node/acl-apd/acl-apd-stack.yaml

# Update the application version
export oldappversion=`yq -r .version K8s-deployment/Charts/acl-apd/Chart.yaml`
export newappversion=`yq -r .version K8s-deployment/Charts/acl-apd/Chart.yaml | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}' `


# Uses sed to find and replace $oldappversion with $newappversion in K8s-deployment/Charts/acl-apd/Chart.yaml and K8s-deployment/Charts/acl-apd/values.yaml files

sed -i s/$oldappversion/$newappversion/g K8s-deployment/Charts/acl-apd/Chart.yaml
sed -i s/$oldtag1_1_0/$newtag1_1_0/g K8s-deployment/Charts/acl-apd/values.yaml

git add Docker-Swarm-deployment/single-node/acl-apd/acl-apd-stack.yaml K8s-deployment/Charts/acl-apd/values.yaml K8s-deployment/Charts/acl-apd/Chart.yaml
git commit --allow-empty -m "updated ACL APD docker image tag to $newtag1_1_0"
git push --set-upstream origin cat-automatic-updates/$newtag1_1_0

# Create a new pull request on the datakaveri/iudx-deployment repository with the base branch master
gh pr create -R datakaveri/iudx-deployment --base master --fill
fi

44 changes: 44 additions & 0 deletions .github/workflows/move_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Move Docs

on:
push:
branches:
- main

jobs:
update-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Clone Target Repository
env:
TARGET_REPO_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
run: |
git clone https://x-access-token:${{ secrets.TARGET_REPO_TOKEN }}@github.com/datakaveri/iudx-developer-docs.git target-repo
cd target-repo
git checkout dev
- name: Copy Files from docs to Target Repository
run: |
cp -r docs/* target-repo/acl-docs/
ls -la target-repo/acl-docs
- name: Commit and Push Changes to Target Repository
env:
TARGET_REPO_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
run: |
cd target-repo
git add .
git commit -m "Update docs folder with new content from main branch" || echo "No changes to commit"
echo "Pushing changes to the repository..."
git push https://x-access-token:${{ secrets.TARGET_REPO_TOKEN }}@github.com/datakaveri/iudx-developer-docs.git dev
- name: List files in target-repo/acl-docs directory after push
run: ls -la target-repo/acl-docs
86 changes: 86 additions & 0 deletions .github/workflows/update_wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Update Wiki

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
update-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Clone Wiki Repository
env:
GITHUB_TOKEN: ${{ secrets.DOC_UPDATE }}
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki
continue-on-error: true

- name: Remove Old Wiki Content
run: |
echo "Removing old wiki content..."
rm -rf wiki/*
- name: Copy other files to target repository
run: |
cp -r LICENSE wiki/LICENSE.md |
cp -r CODE_OF_CONDUCT.md wiki/ |
cp -r CONTRIBUTING.md wiki/ |
cp -r SECURITY.md wiki/ |
ls -la wiki/
- name: Copy and Modify README for Wiki
run: |
echo "Copying and modifying README.md to wiki/Home.md..."
sed -e 's|./docs/|./|g' \
-e 's|./Solution_Architecture.md|./02-Solution-Architecture|g' \
-e 's|./Configurations.md|./03-Configurations|g' \
-e 's|./Explanation.md|./04-Explanation|g' \
-e 's|./SETUP-and-Installation.md|./05-SETUP-and-Installation|g' \
-e 's|./example-tutorials|./06-Tutorials|g' \
-e 's|./FAQ.md|07-FAQ|g' \
-e 's|./mai./|d/main/docs/|g' README.md > wiki/Home.md
ls -la wiki # Verify the file creation
- name: Copy Files to Wiki
run: |
echo "Copying files..."
cp -r docs/* wiki/
ls -la wiki # List files to verify copying
- name: Rename Files to Ensure Correct Order
run: |
echo "Renaming files to ensure correct order..."
mv wiki/Solution_Architecture.md wiki/02-Solution-Architecture.md
mv wiki/Configurations.md wiki/03-Configurations.md
mv wiki/Explanation.md wiki/04-Explanation.md
mv wiki/SETUP-and-Installation.md wiki/05-SETUP-and-Installation.md
mv wiki/Tutorials.md wiki/06-Tutorials.md
mv wiki/FAQ.md wiki/07-FAQ.md
mv wiki/LICENSE.md wiki/08-License.md
mv wiki/CODE_OF_CONDUCT.md wiki/09-Code-of-conduct.md | sed -i -e 's/.\/docs\/cdpg.png/cdpg.png/ ' wiki/09-Code-of-conduct.md
mv wiki/CONTRIBUTING.md wiki/10-Contributing.md | sed -i -e 's/.\/docs\/cdpg.png/cdpg.png/ ' wiki/10-Contributing.md
mv wiki/SECURITY.md wiki/11-Security.md | sed -i -e 's/.\/docs\/cdpg.png/cdpg.png/ ' wiki/11-Security.md
ls -la wiki # List files to verify renaming
- name: Commit and Push Changes to Wiki
run: |
cd wiki
git add .
git commit -m "Update wiki content with new file order" || echo "No changes to commit"
git push
continue-on-error: true

- name: List files in wiki directory after push
run: ls -la wiki
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.idea/
/secrets/all-verticles-configs/config-dev.json
/secrets/all-verticles-configs/config.json
/secrets/all-verticles-configs/config-test.json
/flyway.conf
Loading

0 comments on commit 4463218

Please sign in to comment.