Skip to content

Commit

Permalink
Configure GA
Browse files Browse the repository at this point in the history
  • Loading branch information
proAlexandr committed Jun 22, 2019
1 parent 396481c commit 924eafd
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 13 deletions.
19 changes: 17 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ trigger:
branch: release
steps:
- name: build-dist
image: node:10.8
image: node:10.16
environment:
GH_TOKEN:
from_secret: gh_token
SENTRY_DSN:
from_secret: sentry_dsn
GA_TRACKING_ID:
from_secret: ga_tracking_id
commands:
- npm install
- npm run build:dist
Expand All @@ -50,16 +57,24 @@ steps:
environment:
GH_TOKEN:
from_secret: gh_token
SENTRY_DSN:
from_secret: sentry_dsn
GA_TRACKING_ID:
from_secret: ga_tracking_id
commands:
- npm run build:target -- --win -p always
depends_on:
- build-dist

- name: build-target-linux
image: node:10.8
image: node:10.16
environment:
GH_TOKEN:
from_secret: gh_token
SENTRY_DSN:
from_secret: sentry_dsn
GA_TRACKING_ID:
from_secret: ga_tracking_id
commands:
- npm run build:target -- --linux -p always
depends_on:
Expand Down
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
SENTRY_DSN=https://[email protected]/1468974
WEB_DEMO_MODE=false
GA_TRACKING_ID=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ thumbs.db
!.gitkeep
sentry.properties
.env
.env.production
__diff_output__
cypress/screenshots
cypress/videos
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
</a>
</p>

[Official Site](https://kube-forwarder.pixelpoint.io)

Easy to use Kubernetes port forwarding management.
Built with [Electron](https://electronjs.org)

Expand Down Expand Up @@ -56,6 +58,10 @@ git clone https://github.com/<your-username>/kube-forwarder
# install dependencies
npm install
# prepare .env files
cp .env.example .env
cp .env.example .env.production
# serve with hot reload in Electron Dev app
npm run dev
Expand Down Expand Up @@ -109,12 +115,13 @@ npm run test:cypress:open

## Release guide

1) Update the version in `package.json`.
2) Push to `release` branch. [Drone(pixel-point/kube-forwarder)](https://drone.pixelpoint.io/pixel-point/kube-forwarder/)
1) Be sure that you created `.env.production` and filled it in the right way.
2) Update the version in `package.json`.
3) Push to `release` branch. [Drone(pixel-point/kube-forwarder)](https://drone.pixelpoint.io/pixel-point/kube-forwarder/)
will build packages for Windows and Linux and upload them to [releases](https://github.com/pixel-point/kube-forwarder/releases)
3) Run `npm run release` on a Mac computer to build `.dmg` target.
4) Run `npm run release` on a Mac computer to build `.dmg` target.
It will be automatically pushed to releases at Github.
4) Go to [Releases](https://github.com/pixel-point/kube-forwarder/releases) in the repository.
5) Go to [Releases](https://github.com/pixel-point/kube-forwarder/releases) in the repository.
Make sure that the created draft is OK and release it (Edit -> Release).

Notes:
Expand All @@ -123,7 +130,7 @@ Notes:
2) A release tag (for example: `v1.0.3`) will be added automatically
by Github when you release your draft.

## Tips
## Development Tips

Use `tiffutil -cathidpicheck bg.png [email protected] -out bg.tiff` to build a tiff
background for .DMG
Expand Down
2 changes: 1 addition & 1 deletion env.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const dotEnv = require('dotenv-safe')
if (!process.env.CI) dotEnv.load()
dotEnv.load({ path: '.env.production', allowEmptyValues: true })
3 changes: 3 additions & 0 deletions src/renderer/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Analytics from 'electron-ga'

export default new Analytics(process.env.GA_TRACKING_ID)
4 changes: 1 addition & 3 deletions src/renderer/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ configureSentry({ Vue })
import App from './App'
import router from './router'
import store from './store'
import Analytics from 'electron-ga'
import './analytics'
/* eslint-enable import/first */

window.ga = new Analytics(process.env.GA_TRACKING_ID)

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.config.productionTip = false

Expand Down
18 changes: 17 additions & 1 deletion src/renderer/router/index.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
import Vue from 'vue'
import Router from 'vue-router'

import analytics from '../analytics'

Vue.use(Router)

export default new Router({
const router = new Router({
mode: 'history',
routes: [
{
path: '/',
component: require('@/components/Layout').default,
children: [
{
name: 'Clusters',
path: '',
component: require('@/components/Clusters').default
},
{
name: 'Cluster New',
path: 'clusters/new',
component: require('@/components/ClusterNew').default
},
{
name: 'Cluster Import',
path: 'clusters/import',
component: require('@/components/ClusterImport').default
},
{
name: 'Cluster Edit',
path: 'clusters/:id/edit',
component: require('@/components/ClusterEdit').default
},
{
name: 'Service New',
path: 'clusters/:clusterId/services/new',
component: require('@/components/ServiceForm').default
},
{
name: 'Service Edit',
path: 'clusters/:clusterId/services/:id/edit',
component: require('@/components/ServiceEdit').default
},
{
name: 'Service Clone',
path: 'clusters/:clusterId/services/:id/clone',
component: require('@/components/ServiceClone').default
}
Expand All @@ -48,3 +58,9 @@ export default new Router({
return { x: 0, y: 0 }
}
})

router.afterEach((to, from) => {
analytics.send('screenview', { cd: to.name })
})

export default router

0 comments on commit 924eafd

Please sign in to comment.