github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/f0045.yml (about)

     1  doc_meta: |
     2    folder: env-vars
     3    title: client validation
     4    head: |
     5      This showcases:
     6        * Fail fast if a env var is not in the current shell session
     7  
     8      It is always better to provide this type of validation so that it fail fast to ensure all the initial required data are gathered.
     9  
    10    sections:
    11      - title: Demo
    12        log: yes
    13  
    14  notes:
    15    goal:
    16      - show that if required ENV var is empty and it will fail if this is empty
    17  
    18    storys:
    19      - the env vars:
    20          student_name: if it can not find it, it fails fast and execution stops
    21  
    22  scopes:
    23  
    24    - name: global
    25      dvars:
    26        - name: student_name
    27          desc: show that if required ENV var is empty and it will fail if this is empty
    28          value: '{{ env "STUDENT_NAME" |validateMandatoryFailIfNone "student_name" }}'
    29  #same as below:
    30  #        value: '{{ expandenv "$STUDENT_NAME" |validateMandatoryFailIfNone "student_name" }}'
    31  
    32  tasks:
    33  
    34    -
    35      name: task