diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1723b24..2e5c55a 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,77 +1,66 @@
-# Use the latest 2.1 version of CircleCI pipeline process engine.
-# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
-# Define a job to be invoked later in a workflow.
-# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build:
working_directory: /app
- # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: docker:17.05.0-ce-git
- environment:
- DOCKER_REGISTERY: tribeplatform/google-analytics
- # Add steps to the job
- # See: https://circleci.com/docs/2.0/configuration-reference/#steps
+ parameters:
+ registery:
+ type: string
steps:
- checkout
- - setup_remote_docker:
- version: 19.03.13
+ - setup_remote_docker
- run:
- name: 'Build application Docker image'
- command: docker build --cache-from=app -t app .
- - deploy:
- name: Push application Docker image
+ name: 'Build and deploy docker image'
command: |
+ docker build --cache-from=app -t app .
docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
- docker tag app "${DOCKER_REGISTERY}:${CIRCLE_SHA1}"
- docker push "${DOCKER_REGISTERY}:${CIRCLE_SHA1}"
+ docker tag app << parameters.registery >>:${CIRCLE_SHA1}
+ docker push << parameters.registery >>:${CIRCLE_SHA1}
publish-dev:
docker:
- - image: tribeplatform/tribecd:0.1.15
+ - image: tribeplatform/cli:1.0.0
auth:
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
environment:
DOCKER_REGISTERY: tribeplatform/google-analytics
- REVIEW_APP_NAME: google-analytics
- REVIEW_APP_ENV: development
- REVIEW_APP_REGION: us-east-1
- REVIEW_APP_IMAGE_URI: $DOCKER_REGISTERY:$CIRCLE_SHA1
steps:
- checkout
- run:
- name: 'Publish Image'
- command: tcdi -cu
+ name: 'Deploy app on DEV environment'
+ command: |
+ ops init -i -e ermia@bettermode.com -u $OPS_USERNAME -p $OPS_PASSWORD
+ ops app create -n google-analytics -i $DOCKER_REGISTERY:$CIRCLE_SHA1
+ ops service deploy -s google-analytics -i $DOCKER_REGISTERY:$CIRCLE_SHA1
publish-prod:
docker:
- - image: tribeplatform/tribecd:0.1.15
+ - image: tribeplatform/cli:1.0.0
auth:
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
environment:
DOCKER_REGISTERY: tribeplatform/google-analytics
- REVIEW_APP_NAME: google-analytics
- REVIEW_APP_ENV: production
- REVIEW_APP_REGION: us-east-1
- REVIEW_APP_IMAGE_URI: $DOCKER_REGISTERY:$CIRCLE_SHA1
steps:
- checkout
- run:
- name: 'Publish Image'
- command: tcdi -cu
-# Invoke jobs via workflows
-# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
+ name: 'Deploy app on PRD environment'
+ command: |
+ ops init -i -e ermia@bettermode.com -u $OPS_USERNAME -p $OPS_PASSWORD
+ ops app create -n google-analytics -i $DOCKER_REGISTERY:$CIRCLE_SHA1 -e prd
+ ops service deploy -s google-analytics -e prd -i $DOCKER_REGISTERY:$CIRCLE_SHA1
workflows:
- build_app:
+ app:
jobs:
- build:
+ registery: tribeplatform/google-analytics
context: App
filters:
branches:
only:
- master
+ - dev
- publish-dev:
context: App
requires:
@@ -80,10 +69,15 @@ workflows:
branches:
only:
- master
+ - dev
- hold:
type: approval
requires:
- build
+ filters:
+ branches:
+ only:
+ - master
- publish-prod:
context: App
requires:
diff --git a/custom_scripts/head.liquid b/custom_scripts/head.liquid
index b366a47..c497fe5 100644
--- a/custom_scripts/head.liquid
+++ b/custom_scripts/head.liquid
@@ -1,58 +1,152 @@
{%- if settings.measurementId and settings.measurementId.size > 0 -%}
{%- assign measurementChar = settings.measurementId | slice: 0 -%}
- {%- assign isNew = measurementChar == "G" -%}
+ {%- assign isNew = measurementChar = = "G" -%}
{%- if isNew -%}
-
- {%- endif -%} {%- unless isNew -%}
+ {%- endif -%}
+ {%- unless isNew -%}
{%- endunless -%}
{%- endif -%}
\ No newline at end of file