How can I convert this from Circle CI 1.0 to 2.0?

I’m facing issues while migrating CircleCi 1.0 to CircleCI 2.0. I have created circle.yml which is working perfectly for CircleCI 1.0. Can some body help me to create .circleci/config.yml for Circle CI 2.0.
Thanks in advance

My circle.yml file:

test:
 override:
 - ant -f builds/build.xml -lib build/lib/ deploy:
 timeout: 600
general:
  branches:
    only:
      - master # list of branches to build

What specific problem are you having with converting this? Have you made a start? If you can add that to your question, it would help.

Hi halfer, Thanks for your response.
I have created circle/config.yml file like this:

version: 2
jobs:
  build:
    docker:
      - image: atsnngs/force-com:latest
    steps:
       - run:
         name: Deploy
         command: ant -f builds/build.xml -lib build/lib/ deploy:

but it gives below error:

Build-agent version 0.0.6918-3a2a4e2 (2018-06-22T13:50:16+0000)
Configuration errors: 2 errors occurred:

  • Error parsing config file: yaml: line 8: mapping values are not allowed in this context
  • Cannot find a job named build to run in the jobs: section of your configuration file.
    If you expected a workflow to run, check your config contains a top-level key called ‘workflows:’

The contents of the run section are not sufficiently indented for the YAML to be valid and correct, see my example here.

Yes i know that, but can you please help me so what could be the alternate of this command:
ant -f builds/build.xml -lib build/lib/ deploy:

Please fix your YAML first in the above post, so I can delete my advice. It really is wrong at present (your YAML will produce a different data structure to the one that is required).

I tried this one but now getting build.xml not exist

version: 2
jobs:
  build:
    docker:
      - image: circleci/java:8-jdk
    steps:
      - run:
         name: Deploy
         command: |
           ant -f builds/build.xml

Error:

Buildfile: build.xml does not exist!
Build failed
Exited with code 1

My build.xml file is in builds folder of root project directory

Ah, it looks like you’re missing a checkout step - you’ve not cloned your code to the build server.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.