Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CircleCI 2.0 First Steps in Beta

CircleCI 2.0 First Steps in Beta

Ladislav Prskavec

April 27, 2017
Tweet

More Decks by Ladislav Prskavec

Other Decks in Technology

Transcript

  1. CircleCI 2.0 First Steps in Beta

  2. New Config 4 circleci.yml -> .circleci/config.yml

  3. Configuration Reference 4 configuration reference

  4. Docker vs Machine 4 configuration types Executor docker machine Start

    time Instant 30-60 sec Clean environment Yes Yes Custom images Yes No Build Docker images Yes (1) Yes Full control over job environment No Yes (1) With Remote Docker.
  5. CircleCI CLI 4 local jobs Installation curl -o /usr/local/bin/circleci \

    https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci \ && chmod +x /usr/local/bin/circleci
  6. $ circleci Receiving latest version of circleci... The CLI tool

    to be used in CircleCI. Usage: circleci [flags] circleci [command] Available Commands: build run a full build locally config validate and update configuration files step execute steps tests collect and split files with tests version output version info Flags: -c, --config string config file (default is .circleci/config.yml) --taskId string TaskID --verbose emit verbose logging output Use "circleci [command] --help" for more information about a command.
  7. Next Steps 4 start with small projects - ciphertext

  8. version: 2 jobs: build: working_directory: /app docker: - image: apiaryio/nodejs:4

    steps: - checkout - setup_remote_docker: reusable: true # default - false exclusive: true # default - true - run: name: Install Docker client command: | set -x VER="17.03.0-ce" curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz tar -xz -C /tmp -f /tmp/docker-$VER.tgz mv /tmp/docker/* /usr/bin # This should go into custom primary image, here's only for the sake of explanation - run: name: Install Docker Compose command: | set -x curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose - run: name: Create ciphertext docker image command: docker-compose build - run: name: Run test command: SNYK_TOKEN=$SNYK_TOKEN docker-compose run test
  9. DEMO $ circleci build

  10. Summary 4 beta 4 limitations 4 Building docker images 4

    Custom Images 4 Complex example from CircleCI