summaryrefslogtreecommitdiffstats
path: root/.circleci/config.yml
blob: 18d282917b3ccb942a981a4487972ddfc5611d12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# References:
# 1. https://circleci.com/blog/how-to-build-a-docker-image-on-circleci-2-0/
# 2. https://circleci.com/docs/2.0/building-docker-images/
#

version: 2
jobs:
  build:
    working_directory: /app
    docker:
      - image: docker:17.06.1-ce
        environment:
          BMO_IMAGE_NAME: mozillabteam/bmo
    steps:
      - setup_remote_docker
      - run:
          name: install git and ssh
          command: apk update && apk add git openssh-client
      - checkout
      - run: |
          docker build -t $BMO_IMAGE_NAME:$CIRCLE_BRANCH .
          if [[ -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]]; then
            docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
            docker push $BMO_IMAGE_NAME:$CIRCLE_BRANCH
          fi