version: 2
jobs:
  build:
    machine:
      image: circleci/classic:latest
    steps:
      - checkout
      - run:
          name: Install build tools
          command: sudo apt-get update && sudo apt-get install build-essential cpio squashfs-tools debootstrap realpath
      - run:
          name: Prepare branches
          command: cp .circleci/branches.yaml platform/upload/branches.yaml && echo "ci" >platform/upload/BRANCH_NAME
      - run:
          name: Construct build chroot
          command: HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/create.sh
      - run:
          name: Import gpg key
          command: echo "gpg --batch --no-tty --yes --import /homeworld/.circleci/ci-key-private.asc" | HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/enter-ci.sh
      - run:
          name: Check gpg key presence
          command: echo "gpg --list-secret-keys" | HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/enter-ci.sh
      - run:
          name: Launch build with bazel
          command: echo "bazel build //upload --verbose_failures" | HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/enter-ci.sh

version: 2
jobs:
  build:
    machine:
      image: ubuntu-1604:201903-01
    steps:
      - checkout
      - run:
          name: Install build tools
          command: sudo apt-get update && sudo apt-get install build-essential cpio squashfs-tools debootstrap realpath
      - run:
          name: Prepare branches
          command: cp .circleci/branches.yaml platform/upload/branches.yaml && echo "ci" >platform/upload/BRANCH_NAME
      - run:
          name: Construct build chroot
          command: HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/create.sh
      - run:
          name: Import gpg key
          command: echo "gpg --batch --no-tty --yes --import /homeworld/.circleci/ci-key-private.asc" | HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/enter-ci.sh
      - run:
          name: Check gpg key presence
          command: echo "gpg --list-secret-keys" | HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/enter-ci.sh
      - run:
          name: Launch build with bazel
          command: echo "bazel build //upload --verbose_failures" | HOMEWORLD_CHROOT="$HOME/autobuild-chroot" USER="circleci" ./build-chroot/enter-ci.sh

Use ubuntu 16.04 image for CircleCI
ci: Use ubuntu 16.04 image for CircleCI

This is the image recommended by the documentation:
https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
