Skip to content

Commit

Permalink
[infra] chore: configure the front end's assetlinks.json
Browse files Browse the repository at this point in the history
  • Loading branch information
GresilleSiffle committed Jan 25, 2025
1 parent a7457b1 commit 0ed2b4f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/public/.well-known/assetlinks.tournesol.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "app.tournesol.twa",
"sha256_cert_fingerprints": ["27:C5:B9:36:69:2E:5A:46:96:50:4A:3F:BB:65:A1:44:BE:46:6D:CC:93:0E:BE:18:70:EF:80:2D:DC:87:BC:8E"]
}
}]
13 changes: 13 additions & 0 deletions infra/ansible/roles/frontend/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
become: yes
become_user: react

- name: Check assetlinks.json
stat:
path: "/home/react/tournesol-frontend/public/.well-known/assetlinks.{{ domain_name }}.json"
register: assetlinks_file

- name: Copy assetlinks.json
file:
src: "/home/react/tournesol-frontend/public/.well-known/assetlinks.{{ domain_name }}.json"
dest: /home/react/tournesol-frontend/public/.well-known/assetlinks.json
when: assetlinks_file.stat.exists
become: yes
become_user: react

- name: Yarn build
shell:
cmd: . ~/.nvm/nvm.sh && NVM_DIR=/home/react/.nvm nvm use lts/{{npm_lts_version}} && yarn build
Expand Down
6 changes: 6 additions & 0 deletions infra/ansible/roles/frontend/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
notify:
- Install Node
- Yarn install
- Check assetlinks.json
- Copy assetlinks.json
- Yarn build
- Copy frontend files
- Create Frontend OAuth application in Django database
Expand Down Expand Up @@ -83,6 +85,8 @@
become_user: react
notify:
- Yarn install
- Check assetlinks.json
- Copy assetlinks.json
- Yarn build
- Generate Client from OpenAPI Specification
- Copy frontend files
Expand All @@ -96,6 +100,8 @@
group: react
notify:
- Yarn install
- Check assetlinks.json
- Copy assetlinks.json
- Yarn build
- Generate Client from OpenAPI Specification
- Copy frontend files
Expand Down

0 comments on commit 0ed2b4f

Please sign in to comment.