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

Develop #12

Merged
merged 373 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
373 commits
Select commit Hold shift + click to select a range
ed93dc0
add header to all pages
lionick Apr 4, 2023
165e6b5
Trying with authlib and starllete (#6)
ioigoume Apr 4, 2023
631e243
Cors only enabled for dev environment.Change config parser. (#7)
ioigoume Apr 4, 2023
34bf177
Remove obsolete Login and Register reactjs implementation. (#8)
ioigoume Apr 6, 2023
3539167
Refactor Login button. (#9)
ioigoume Apr 6, 2023
f692ff5
Fix configuration parsing (#10)
ioigoume Apr 12, 2023
36b3187
minor fix
lionick May 4, 2023
68c3d36
minor css fix
lionick May 4, 2023
c5e8e8c
Minor authentication config improvements (#11)
ioigoume May 4, 2023
d6f3ba0
Load server configuration (#12)
ioigoume May 4, 2023
6f70eb0
change repos to look at rciam
lionick May 5, 2023
8c85228
Merge branch 'deploy_changes' of github.com:lionick/rciam-metrics-dev…
lionick May 5, 2023
0f059c7
minor fixes
lionick May 5, 2023
57770ec
Minor fixes (#13)
ioigoume May 5, 2023
ef100d8
redirect uri fix extra f slash (#14)
ioigoume May 5, 2023
d3b415a
Authentication link button.Set login cookie. (#15)
ioigoume May 8, 2023
f8f48f6
Fix server domain config (#16)
ioigoume May 10, 2023
9f78433
Parse userinfo data (#17)
ioigoume May 12, 2023
c3cda6e
render user profile (#18)
ioigoume May 12, 2023
1f1e0a8
Fix fastapi logout (#19)
ioigoume May 12, 2023
8c41ae0
Improve side navigation (#20)
ioigoume May 15, 2023
2503b75
Fix datatable element id. Fix redirect uri for logout. (#21)
ioigoume May 15, 2023
23326bd
Fix redirect uri (#22)
ioigoume May 15, 2023
23b1d3e
Improve logout response handling (#24)
ioigoume May 15, 2023
d0f9b00
add responsive to tiles, datatable, and center logo when logged in
lionick May 15, 2023
78e5951
Merge branch 'deploy_changes' of github.com:lionick/rciam-metrics-dev…
lionick May 15, 2023
f82859f
fix navbar-fixed-top width for smaller screens
lionick May 15, 2023
0690808
Logout response improve (#26)
ioigoume May 16, 2023
753367c
Refactor requests (#27)
ioigoume May 16, 2023
c333db5
fix logo position when logged in
lionick May 16, 2023
a371532
Idps, Sps refactor requests (#28)
ioigoume May 16, 2023
22c2bab
Refactor users request. Tenantid check for all empty values. (#29)
ioigoume May 16, 2023
c5276f7
fix links for idps at datatable
lionick May 17, 2023
dd94446
Refactor requests 4 (#30)
ioigoume May 17, 2023
b05880e
Fetch userinfo using access token (#31)
ioigoume May 18, 2023
50226c5
Locking frontend part 1 and locking backend part 2 (#32)
ioigoume May 18, 2023
a6cda8b
Refactor idps dataTable (#33)
ioigoume May 18, 2023
bf1babb
Refactor entryInfo (#34)
ioigoume May 19, 2023
4fc19b1
Entity Info for sp and idp use separate modules (#35)
ioigoume May 19, 2023
ac1cc7a
refactor spsDataTable
lionick May 19, 2023
2bbe8c5
refactor spsDataTable 2
lionick May 19, 2023
4da1ba4
remove unused imports
lionick May 19, 2023
df18fd5
Refactor idp pie chart (#36)
ioigoume May 19, 2023
4815109
Refactor SP map (#37)
ioigoume May 19, 2023
b4706b3
pie charts should not have click action for unauthenticated users, fi…
lionick May 22, 2023
52e57c1
Fix datatable links (#38)
ioigoume May 22, 2023
912bee7
refactor code
lionick May 23, 2023
caf8028
fix unrendered links for datatable and initialize var
lionick May 24, 2023
f379c7f
fix service provider identifier name for datatable
lionick May 25, 2023
b899c42
Authorization (#39)
ioigoume May 26, 2023
fb012f3
refactor loginsMap
lionick May 29, 2023
9eba511
Merge branch 'deploy_changes' of github.com:lionick/rciam-metrics-dev…
lionick May 29, 2023
1ee0eaf
Refactor loginDataTable (#40)
ioigoume May 29, 2023
05dcce7
refactor loginLineChart
lionick May 29, 2023
b260aa5
Refactor idpMapToDataTable.js (#41)
ioigoume May 29, 2023
409fc55
Refactor spMapToDataTable.js (#42)
ioigoume May 30, 2023
6865924
refactor registeredUsersTiles
lionick May 30, 2023
f830a49
Refactor communitites DataTable (#43)
ioigoume May 30, 2023
8899a2e
refactor loginTiles.js
lionick May 30, 2023
b768899
refactor registeredUsersMap.js
lionick May 31, 2023
6ca6f36
refactor listCommunities.js
lionick May 31, 2023
4e666e4
Refactoring communities chart (#44)
ioigoume May 31, 2023
62d3f48
Refactor communities map (#45)
ioigoume Jun 1, 2023
b17a5c3
registeredUsersMap use EarthMap module (#46)
ioigoume Jun 2, 2023
03784c5
Refactor idpmap. Use EarthMap module. (#47)
ioigoume Jun 2, 2023
2981d6b
Use EarthMap module everywhere (#48)
ioigoume Jun 6, 2023
811b3de
refactor registered users datatabel (#49)
ioigoume Jun 6, 2023
e6537a1
refactor registered users chart (#50)
ioigoume Jun 7, 2023
87a1f97
Add auth dependency to all paths. skip logins and dashboard. (#51)
ioigoume Jun 7, 2023
7c6a872
Rename project to "tenant" and tenant to "tenenv" (#53)
lionick Jun 8, 2023
af51057
delete cookies (#52)
ioigoume Jun 12, 2023
69bad2f
fix condition (#54)
ioigoume Jun 13, 2023
6f181ee
Fix window location href. Fix force logout when accessing logins and …
ioigoume Jun 13, 2023
f0231f2
Fix loginlineChart refetch in useEffect (#56)
ioigoume Jun 13, 2023
55aa4eb
Refactor loginLineChart (#57)
ioigoume Jun 13, 2023
4fcde98
Refactor logins group by query.Simplify frontend. (#58)
ioigoume Jun 14, 2023
4ffd57c
Remove obsolete javascript files.Improve authentication dependency cl…
ioigoume Jun 15, 2023
3626715
Fix chart race condition. Remove obsolete states. (#60)
ioigoume Jun 15, 2023
e31d7df
Google Charts break when returning during loading (#61)
ioigoume Jun 15, 2023
5210af3
Add permission cookie. Authorization apply to side nav menu. (#62)
ioigoume Jun 16, 2023
209f56c
Fix authorization part2.Other fixes. (#63)
ioigoume Jun 19, 2023
8567227
Add missing initialization (#64)
ioigoume Jun 19, 2023
c22693f
Set environment and tenant in middleware only. (#65)
ioigoume Jun 19, 2023
12a4e20
Global frontend config per tenant (#66)
ioigoume Jun 20, 2023
be21916
move all files directory under src
lionick Jun 20, 2023
99e05a7
Merge branch 'deploy_changes' of github.com:lionick/rciam-metrics-dev…
lionick Jun 20, 2023
d14abef
minor fix
lionick Jun 20, 2023
804b1f4
minor fix
lionick Jun 20, 2023
4e45774
fix error with babel
lionick Jun 20, 2023
cd1f8e4
add ingester from statistics_raw (#68)
lionick Jun 23, 2023
9b8c323
import configuration from global json file (#69)
ioigoume Jun 27, 2023
2c73acc
Remove console.Mv exact config file. (#70)
ioigoume Jun 27, 2023
c412fee
add console log
ioigoume Jun 27, 2023
2b39c54
Merge pull request #71 from ioigoume/test
ioigoume Jun 27, 2023
4b0b025
Remove app/public
ioigoume Jun 27, 2023
1809341
Merge pull request #72 from ioigoume/remove_obsolete_directory
ioigoume Jun 27, 2023
9665c86
workflow debug messages
ioigoume Jun 27, 2023
60c1772
Merge pull request #73 from ioigoume/workflow_debug_messages
ioigoume Jun 27, 2023
7b3cf49
add file to path
ioigoume Jun 27, 2023
d5137dd
remove console
ioigoume Jun 27, 2023
b485c59
add checks if idpName, spName is empty (#74)
lionick Jun 28, 2023
e9077a2
Remove tenant and environment context (#75)
ioigoume Jun 28, 2023
b736330
Parse tenant+environment config file (#76)
ioigoume Jun 30, 2023
a4ce099
remove debug comment
ioigoume Jun 30, 2023
457ab41
Fix various issues at ingesters (#77)
lionick Jul 3, 2023
d1aeb15
remove hard coded egi configuration
ioigoume Jul 3, 2023
deb8f4e
fix authorize configuration file parsing
ioigoume Jul 3, 2023
c7c6746
fix wrong parameter in permissionCalculation
ioigoume Jul 3, 2023
5ea0d62
Add spinner (#78)
ioigoume Jul 4, 2023
aa67ef0
Loader fixes.Remove tenant and environment url path. (#79)
ioigoume Jul 5, 2023
7609106
Add path metrics
ioigoume Jul 6, 2023
aa0962b
Merge pull request #80 from ioigoume/Add_path_metrics
ioigoume Jul 6, 2023
9265fd6
Set homepage to package.json
ioigoume Jul 7, 2023
2ecf4d9
Merge pull request #81 from ioigoume/Homepage_package_json
ioigoume Jul 7, 2023
eba7c6b
empty space
ioigoume Jul 7, 2023
555d354
Merge pull request #82 from ioigoume/dummy_pr
ioigoume Jul 7, 2023
acf26ef
add name for global config file (logger)
lionick Jul 10, 2023
91b84cd
Set locales path to metrics
ioigoume Jul 10, 2023
3b93e3b
Merge pull request #83 from ioigoume/translation_path
ioigoume Jul 10, 2023
6493578
add verification_hash endpoint for ams
lionick Jul 19, 2023
5aba44d
remove redundant session
lionick Jul 19, 2023
1fc4ee7
refactor github actions
ioigoume Jul 19, 2023
70246bb
Merge pull request #85 from ioigoume/github_actions
ioigoume Jul 20, 2023
3fe0206
Fix config per tenant name for moving
ioigoume Jul 20, 2023
302f8ab
Move tenant frontend config to config.json
ioigoume Jul 20, 2023
51b94b2
Fix frontend release name
ioigoume Jul 20, 2023
2a8e8eb
frontend release is only the javascript/build
ioigoume Jul 20, 2023
59ba3ea
Dummy commit to force deployment
ioigoume Jul 20, 2023
1f40e62
Keep last 100 releases
ioigoume Jul 20, 2023
a223b5a
fix clean release
ioigoume Jul 20, 2023
e40490c
dummy commit
ioigoume Jul 20, 2023
e3f8af5
frontend release directory
ioigoume Jul 20, 2023
17b7e2e
fix frontend release packaging
ioigoume Jul 20, 2023
c140bcf
dummy commit
ioigoume Jul 20, 2023
e5fd0ce
javascript compress path
ioigoume Jul 20, 2023
5b1fabe
frontend files to compress
ioigoume Jul 20, 2023
e899ea1
dummy commit
ioigoume Jul 20, 2023
911488d
add comments
ioigoume Jul 21, 2023
8900982
Get tenant configuration from file
ioigoume Jul 25, 2023
80507a6
Merge pull request #86 from ioigoume/get_tenants_from_files
ioigoume Jul 25, 2023
4ddb746
fix path of config.json tenant file
ioigoume Jul 25, 2023
d1b8df5
set working directory of tenant config.json
ioigoume Jul 25, 2023
a373ec4
fix working directory
ioigoume Jul 25, 2023
1c89439
testing working directory
ioigoume Jul 25, 2023
fef270d
checkout job is a prerequisite for the rest
ioigoume Jul 25, 2023
ed1a35e
Job outputs are available to all downstream jobs that depend on this job
ioigoume Jul 25, 2023
a13d279
fix squear bracket typo
ioigoume Jul 25, 2023
2a540e8
Change config file for database (#87)
lionick Jul 26, 2023
1c3ab9e
add ip_databases folder
lionick Jul 26, 2023
7c1eed9
Merge branch 'deploy_changes' of github.com:lionick/rciam-metrics-dev…
lionick Jul 26, 2023
10d44b2
add endpoint for consuming raw stats
lionick Jul 26, 2023
f734ed0
minor fix
lionick Jul 26, 2023
dab6570
add utils for ipDatabase
lionick Jul 26, 2023
fe8d3b3
add geoip2 to requirements
lionick Jul 26, 2023
93f1c9c
Use different release plugin
ioigoume Jul 28, 2023
b0532fd
Merge pull request #88 from ioigoume/Change_release_plugin
ioigoume Jul 28, 2023
38c0e9f
Change release plugin for backend release
ioigoume Jul 28, 2023
f0b8150
testing changelog.md path
ioigoume Jul 28, 2023
33969e8
testing changelog path
ioigoume Jul 28, 2023
6a0bbc6
backend release notes improve
ioigoume Jul 28, 2023
df76b46
Fix provider's link path
ioigoume Aug 2, 2023
b667607
Merge pull request #89 from ioigoume/Fix_provider_path
ioigoume Aug 2, 2023
393c9fe
fix issues RCM-47, RCM-49, RCM-50
lionick Aug 3, 2023
713522f
handle authorization header as a simple header at ams endpoint
lionick Aug 4, 2023
8da65e3
hanlde the case we have only one message at each request
lionick Aug 7, 2023
3846661
add missing python requirements
ioigoume Aug 21, 2023
83b271f
Merge pull request #90 from ioigoume/python_requirements
ioigoume Aug 21, 2023
c10551d
minor spacing changes
ioigoume Aug 21, 2023
2f89322
Merge pull request #91 from ioigoume/Minor_spacing_refactor
ioigoume Aug 21, 2023
0383cbe
Fix configuration
ioigoume Aug 25, 2023
097dce3
Merge pull request #92 from ioigoume/Configuration_fixes
ioigoume Aug 25, 2023
93f1bea
update readme file
ioigoume Aug 25, 2023
2cd53c2
Merge pull request #93 from ioigoume/readme_update
ioigoume Aug 25, 2023
b09d5ef
readme update
ioigoume Aug 25, 2023
5d8407b
Merge pull request #94 from ioigoume/readme_update_2
ioigoume Aug 25, 2023
8f0bc6a
Minor changes
ioigoume Aug 25, 2023
69faf5f
Merge pull request #95 from ioigoume/Minor_changes
ioigoume Aug 25, 2023
468ff61
fix homepage
ioigoume Aug 25, 2023
485cd2d
fix datatable rendering (#96)
lionick Aug 30, 2023
4dfefa4
Abort query on useEffect return
ioigoume Sep 1, 2023
c066fcf
Merge pull request #97 from ioigoume/abort_query_in_useeffect
ioigoume Sep 1, 2023
bc137b6
Fix goToSpecificProvider where missing
ioigoume Sep 1, 2023
1ca42cc
Merge pull request #98 from ioigoume/apply_goToSpecificProvider_every…
ioigoume Sep 1, 2023
2a5f853
Bug fixes etc (#99)
lionick Sep 5, 2023
2445496
fix update of data when unique_logins change (#100)
lionick Sep 5, 2023
78ad6da
fix rendering of dashboard map (#101)
lionick Sep 6, 2023
2762a4e
disable loginTiles
lionick Sep 6, 2023
9ff29df
test dashboard with less data
lionick Sep 6, 2023
85d109e
temporary remove map from dashboard
lionick Sep 6, 2023
caf5b2c
hash user before saving it to statistics_raw table
lionick Sep 8, 2023
1fedfe8
hash user before saving it to statistics_raw table (#103)
lionick Sep 8, 2023
a60746b
Merge branch 'deploy_changes' of github.com:lionick/rciam-metrics-dev…
lionick Sep 8, 2023
2e30ac9
minor fix
lionick Sep 8, 2023
103926b
minor fix
lionick Sep 8, 2023
8841f09
minor fix
lionick Sep 8, 2023
510fcbf
remove abort controller
lionick Sep 8, 2023
dcd1ded
remove Abort controller
lionick Sep 11, 2023
84d842d
show pie charts data from day one
lionick Sep 14, 2023
10420df
change text at tiles
lionick Sep 14, 2023
51273f8
show Dates at Map, dont rerender loginlinechart without reason
lionick Sep 14, 2023
35f10d9
fix error
lionick Sep 14, 2023
d3963b7
add condition for unique logins
lionick Sep 14, 2023
b650267
fix when status not present at type:registration
lionick Sep 15, 2023
ee142fa
fix yesterdays tile
lionick Sep 15, 2023
17415ac
fix validation error
lionick Sep 15, 2023
a667d61
fix problem with datepicker endDate
lionick Sep 19, 2023
edbf7d2
remove comment
ioigoume Sep 19, 2023
27031e4
add comment
ioigoume Sep 19, 2023
72667e7
initial config
ioigoume Jun 1, 2023
7c018d5
Save tenant and environment to cookie instead to window object
ioigoume Sep 20, 2023
ff27e5e
Merge pull request #104 from ioigoume/tenant_environment_save_to_cookie
ioigoume Sep 20, 2023
108ef57
add tenant debug message.Revert Dockerfile unwanted change.
ioigoume Sep 20, 2023
6c141cc
Merge pull request #105 from ioigoume/debug_message
ioigoume Sep 20, 2023
5210c61
metrics app path per tenant
ioigoume Sep 20, 2023
db39b3c
Merge pull request #106 from ioigoume/metrics_app_path
ioigoume Sep 20, 2023
f96bef7
breake to mv config to multiple steps
ioigoume Sep 20, 2023
fe78af4
tenant specific checkout path
ioigoume Sep 20, 2023
74156b7
working directory per tenant
ioigoume Sep 20, 2023
06b9036
fix release path
ioigoume Sep 20, 2023
5b95fc6
add more granularity to github action messages
ioigoume Sep 20, 2023
753b7fc
Add messages
ioigoume Sep 20, 2023
4a78ef2
improve messages
ioigoume Sep 20, 2023
67739c2
improve messages
ioigoume Sep 20, 2023
569bc6c
upload artifact for each tenant
ioigoume Sep 20, 2023
6e9a4b1
upload artifact for each tenant
ioigoume Sep 20, 2023
d6a5e65
create backend artifact and one for each tenant
ioigoume Sep 20, 2023
7dde5a7
more debug messages
ioigoume Sep 20, 2023
ca5651a
more debug messages
ioigoume Sep 20, 2023
3526caa
fix artifact download path
ioigoume Sep 20, 2023
357638e
more debug messages
ioigoume Sep 20, 2023
159b203
fix frontend artifact path
ioigoume Sep 20, 2023
c27ad11
fix frontend artifact path
ioigoume Sep 20, 2023
f1256f7
fix query to return only tenenv_info data
lionick Sep 22, 2023
e9a6262
Merge pull request #2 from lionick/deploy_changes
lionick Sep 25, 2023
ea8ee25
rename VAULT_PASSWORD TO VAULT_PASSWORD_DEVEL
lionick Sep 27, 2023
e649e0a
Merge pull request #3 from lionick/rename_vault_devel
lionick Sep 27, 2023
6131fcd
minor fix
lionick Sep 28, 2023
0345b5f
Merge pull request #4 from lionick/minor_fix
lionick Sep 28, 2023
06d0a1c
Merge pull request #5 from rciam/deploy_changes
ioigoume Sep 28, 2023
a82af82
fix requirements for python 3.11.5
ioigoume Sep 28, 2023
4eb4fc6
Merge pull request #6 from ioigoume/upgrade_requirements
ioigoume Sep 28, 2023
a2af16e
add missing configuration
ioigoume Sep 28, 2023
8cbec5b
Merge pull request #7 from ioigoume/add_missing_python_requirement
ioigoume Sep 28, 2023
b04eb10
remove greenlet python package from requirements.txt
ioigoume Sep 28, 2023
d7939c5
fix ansible tag names
ioigoume Sep 29, 2023
d4521bb
Merge pull request #8 from ioigoume/fix_release_ansbile_task_names
ioigoume Sep 29, 2023
b3505fc
create a release action flow for production
ioigoume Oct 2, 2023
bf0eb9b
Merge pull request #9 from ioigoume/github_release_main
NicolasLiampotis Oct 2, 2023
5f36573
use develop and main metrics branch respectively
ioigoume Oct 2, 2023
1ad285f
Merge pull request #10 from ioigoume/fix_wrong_pull_branch
lionick Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
304 changes: 304 additions & 0 deletions .github/workflows/release_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
name: CI at Main Branch
run-name: ${{ github.actor }} is deploying at main branch 🚀
on:
push:
branches:
- main
env:
RELEASE_ID: rc-${{ github.ref_name }}-${{ github.run_id }}
NODE_VERSION: 16.x
jobs:
configure:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout to repository
uses: actions/checkout@v3
with:
repository: 'grnet/rciam-deploy-inv'
ref: 'master'
ssh-key: ${{ secrets.DEPLOY_READ_SECRET }}
path: 'inventory'
- name: Set matrix data
id: set-matrix
working-directory: inventory/rciam-metrics/files/all/tenants
# https://www.jitsejan.com/use-github-actions-with-json-file-as-matrix
run: |
ls
cat ./config.json
echo "matrix=$(jq -c . < ./config.json)" >> $GITHUB_OUTPUT
checkout:
runs-on: ubuntu-latest
needs: configure
strategy:
matrix: ${{ fromJson(needs.configure.outputs.matrix) }}
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref_name }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
with:
path: 'metrics-app-${{matrix.tenant}}'
ref: 'main'
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "💡 The ${{ github.sha }} commit processing started."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Download playbook
uses: actions/checkout@v3
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: 'rciam/rciam-deploy'
ref: 'master'
path: 'roles'
- name: Download inventory
uses: actions/checkout@v3
with:
repository: 'grnet/rciam-deploy-inv'
ref: 'master'
ssh-key: ${{ secrets.DEPLOY_READ_SECRET }}
path: 'inventory'
- name: Run playbook (create react_config file)
uses: dawidd6/action-ansible-playbook@v2
with:
# Required, playbook filepath
playbook: metricsservers.yml
# Optional, directory where playbooks live
directory: ./roles
key: ${{ secrets.DEPLOY_READ_SECRET }}
# Optional, encrypted vault password
vault_password: ${{secrets.VAULT_PASSWORD}}
options: |
--inventory ${{ github.workspace }}/inventory/rciam-metrics/hosts.ini
--tags rciam-metrics:config-local
-u debian
- name: List files in the repository
# The tenant specific config file, i.e. config.tenant.environment.json, becomes plain config.json
# because the frontend lives under its own directory/path
run: |
ls -la ${{ github.workspace }}/inventory/rciam-metrics/files
- name: Move tenant config file to config.json
# The tenant specific config file, i.e. config.tenant.environment.json, becomes plain config.json
run: |
mv ${{ github.workspace }}/inventory/rciam-metrics/files/config.${{ matrix.tenant }}.json ${{ github.workspace }}/metrics-app-${{matrix.tenant}}/javascript/src/config.json
- name: List files in metrics-app-${{matrix.tenant}} javascript
# The tenant specific config file, i.e. config.tenant.environment.json, becomes plain config.json
run: |
ls -la ${{ github.workspace }}/metrics-app-${{matrix.tenant}}/javascript/src
- name: Share artifact inside workflow (frontend)
uses: actions/upload-artifact@v3
with:
name: react-application
path: |
${{ github.workspace }}/metrics-app-${{matrix.tenant}}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: |
cd ${{ github.workspace }}/metrics-app-${{matrix.tenant}}/javascript; npm install
- name: Build React application
run: |
cd ${{ github.workspace }}/metrics-app-${{matrix.tenant}}/javascript; CI=false npm run build
# Share artifact inside workflow
- name: List files in the repository
run: |
ls ${{ github.workspace }}/metrics-app-${{matrix.tenant}}
- name: Create release branch
run: cd ${{ github.workspace }}/metrics-app-${{matrix.tenant}}/; git checkout -b ${{ env.RELEASE_ID }}
- name: Initialize mandatory git config
working-directory: ./metrics-app-${{matrix.tenant}}
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.RELEASE_ID }}
directory: ./metrics-app-${{matrix.tenant}}
- name: Share artifact inside workflow - ${{matrix.tenant}}
uses: actions/upload-artifact@v3
with:
name: react-github-actions-build-${{matrix.tenant}}
path: |
${{ github.workspace }}/metrics-app-${{matrix.tenant}}/javascript/build
${{ github.workspace }}/metrics-app-${{matrix.tenant}}/javascript/CHANGELOG.md
${{ github.workspace }}/metrics-app-${{matrix.tenant}}/CHANGELOG.md
- name: Share artifact inside workflow - backend
uses: actions/upload-artifact@v3
with:
name: react-github-actions-build-backend
path: |
${{ github.workspace }}/metrics-app-${{matrix.tenant}}/app
${{ github.workspace }}/metrics-app-${{matrix.tenant}}/requirements.txt
${{ github.workspace }}/metrics-app-${{matrix.tenant}}/CHANGELOG.md
- run: echo "🍏 This job's status is ${{ job.status }}."
frontend_release:
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.configure.outputs.matrix) }}
# We specify that deploys needs to
# finish before we create a release
# Job outputs are available to all downstream jobs that depend on this job.
needs: [checkout, configure]
steps:
# Download previously shared build
- name: Get artifact
uses: actions/download-artifact@v3
with:
path: ./metrics-app-${{matrix.tenant}}
name: react-github-actions-build-${{matrix.tenant}}
- name: List files
run: |
pwd
ls -la ./
ls -la ./metrics-app-${{matrix.tenant}}/
ls -la ./metrics-app-${{matrix.tenant}}/javascript
ls -la ./metrics-app-${{matrix.tenant}}/javascript/build
- name: Compress action step
uses: a7ul/[email protected]
id: compress
# The frontend release is only the javascript/build
# We need to include all the files and directories since
# the action is not smart enough to under asterisk (*)
with:
command: c
cwd: ./metrics-app-${{matrix.tenant}}/javascript/build
files: |
asset-manifest.json
index.html
static
outPath: frontend-${{matrix.tenant}}-release-build.tar.gz
# Upload as an artifact of the current workflow
- name: Upload frontend build zip artifact
uses: actions/upload-artifact@v1
with:
name: frontend-${{matrix.tenant}}-release-build.tar.gz
path: frontend-${{matrix.tenant}}-release-build.tar.gz
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "frontend-${{matrix.tenant}}-release-build.tar.gz"
bodyFile: "./metrics-app-${{matrix.tenant}}/javascript/CHANGELOG.md"
tag: "frontend-${{matrix.tenant}}-${{ github.ref_name }}-${{ env.RELEASE_ID }}"
makeLatest: true
generateReleaseNotes: true
backend_release:
runs-on: ubuntu-latest
# We specify that deploys needs to
# finish before we create a release
# Job outputs are available to all downstream jobs that depend on this job.
needs: [checkout, configure]
steps:
# Download previously shared build
- name: Get artifact
uses: actions/download-artifact@v3
with:
name: react-github-actions-build-backend
- name: Compress action step
uses: a7ul/[email protected]
id: compress
with:
command: c
cwd: ./
files: |
app/
requirements.txt
outPath: backend-release-build.tar.gz
- name: Upload backend build zip artifact
uses: actions/upload-artifact@v1
with:
name: backend-release-build.tar.gz
path: backend-release-build.tar.gz
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "backend-release-build.tar.gz"
bodyFile: "CHANGELOG.md"
tag: "metrics-api-${{ github.ref_name }}-${{ env.RELEASE_ID }}"
makeLatest: true
generateReleaseNotes: true
deploy_backend:
runs-on: ubuntu-latest
# We specify that deploys needs to
# finish before we create a release
needs: backend_release
steps:
- name: Download playbook
uses: actions/checkout@v3
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: 'rciam/rciam-deploy'
ref: 'master'
path: 'roles'
- name: Download inventory
uses: actions/checkout@v3
with:
repository: 'grnet/rciam-deploy-inv'
ref: 'master'
ssh-key: ${{ secrets.DEPLOY_READ_SECRET }}
path: 'inventory'
- name: Run playbook (deploy rciam-metrics) with release metrics-api-${{ github.ref_name }}-${{ env.RELEASE_ID }}
uses: dawidd6/action-ansible-playbook@v2
with:
# Required, playbook filepath
playbook: metricsservers.yml
# Optional, directory where playbooks live
directory: ./roles
key: ${{ secrets.DEPLOY_READ_SECRET }}
# Optional, encrypted vault password
vault_password: ${{secrets.VAULT_PASSWORD}}
options: |
--inventory ${{ github.workspace }}/inventory/rciam-metrics/hosts.ini
--tags rciam-metrics:deploy-backend
-u debian
--extra-vars "metrics_release=metrics-api-${{ github.ref_name }}-${{ env.RELEASE_ID }}"
deploy_frontend:
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.configure.outputs.matrix) }}
# We specify that deploys needs to
# finish before we create a release
# Job outputs are available to all downstream jobs that depend on this job.
needs: [frontend_release, configure]
steps:
- name: Download playbook
uses: actions/checkout@v3
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: 'rciam/rciam-deploy'
ref: 'master'
path: 'roles'
- name: Download inventory
uses: actions/checkout@v3
with:
repository: 'grnet/rciam-deploy-inv'
ref: 'master'
ssh-key: ${{ secrets.DEPLOY_READ_SECRET }}
path: 'inventory'
- name: Run playbook (deploy rciam-metrics) with release frontend-${{matrix.tenant}}-${{ github.ref_name }}-${{ env.RELEASE_ID }}
uses: dawidd6/action-ansible-playbook@v2
with:
# Required, playbook filepath
playbook: metricsservers.yml
# Optional, directory where playbooks live
directory: ./roles
key: ${{ secrets.DEPLOY_READ_SECRET }}
# Optional, encrypted vault password
vault_password: ${{secrets.VAULT_PASSWORD}}
options: |
--inventory ${{ github.workspace }}/inventory/rciam-metrics/hosts.ini
--tags rciam-metrics:deploy-frontend
-u debian
--extra-vars "metrics_release=frontend-${{matrix.tenant}}-${{ github.ref_name }}-${{ env.RELEASE_ID }} tenant_environment=${{matrix.tenant}}"
Loading
Loading