Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .aws-architecture
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/amd64
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# No ENV files
.env

# No VSCode files
.vscode

# No special macOS files
**/.DS_Store
temp/

# No temp directory
temp/

# No asdf files
.tool-versions

# No cpu architecture temp file
.arch_tag
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
FROM matomo:5.10.1
FROM matomo:5.12.0
# checkov:skip=CKV_DOCKER_2:Skipping HEALTHCHECK configuration for now
# checkov:skip=CKV_DOCKER_3:The container actually runs as www-data user

## begin Free plugins
# Add the EnvironmentVariables plugin
COPY ./files/plugin-EnvironmentVariables-5.0.3/ /var/www/html/plugins/EnvironmentVariables

# Add the CustomVariables plugin
COPY ./files/plugin-CustomVariables-5.0.6/ /var/www/html/plugins/CustomVariables
## end Free plugins

# Add the HeatmapSessionRecording plugin
COPY ./files/plugin-HeatmapSessionRecording-5.3.5/ /var/www/html/plugins/HeatmapSessionRecording
## begin Premium (e.g., paid) plugins linked to our license code
# Add the CustomReports plugin
COPY ./files/plugin-CustomReports-5.5.0/ /var/www/html/plugins/CustomReports

# Add the UsersFlow plugin
COPY ./files/plugin-UsersFlow-5.0.9/ /var/www/html/plugins/UsersFlow
# Add the HeatmapSessionRecording plugin
COPY ./files/plugin-HeatmapSessionRecording-5.6.0/ /var/www/html/plugins/HeatmapSessionRecording

# Add the SearchEngineKeywordsPerformance plugin
COPY ./files/plugin-SearchEngineKeywordsPerformance-5.0.29/ /var/www/html/plugins/SearchEngineKeywordsPerformance
COPY ./files/plugin-SearchEngineKeywordsPerformance-5.2.1/ /var/www/html/plugins/SearchEngineKeywordsPerformance

# Add the CustomReports plugin
COPY ./files/plugin-CustomReports-5.4.10/ /var/www/html/plugins/CustomReports
# Add the UsersFlow plugin
COPY ./files/plugin-UsersFlow-5.1.1/ /var/www/html/plugins/UsersFlow
## end Premium plugins

# Our custom configuration settings.
COPY ./files/config.ini.php /var/www/html/config/config.ini.php
Expand Down
51 changes: 41 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SHELL=/bin/bash
### and review the other commented lines in the document. ###
ECR_NAME_DEV:=docker-matomo-dev
ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/docker-matomo-dev
CPU_ARCH ?= $(shell cat .aws-architecture 2>/dev/null || echo "linux/amd64")
# FUNCTION_DEV:=
### End of Terraform-generated header ###

Expand All @@ -13,14 +14,44 @@ help: ## Print this message
/^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)

### Terraform-generated Developer Deploy Commands for Dev environment ###
dist-dev: ## Build docker container (intended for developer-based manual build)
docker build \
--platform linux/amd64 \
-t $(ECR_URL_DEV):latest \
-t $(ECR_URL_DEV):`git describe --always` \
-t $(ECR_NAME_DEV):latest .
check-arch:
@ARCH_FILE=".aws-architecture"; \
if [[ "$(CPU_ARCH)" != "linux/amd64" && "$(CPU_ARCH)" != "linux/arm64" ]]; then \
echo "Invalid CPU_ARCH: $(CPU_ARCH)"; exit 1; \
fi; \
if [[ -f $$ARCH_FILE ]]; then \
echo "latest-$(shell echo $(CPU_ARCH) | cut -d'/' -f2)" > .arch_tag; \
else \
echo "latest" > .arch_tag; \
fi

publish-dev: dist-dev ## Build, tag and push (intended for developer-based manual publish)
docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1) $(ECR_URL_DEV)
docker push $(ECR_URL_DEV):latest
docker push $(ECR_URL_DEV):`git describe --always`
dist-dev: check-arch ## Build docker container (intended for developer-based manual build)
@ARCH_TAG=$$(cat .arch_tag); \
docker buildx inspect $(ECR_NAME_DEV) >/dev/null 2>&1 || docker buildx create --name $(ECR_NAME_DEV) --use; \
docker buildx use $(ECR_NAME_DEV); \
docker buildx build --platform $(CPU_ARCH) \
--load \
--tag $(ECR_URL_DEV):$$ARCH_TAG \
--tag $(ECR_URL_DEV):make-$$ARCH_TAG \
--tag $(ECR_URL_DEV):make-$(shell git describe --always) \
--tag $(ECR_NAME_DEV):$$ARCH_TAG \
.

publish-dev: dist-dev # Build, tag and push (intended for developer-based manual publish)
@ARCH_TAG=$$(cat .arch_tag); \
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(ECR_URL_DEV); \
docker push $(ECR_URL_DEV):$$ARCH_TAG; \
docker push $(ECR_URL_DEV):make-$$ARCH_TAG; \
docker push $(ECR_URL_DEV):make-$(shell git describe --always); \
echo "Cleaning up dangling Docker images..."; \
docker image prune -f --filter "dangling=true"

docker-clean: # Clean up Docker detritus
@ARCH_TAG=$$(cat .arch_tag); \
echo "Cleaning up Docker leftovers (containers, images, builders)"; \
docker rmi -f $(ECR_URL_DEV):$$ARCH_TAG; \
docker rmi -f $(ECR_URL_DEV):make-$$ARCH_TAG; \
docker rmi -f $(ECR_URL_DEV):make-$(shell git describe --always) || true; \
docker rmi -f $(ECR_NAME_DEV):$$ARCH_TAG || true; \
docker buildx rm $(ECR_NAME_DEV) || true
@rm -rf .arch_tag
2 changes: 1 addition & 1 deletion docs/HowTos/HOWTO-matomo-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ These instructions assume you are working in the **dev** environment. Change to
Often, an update to the version of Matomo will require an update to a plugin version. See below for an overview of the plugin update process.

1. Ensure that an out-of-band backup of the current `config/config.ini.php` exists
* SSH (via AWSCLI + Session Manager) to the container(see the [Troubleshooting](./HOWTO-miscellaneous.md) section for the AWS CLI connection command).
* SSH (via AWSCLI + Session Manager) to the container (see the [Troubleshooting](./HOWTO-miscellaneous.md) section for the AWS CLI connection command).
* Run `cp /var/www/html/config/* /mnt/efs/backup/config`
1. Visit [Matomo plugins](https://plugins.matomo.org), select the correct version of Matomo, and then search for the plugins that are currently in use in our instance of Matomo.
* If there is a newer version, download it from the site, unzip it, and store the unzipped folder in the [files/](../../files/) directory, following the naming convention in place (e.g., `plugin-<plugin_name>-<version>`)
Expand Down
Loading