...
 
Commits (7)
......@@ -7,7 +7,7 @@ stages:
- build
- test
- prepare
- staging
- review
- deploy
cache:
......@@ -49,48 +49,46 @@ prepare:runners:
- docker build -t $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF -f containers/php-runners/Dockerfile .
- docker push $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF
staging:start:
stage: staging
review:start:
stage: review
image: minds/helm-eks:latest
script:
- aws eks update-kubeconfig --name=sandbox
- STAGING_SUBDOMAIN=$(echo $CI_COMMIT_MESSAGE | sed -n 's/.* -subdomain=\([^ ]*\).*/\1/p')
- echo "Subdomain will be setup at $STAGING_SUBDOMAIN"
- git clone --branch=sandbox-wip https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/minds/helm-charts.git
- "helm upgrade \
--install \
--reuse-values \
--set phpfpm.image.repository=$CI_REGISTRY_IMAGE/fpm \
--set phpfpm.image.tag=$CI_BUILD_REF \
--set domain=$STAGING_SUBDOMAIN.$STAGING_DOMAIN \
--set elasticsearch.clusterName=$STAGING_SUBDOMAIN-elasticsearch \
--set runners.image.repository=$CI_REGISTRY_IMAGE/runners \
--set runners.image.tag=$CI_BUILD_REF \
--set domain=$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN \
--set elasticsearch.clusterName=$CI_BUILD_REF_SLUG-elasticsearch \
--wait \
$STAGING_SUBDOMAIN \
$CI_BUILD_REF_SLUG \
./helm-charts/minds"
only:
variables:
- $CI_COMMIT_MESSAGE =~ /-subdomain/
environment:
name: staging
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
on_stop: review:stop
except:
refs:
- master
- test/gitlab-ci
staging:stop:
stage: staging
review:stop:
stage: review
image: minds/helm-eks:latest
script:
- aws eks update-kubeconfig --name=sandbox
- STAGING_SUBDOMAIN=$(echo $CI_COMMIT_MESSAGE | sed -n 's/.* -subdomain=\([^ ]*\).*/\1/p')
- echo "TODO tear down $STAGING_SUBDOMAIN"
- helm del --purge $STAGING_SUBDOMAIN
when: manual
only:
variables:
- $CI_COMMIT_MESSAGE =~ /-subdomain/
- helm del --purge $CI_BUILD_REF_SLUG
environment:
name: staging
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
action: stop
variables:
GIT_STRATEGY: none
when: manual
except:
refs:
- master
......
......@@ -30,6 +30,8 @@ class Manager
'uber-mail.com',
'mailmetal.com',
'email-24x7.com',
'getsimpleemail.com',
'mailsoul.com',
];
public function __construct($service = null, $spamBlocksManager = null)
......
......@@ -50,6 +50,10 @@ class Counters
*/
public function getCount(array $options = [])
{
// return Helpers\Counters::get($this->user, 'notifications:count', false);
// TODO: Remove below once settled
$query = "SELECT uuid, read_timestamp FROM notifications
WHERE to_guid = ?
ORDER BY created_timestamp DESC
......@@ -86,7 +90,7 @@ class Counters
*/
public function increaseCounter()
{
//Helpers\Counters::increment($this->user, 'notifications:count');
Helpers\Counters::increment($this->user, 'notifications:count');
}
/**
......@@ -96,6 +100,10 @@ class Counters
*/
public function resetCounter()
{
Helpers\Counters::clear($this->user, 'notifications:count');
// TODO: Remove below once settled
$query = "BEGIN;
UPDATE notifications
SET read_timestamp = NOW()
......