machine:
  services:
    - docker
  environment:
    BLOG_DIR: $HOME/$CIRCLE_PROJECT_REPONAME/blog
    PATH: ~/.local/bin:$PATH

dependencies:
  cache_directories:
    - ~/.local  # Not in use at this moment

test:
  override:
    - cd $BLOG_DIR; docker build -t blog.mahata.org .

deployment:
  deploy:
    branch: master
    commands:
      - export TODAY=$(date "+%Y%m%d")
      - cd $BLOG_DIR; docker tag blog.mahata.org mahata/blog.mahata.org:$(echo $TODAY)
      - cd $BLOG_DIR; docker login -u $DOCKERHUB_USER -e $DOCKERHUB_EMAIL -p $DOCKERHUB_PASS
      - cd $BLOG_DIR; docker push mahata/blog.mahata.org:$(echo $TODAY)

machine:
  services:
    - docker
  environment:
    BLOG_DIR: $HOME/$CIRCLE_PROJECT_REPONAME/blog
    PATH: ~/.local/bin:$PATH

dependencies:
  cache_directories:
    - ~/.local  # Not in use at this moment

deployment:
  deploy:
    branch: master
    commands:
      - export TODAY=$(date "+%Y%m%d")
      - cd $BLOG_DIR; docker build -t blog.mahata.org .
      - cd $BLOG_DIR; docker tag blog.mahata.org mahata/blog.mahata.org:$(echo $TODAY)
      - cd $BLOG_DIR; docker login -u $DOCKERHUB_USER -e $DOCKERHUB_EMAIL -p $DOCKERHUB_PASS
      - cd $BLOG_DIR; docker push mahata/blog.mahata.org:$(echo $TODAY)

Modify CircleCI so that an environment variable is generated in deployment section
Modify CircleCI so that an environment variable is generated in deployment section
