
version: 2
jobs:

  build:

    docker:
      - image: circleci/node:8

    steps:
      - checkout
      - setup_remote_docker

      - run:
          name: Install Docker client
          command: |
            set -x
            VER="18.06.1-ce"
            sudo curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
            sudo tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            sudo mv /tmp/docker/* /usr/bin
            echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

      - run:
          command: |
            versions=( "4.3.1" "4.3.2" "4.3.3" )
            for VERSION in "${versions[@]}"
            do
              echo "Building for Nagios $VERSION"
              docker build --build-arg VERSION=$VERSION -t remie/docker-nagios:$VERSION .
              if [ "${CIRCLE_BRANCH}" == "master" ]; then
                docker push remie/docker-nagios:$VERSION
              fi
            done

version: 2
jobs:

  build:

    docker:
      - image: circleci/node:8

    steps:
      - checkout
      - setup_remote_docker

      - run:
          name: Install Docker client
          command: |
            set -x
            VER="18.06.1-ce"
            sudo curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
            sudo tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            sudo mv /tmp/docker/* /usr/bin
            echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

      - run:
          command: |
            LATEST="4.4.3"
            versions=( "4.3.0" "4.3.1" "4.3.2" "4.3.3" "4.3.4" "4.4.0" "4.4.1" "4.4.2" "4.4.3" )
            for VERSION in "${versions[@]}"
            do
              echo "Building for Nagios $VERSION"
              docker build --build-arg VERSION=$VERSION -t remie/docker-nagios:$VERSION .
              if [ "${CIRCLE_BRANCH}" == "master" ]; then
                docker push remie/docker-nagios:$VERSION
                if [ "${VERSION}" == "$LATEST" ]; then
                  docker tag remie/docker-nagios:$VERSION remie/docker-nagios:latest
                  docker push remie/docker-nagios:latest
                fi
              fi
            done
Support 4.3.0 to 4.4.3 (latest)
Support 4.3.0 to 4.4.3 (latest)
