Skip to content

Commit 5e5ab5c

Browse files
authored
Merge pull request #25 from MITLibraries/INFRA-526
INFRA-526 and WEB-2064: Update to 5.3.2 and enable TagManager
2 parents d847de6 + cb34c66 commit 5e5ab5c

File tree

6 files changed

+43
-38
lines changed

6 files changed

+43
-38
lines changed

.github/workflows/dev-build.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
### This is the Terraform-generated dev-build.yml workflow for the ###
22
### docker-matomo-dev app repository. ###
3-
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the ###
4-
### document. If the container requires any additional pre-build commands, ###
5-
### uncomment and edit the PREBUILD line at the end of the document. ###
63
name: Dev Container Build and Deploy
4+
5+
# checkov:skip=CKV2_GHA_1:The shared workflow contains the permissions constraints
6+
# NOTE: The above checkov skip command doesn't actually work and this workflow
7+
# will always show a checkov warning.
78
on:
89
workflow_dispatch:
910
pull_request:
@@ -12,21 +13,12 @@ on:
1213
paths-ignore:
1314
- '.github/**'
1415

15-
permissions: read-all
16-
1716
jobs:
1817
deploy:
19-
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
20-
permissions:
21-
id-token: write
22-
contents: read
23-
2418
name: Dev Container Deploy
25-
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-dev.yml@main
19+
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-dev.yml@INFRA-526
2620
secrets: inherit
2721
with:
2822
AWS_REGION: "us-east-1"
2923
GHA_ROLE: "docker-matomo-gha-dev"
3024
ECR: "docker-matomo-dev"
31-
# FUNCTION: ""
32-
# PREBUILD:

.github/workflows/prod-promote.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
### This is the Terraform-generated prod-promote.yml workflow for the ###
22
### docker-matomo-prod repository. ###
3-
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the ###
4-
### document. ###
3+
54
name: Prod Container Promote
5+
6+
# checkov:skip=CKV2_GHA_1:The shared workflow contains the permissions constraints
7+
# NOTE: The above checkov skip command doesn't actually work and this workflow
8+
# will always show a checkov warning.
9+
610
on:
711
workflow_dispatch:
812
release:
913
types: [published]
1014

11-
permissions: read-all
12-
1315
jobs:
1416
deploy:
15-
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
16-
permissions:
17-
id-token: write
18-
contents: read
19-
2017
name: Prod Container Promote
21-
uses: mitlibraries/.github/.github/workflows/ecr-shared-promote-prod.yml@main
18+
uses: mitlibraries/.github/.github/workflows/ecr-shared-promote-prod.yml@INFRA-526
2219
secrets: inherit
2320
with:
2421
AWS_REGION: "us-east-1"

.github/workflows/stage-build.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
### This is the Terraform-generated dev-build.yml workflow for the ###
22
### docker-matomo-stage app repository. ###
3-
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the ###
4-
### document. If the container requires any additional pre-build commands, ###
5-
### uncomment and edit the PREBUILD line at the end of the document. ###
63
name: Stage Container Build and Deploy
4+
5+
# checkov:skip=CKV2_GHA_1:The shared workflow contains the permissions constraints
6+
# NOTE: The above checkov skip command doesn't actually work and this workflow
7+
# will always show a checkov warning.
8+
79
on:
810
workflow_dispatch:
911
push:
@@ -12,21 +14,13 @@ on:
1214
paths-ignore:
1315
- '.github/**'
1416

15-
permissions: read-all
16-
1717
jobs:
1818
deploy:
19-
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
20-
permissions:
21-
id-token: write
22-
contents: read
23-
2419
name: Stage Container Deploy
25-
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-stage.yml@main
20+
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-stage.yml@INFRA-526
2621
secrets: inherit
2722
with:
2823
AWS_REGION: "us-east-1"
2924
GHA_ROLE: "docker-matomo-gha-stage"
3025
ECR: "docker-matomo-stage"
31-
# FUNCTION: ""
32-
# PREBUILD:
26+

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM matomo:5.3.1
1+
FROM matomo:5.3.2
22
# checkov:skip=CKV_DOCKER_2:Skipping HEALTHCHECK configuration for now
3-
# checkov:skip=CKV_DOCKER_3:Intentionally using root for the user
3+
# checkov:skip=CKV_DOCKER_3:The container actually runs as www-data user
44

55
# Add the EnvironmentVariables plugin
66
COPY ./files/plugin-EnvironmentVariables-5.0.3/ /var/www/html/plugins/EnvironmentVariables
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# TagManager core plugin activation
2+
3+
Turns out that the TagManager core plugin needs some extra care and attention if it wasn't initially enabled when first starting with Matomo. Attempting to activate it the usual way causes Matomo to break.
4+
5+
This GitHub Issue documents that problem and provides a simple (but strange) solution:
6+
7+
* [Issue: Can't install TagManager plugin because table _tagmanager_container is missing](https://github.com/matomo-org/matomo/issues/19474)
8+
9+
For our container-based deploy, this means
10+
11+
1. connect to the running container
12+
1. ensure that a simple text editor is available in the container
13+
1. deactivate the TagManager plugin: `./console plugin:deactivate TagManager`
14+
1. edit the config/config.ini.php file to remove the `PluginsInstalled[] = "TagManager"` line
15+
1. run the `core:update` command: `./console core:update` (nothing should happen)
16+
1. activate the TagManager plugin: `./console plugin:activate TagManager`
17+
1. run the `core:update` command again: `./console core:update` (nothing should happen)
18+
19+
The appropriate updates to the database will now be in place.
20+
21+
At this point, proceed with updates to this repository by updating the `config.ini.php` file to match the file from the container.

files/config.ini.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
Plugins[] = "CustomDimensions"
9797
Plugins[] = "FeatureFlags"
9898
Plugins[] = "MobileAppMeasurable"
99+
Plugins[] = "TagManager"
99100
Plugins[] = "CustomVariables"
100101
Plugins[] = "EnvironmentVariables"
101102
Plugins[] = "HeatmapSessionRecording"

0 commit comments

Comments
 (0)