CircleCI version 2.1 - “Cannot find a definition for command named 'restore-cache'”2019 Community Moderator ElectionHow to resolve $TERM not set on gradlew ./assembleRelease on CIrcleCI?Rails Precompiling assets for CIcircleci v2 config - how do we filter by owner in a workflow?CircleCI 2.0 Workflow - Deploy not workingRun a command on CircleCI only once for a branchCircleCI migration: Config fileCircleci runs on merged branchCircleCI API behaving differently from github commit trigger?Errors in CircleCI config.ymlCircleCI error your tests likely make requests to this 'baseUrl' and these tests will fail if you don't boot your server

I can't die. Who am I?

How to get the first element while continue streaming?

How can I highlight parts in a screenshot

Why would the IRS ask for birth certificates or even audit a small tax return?

Difference between 'stomach' and 'uterus'

How can I handle a player who pre-plans arguments about my rulings on RAW?

"seeing as you don't know anyone but me" meaning in this context

Can an earth elemental drown/bury its opponent underground using earth glide?

Why can't we make a perpetual motion machine by using a magnet to pull up a piece of metal, then letting it fall back down?

Is the NES controller port identical to the port on a Wii remote?

Can we carry rice to Japan?

Why did the Cray-1 have 8 parity bits per word?

Would the melodic leap of the opening phrase of Mozart's K545 be considered dissonant?

Rationale to prefer local variables over instance variables?

Is every open circuit a capacitor?

What could be a means to defeat a childrens’ nightmare?

What is the meaning of "notice to quit at once" and "Lotty points”

How to kill a localhost:8080

How do I deal with being envious of my own players?

Meaning of word ягоза

How does signal strength relate to bandwidth?

How to fix my table, centering of columns

Why is it "take a leak?"

How to use math.log10 function on whole pandas dataframe



CircleCI version 2.1 - “Cannot find a definition for command named 'restore-cache'”



2019 Community Moderator ElectionHow to resolve $TERM not set on gradlew ./assembleRelease on CIrcleCI?Rails Precompiling assets for CIcircleci v2 config - how do we filter by owner in a workflow?CircleCI 2.0 Workflow - Deploy not workingRun a command on CircleCI only once for a branchCircleCI migration: Config fileCircleci runs on merged branchCircleCI API behaving differently from github commit trigger?Errors in CircleCI config.ymlCircleCI error your tests likely make requests to this 'baseUrl' and these tests will fail if you don't boot your server










0















I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


But I recieve the following error:



Error: Error calling workflow: 'main'
Error calling job: 'build'
Error calling command: 'build_source'
Cannot find a definition for command named restore-cache


It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



version: 2.1

defaults: &defaults
/**
* Unimportant stuff
*/

aliases:
- &restore-root-cache
keys:
- v1-deps- .Branch - checksum "package.json"
- v1-deps- .Branch
- v1-deps

commands:
build_source:
description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
steps:
- restore-cache: *restore-root-cache
- other-commands...

jobs:
build:
<<: *defaults
steps:
- checkout
- build_source

workflows:
version: 2.1
main:
jobs:
- build:
filters:
branches:
ignore: develop









share|improve this question




























    0















    I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



    circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


    But I recieve the following error:



    Error: Error calling workflow: 'main'
    Error calling job: 'build'
    Error calling command: 'build_source'
    Cannot find a definition for command named restore-cache


    It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



    Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



    version: 2.1

    defaults: &defaults
    /**
    * Unimportant stuff
    */

    aliases:
    - &restore-root-cache
    keys:
    - v1-deps- .Branch - checksum "package.json"
    - v1-deps- .Branch
    - v1-deps

    commands:
    build_source:
    description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
    steps:
    - restore-cache: *restore-root-cache
    - other-commands...

    jobs:
    build:
    <<: *defaults
    steps:
    - checkout
    - build_source

    workflows:
    version: 2.1
    main:
    jobs:
    - build:
    filters:
    branches:
    ignore: develop









    share|improve this question


























      0












      0








      0








      I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



      circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


      But I recieve the following error:



      Error: Error calling workflow: 'main'
      Error calling job: 'build'
      Error calling command: 'build_source'
      Cannot find a definition for command named restore-cache


      It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



      Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



      version: 2.1

      defaults: &defaults
      /**
      * Unimportant stuff
      */

      aliases:
      - &restore-root-cache
      keys:
      - v1-deps- .Branch - checksum "package.json"
      - v1-deps- .Branch
      - v1-deps

      commands:
      build_source:
      description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
      steps:
      - restore-cache: *restore-root-cache
      - other-commands...

      jobs:
      build:
      <<: *defaults
      steps:
      - checkout
      - build_source

      workflows:
      version: 2.1
      main:
      jobs:
      - build:
      filters:
      branches:
      ignore: develop









      share|improve this question
















      I'm currently attempting to use the commands feature available in CircleCI version 2.1, so that I can reuse some common commands. I'm testing using the CLI command:



      circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml


      But I recieve the following error:



      Error: Error calling workflow: 'main'
      Error calling job: 'build'
      Error calling command: 'build_source'
      Cannot find a definition for command named restore-cache


      It seems that restore-cache works just fine in a straight-up version 2 config file, but when I try and process a 2.1 file using process it kicks up a fuss.



      Below is an edited version of my config.yaml file which should hopefully be of some use. Please let me know if there is any additional information that would be useful.



      version: 2.1

      defaults: &defaults
      /**
      * Unimportant stuff
      */

      aliases:
      - &restore-root-cache
      keys:
      - v1-deps- .Branch - checksum "package.json"
      - v1-deps- .Branch
      - v1-deps

      commands:
      build_source:
      description: 'Installs dependencies, then builds src, builds documentation, and runs tests'
      steps:
      - restore-cache: *restore-root-cache
      - other-commands...

      jobs:
      build:
      <<: *defaults
      steps:
      - checkout
      - build_source

      workflows:
      version: 2.1
      main:
      jobs:
      - build:
      filters:
      branches:
      ignore: develop






      continuous-integration circleci circleci-2.0 circleci-workflows






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago









      Anthon

      30.9k1795149




      30.9k1795149










      asked 11 hours ago









      tedigctedigc

      104




      104






















          2 Answers
          2






          active

          oldest

          votes


















          0














          The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



          It should work in commands.






          share|improve this answer






























            0














            restore cache is a special step that needs to be under a job. Not another command.






            share|improve this answer






















              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021233%2fcircleci-version-2-1-cannot-find-a-definition-for-command-named-restore-cach%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



              It should work in commands.






              share|improve this answer



























                0














                The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



                It should work in commands.






                share|improve this answer

























                  0












                  0








                  0







                  The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



                  It should work in commands.






                  share|improve this answer













                  The command is restore_cache (with an underscore), not restore-cache (with a dash) https://circleci.com/docs/2.0/configuration-reference/#restore_cache



                  It should work in commands.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 7 hours ago









                  dnephindnephin

                  11.7k33230




                  11.7k33230























                      0














                      restore cache is a special step that needs to be under a job. Not another command.






                      share|improve this answer



























                        0














                        restore cache is a special step that needs to be under a job. Not another command.






                        share|improve this answer

























                          0












                          0








                          0







                          restore cache is a special step that needs to be under a job. Not another command.






                          share|improve this answer













                          restore cache is a special step that needs to be under a job. Not another command.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 7 hours ago









                          FelicianoTechFelicianoTech

                          2,3091814




                          2,3091814



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021233%2fcircleci-version-2-1-cannot-find-a-definition-for-command-named-restore-cach%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                              Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

                              How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page