Commit 314232ee authored by Olivia Madrid's avatar Olivia Madrid
Browse files

Merge branch 'master' of gitlab.com:minds/engine into epic/referrals

parents a161171d 10072639
Loading
Loading
Loading
Loading
+20 −22
Original line number Original line Diff line number Diff line
@@ -7,7 +7,7 @@ stages:
  - build
  - build
  - test
  - test
  - prepare
  - prepare
  - staging
  - review
  - deploy
  - deploy


cache:
cache:
@@ -49,48 +49,46 @@ prepare:runners:
    - docker build -t $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF -f containers/php-runners/Dockerfile .
    - docker build -t $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF -f containers/php-runners/Dockerfile .
    - docker push $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF
    - docker push $CI_REGISTRY_IMAGE/runners:$CI_BUILD_REF


staging:start:
review:start:
  stage: staging
  stage: review
  image: minds/helm-eks:latest
  image: minds/helm-eks:latest
  script:
  script:
    - aws eks update-kubeconfig --name=sandbox
    - 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
    - git clone --branch=sandbox-wip https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/minds/helm-charts.git
    - "helm upgrade \
    - "helm upgrade \
        --install \
        --install \
        --reuse-values \
        --reuse-values \
        --set phpfpm.image.repository=$CI_REGISTRY_IMAGE/fpm \
        --set phpfpm.image.repository=$CI_REGISTRY_IMAGE/fpm \
        --set phpfpm.image.tag=$CI_BUILD_REF \
        --set phpfpm.image.tag=$CI_BUILD_REF \
        --set domain=$STAGING_SUBDOMAIN.$STAGING_DOMAIN \
        --set runners.image.repository=$CI_REGISTRY_IMAGE/runners \
        --set elasticsearch.clusterName=$STAGING_SUBDOMAIN-elasticsearch \
        --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 \
        --wait \
        $STAGING_SUBDOMAIN \
        $CI_BUILD_REF_SLUG \
        ./helm-charts/minds"
        ./helm-charts/minds"
  only:
    variables:
      - $CI_COMMIT_MESSAGE =~ /-subdomain/
  environment:
  environment:
    name: staging
    name: review/$CI_COMMIT_REF_NAME
    url: https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
    on_stop: review:stop
  except: 
  except: 
    refs:
    refs:
      - master
      - master
      - test/gitlab-ci
      - test/gitlab-ci


staging:stop:
review:stop:
  stage: staging
  stage: review
  image: minds/helm-eks:latest
  image: minds/helm-eks:latest
  script:
  script:
    - aws eks update-kubeconfig --name=sandbox
    - aws eks update-kubeconfig --name=sandbox
    - STAGING_SUBDOMAIN=$(echo $CI_COMMIT_MESSAGE | sed -n 's/.* -subdomain=\([^ ]*\).*/\1/p')
    - helm del --purge $CI_BUILD_REF_SLUG
    - echo "TODO tear down $STAGING_SUBDOMAIN"
    - helm del --purge $STAGING_SUBDOMAIN
  when: manual
  only:
    variables:
      - $CI_COMMIT_MESSAGE =~ /-subdomain/
  environment:
  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: 
  except: 
    refs:
    refs:
      - master
      - master
+6 −6
Original line number Original line Diff line number Diff line
@@ -94,11 +94,11 @@ class MissedSinceLogin implements EmailBatchInterface
            ->setValue(true)
            ->setValue(true)
            ->setOffset($this->offset);
            ->setOffset($this->offset);


        $blogs = $this->getTrendingBlogs();
        //$blogs = $this->getTrendingBlogs();


        $i = 0;
        $i = 0;
        foreach ($iterator as $user) {
        foreach ($iterator as $user) {
            $user = new \Minds\Entities\User('ottman');
            $user = new \Minds\Entities\User('mark');
            ++$i;
            ++$i;
            echo "\n[$i]: $user->guid ($iterator->offset)";
            echo "\n[$i]: $user->guid ($iterator->offset)";


@@ -107,13 +107,13 @@ class MissedSinceLogin implements EmailBatchInterface
            //    return true;
            //    return true;
            //}
            //}


            $campaign = new Campaigns\WithBlogs();
            $campaign = new Campaigns\MissedSinceLogin();


            $campaign
            $campaign
                ->setUser($user)
                ->setUser($user)
                //->setTemplateKey($this->templatePath)
                ->setTemplateKey($this->templatePath)
                //->setSubject($this->subject)
                ->setSubject($this->subject)
                ->setBlogs($blogs)
                //->setBlogs($blogs)
                ->send();
                ->send();


            echo ' sent';
            echo ' sent';
+1 −1
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ class MissedSinceLogin extends EmailCampaign
        $this->template->setTemplate('default.tpl');
        $this->template->setTemplate('default.tpl');


        $this->template->setBody("./Templates/$this->templateKey.tpl");
        $this->template->setBody("./Templates/$this->templateKey.tpl");
        $this->template->toggleMarkdown(true);


        $this->template->set('user', $this->user);
        $this->template->set('user', $this->user);
        $this->template->set('username', $this->user->username);
        $this->template->set('username', $this->user->username);
@@ -75,7 +76,6 @@ class MissedSinceLogin extends EmailCampaign


        $this->template->set('entities', $this->entities);
        $this->template->set('entities', $this->entities);


        $this->user = new \Minds\Entities\User('jack');
        $message = new Message();
        $message = new Message();
        $message->setTo($this->user)
        $message->setTo($this->user)
            ->setMessageId(implode('-',
            ->setMessageId(implode('-',
+8 −0
Original line number Original line Diff line number Diff line
Please login to check your token balance. Remember, 1 token = 1,000 extra views on the content of your choice by using [Boost](https://www.minds.com/boost?__e_ct_guid=<?= $vars['guid']?>&campaign=<?= $vars['campaign']?>&topic=<?= $vars['topic'] ?>&validator=<?= $vars['validator']?>). You can also send tokens to your favourite channels to support them.

| |
|:--:|
| [![Read More](https://cdn-assets.minds.com/emails/view-balance.png){=150x}](https://ndl.minds.com/wallet/tokens/transactions?__e_ct_guid=<?= $vars['guid']?>&campaign=<?= $vars['campaign']?>&topic=<?= $vars['topic'] ?>&validator=<?= $vars['validator']?>){=50x} |
| |

Thank you for your contribution!
+2 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,8 @@ class Manager
        'uber-mail.com',
        'uber-mail.com',
        'mailmetal.com',
        'mailmetal.com',
        'email-24x7.com',
        'email-24x7.com',
        'getsimpleemail.com',
        'mailsoul.com',
    ];
    ];


    public function __construct($service = null, $spamBlocksManager = null)
    public function __construct($service = null, $spamBlocksManager = null)
Loading