Skip to content

Commit 3dffa37

Browse files
authored
Merge pull request #4182 from Ark74/upd_site_code
[code] update fetch page and download url for new codg hosting changes.
2 parents 8cd0636 + 2f8a280 commit 3dffa37

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

.github/workflows/tests/expected_state_medium.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ awstats_installed: True
2424
matomo_installed: True
2525
captiveportal_installed: True
2626
calibreweb_installed: True
27+
code_installed: True

roles/code/defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# 64-bit support for now, leaving room for future 32-bit support.
33

44
# URL & Regular Expressions
5-
code_download_url: https://appdevforall.org/apk_repo
5+
code_fetch_apk_url: https://www.appdevforall.org/codeonthego
6+
code_download_url: https://download.appdevforall.org
67
code_apk_32bit_pattern: "CodeOnTheGo-.*?armv7a\\.apk"
78
code_apk_64bit_pattern: "CodeOnTheGo-.*?armv8a\\.apk"
89

roles/code/tasks/install.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
when: code_apk_release_name is undefined
2222
block:
2323

24-
- name: Fetch APK index page from {{ code_download_url }}/
24+
- name: Fetch APK index page from {{ code_fetch_apk_url }}/
2525
uri:
26-
url: "{{ code_download_url }}/"
26+
url: "{{ code_fetch_apk_url }}/"
2727
return_content: true
2828
register: apk_index
29-
failed_when: apk_index.status != 200 and apk_index.status != 403
29+
failed_when: apk_index.status not in [200, 403, 404]
3030

3131
- name: Mark 'code' role as blocked by CDN
3232
set_fact:
@@ -68,6 +68,7 @@
6868
| regex_findall(code_apk_64bit_pattern)
6969
| sort
7070
| last
71+
| default('')
7172
}}
7273
when: code_blocked_by_cdn is undefined
7374

@@ -79,12 +80,19 @@
7980
| regex_findall(code_apk_32bit_pattern)
8081
| sort
8182
| last
83+
| default('')
8284
}}
8385
when: code_blocked_by_cdn is undefined
8486

87+
- name: Fail if no apk is found on fetched page.
88+
fail:
89+
msg: Could not find expected APK link in page. (Status = {{ apk_index.status }})
90+
when: code_apk_64bit_filename | length == 0
91+
#ignore_errors: yes
92+
8593
- name: Get CodeOnTheGo version number
8694
set_fact:
87-
cotg_version: "{{ code_apk_64bit_filename | regex_search('CodeOnTheGo-release([0-9.]+)', '\\1') }}"
95+
cotg_version: "{{ (code_apk_64bit_filename | regex_findall('CodeOnTheGo-release([0-9]+(?:\\.[0-9]+)*)') | first) }}"
8896
when: code_blocked_by_cdn is undefined
8997

9098
- name: "Show resolved APK release name"

roles/code/templates/content/en.md.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ If you want to get details about the latest release; please visit [https://www.a
4949

5050
Find some useful resources online to interact with the community of users and developers behind Code on the Go.
5151

52-
- [Online APK repo](https://appdevforall.org/apk_repo/)
53-
- [Repo archive](https://appdevforall.org/apk_repo/archive/)
52+
- [Online Release Website](https://www.appdevforall.org/codeonthego/)
5453
- [GitHub Issues page](https://github.com/appdevforall/CodeOnTheGo/issues)
5554
- [Telegram Official Channel](https://t.me/CodeOnTheGoOfficial)
5655
- [Telegram Discussion Group](https://t.me/CodeOnTheGoDiscussions)

roles/code/templates/content/es.md.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ Si desea conocer los detalles acerca de la versión mas reciente; por favor visi
4848

4949
Encuentre algunos recursos útiles en línea para interactuar con la comunidad de usuarios y desarrolladores detrás de Code on the Go.
5050

51-
- [Repositorio APK en línea](https://appdevforall.org/apk_repo/)
52-
- [Archivo del repositorio](https://appdevforall.org/apk_repo/archive/)
51+
- [Página en línea de Publicaciones](https://www.appdevforall.org/codeonthego/)
5352
- [Pagina de Incidencias de GitHub](https://github.com/appdevforall/CodeOnTheGo/issues)
5453
- [Canal Oficial de Telegram](https://t.me/CodeOnTheGoOfficial)
5554
- [Grupo de Discusión de Telegram](https://t.me/CodeOnTheGoDiscussions)

0 commit comments

Comments
 (0)