Skip to content

Commit 6521a23

Browse files
author
George Khoury
authored
Merge pull request #74 from jordanopensource/task/add_matomo
Task/add matomo
2 parents 43817f9 + bd54504 commit 6521a23

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

.drone.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ steps:
1515
image: plugins/docker
1616
settings:
1717
repo: josaorg/contributions-web
18+
build_args:
19+
[
20+
CONTRIBUTIONS_API_URL=https://contributions.api.dev.josa.ngo,
21+
MATOMO_SITE_ID=11,
22+
]
1823
tags:
1924
- ${DRONE_COMMIT_SHA}
2025
- latest

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG CONTRIBUTIONS_API_URL=https://contributions.api.dev.josa.ngo HOST=0.0.0.0 PORT=3000 USER=node
1+
ARG CONTRIBUTIONS_API_URL=https://contributions.api.dev.josa.ngo HOST=0.0.0.0 PORT=3000 USER=node MATOMO_SITE_ID=11
22

33
###########
44
# BUILDER #
@@ -8,14 +8,15 @@ FROM node:16-alpine3.14 as builder
88
ARG CONTRIBUTIONS_API_URL
99
ARG HOST
1010
ARG PORT
11+
ARG MATOMO_SITE_ID
1112

1213
# copy build context and install dependencies
1314
WORKDIR /workspace
1415
COPY . .
1516
RUN npm install
1617

1718
# Inject the enviromental variables
18-
ENV CONTRIBUTIONS_API_URL=${CONTRIBUTIONS_API_URL} HOST=${HOST} PORT=${PORT}
19+
ENV CONTRIBUTIONS_API_URL=$CONTRIBUTIONS_API_URL HOST=$HOST PORT=$PORT MATOMO_SITE_ID=$MATOMO_SITE_ID
1920

2021
# build NuxtJS project
2122
RUN npm run build:modern
@@ -29,6 +30,7 @@ ARG CONTRIBUTIONS_API_URL
2930
ARG HOST
3031
ARG PORT
3132
ARG USER
33+
ARG MATOMO_SITE_ID
3234

3335
# copy builder output to project workdir
3436
WORKDIR /app
@@ -38,7 +40,7 @@ COPY --from=builder --chown=${USER}:${USER} /workspace/node_modules /app/node_mo
3840
COPY --from=builder --chown=${USER}:${USER} /workspace/package.json /app/
3941

4042
# Inject the enviromental variables
41-
ENV CONTRIBUTIONS_API_URL=${CONTRIBUTIONS_API_URL} HOST=${HOST} PORT=${PORT}
43+
ENV CONTRIBUTIONS_API_URL=$CONTRIBUTIONS_API_URL HOST=$HOST PORT=$PORT MATOMO_SITE_ID=$MATOMO_SITE_ID
4244

4345
# set user context
4446
USER ${USER}

nuxt.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export default {
3939

4040
// Modules: https://go.nuxtjs.dev/config-modules
4141
modules: [
42+
[
43+
'nuxt-matomo',
44+
{ matomoUrl: '//track.josa.ngo/', siteId: process.env.MATOMO_SITE_ID },
45+
],
4246
// https://go.nuxtjs.dev/axios
4347
'@nuxtjs/axios',
4448
// https://go.nuxtjs.dev/pwa
@@ -58,6 +62,7 @@ export default {
5862

5963
publicRuntimeConfig: {
6064
CONTRIBUTIONS_API_URL: process.env.CONTRIBUTIONS_API_URL,
65+
siteID: process.env.MATOMO_SITE_ID,
6166
},
6267

6368
healthcheck: {

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"core-js": "^3.15.1",
2121
"nuxt": "^2.15.8",
2222
"nuxt-healthcheck": "^1.0.1",
23+
"nuxt-matomo": "^1.2.4",
2324
"vue-apexcharts": "^1.6.2",
2425
"vue-lazy-hydration": "^2.0.0-beta.4"
2526
},

0 commit comments

Comments
 (0)