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

     1  doc_meta: |
     2    folder: template
     3    title: gtf funcs
     4    head: |
     5      Demo usecases of gtf golang template functions
     6  
     7      gtf is a useful set of Golang Template Functions. The goal of this project is implementing all built-in template filters of Django & Jinja2
     8  
     9    sections:
    10      - title: Demo
    11        log: yes
    12  
    13    related:
    14      refs:
    15        - title: gtf reference
    16          link: https://github.com/leekchan/gtf
    17  notes:
    18    goal:
    19      - to showcase template funcs from gtf
    20      - sprig has avoided using same name func name, so there will be no duplication in sprig
    21      - special treatment is done to avoid gtf's template same func name to be added to the funcmap
    22  
    23    refs:
    24      doc: https://github.com/leekchan/gtf
    25      benefits: |
    26        gtf is a useful set of Golang Template Functions. The goal
    27         of this project is implementing all built-in template
    28         filters of Django & Jinja2
    29  
    30  vars:
    31    ns: prod
    32    pod_name: web_app
    33    ha: true
    34    age: 34
    35    old: 54
    36    admins: [tom, jason, alice]
    37    managers:
    38      - tom
    39      - jason
    40      - alice
    41    student:
    42      name: Tom
    43      gender: Male
    44      teachers:
    45        - tom
    46        - jason
    47        - alice
    48      address:
    49        suburb:
    50          name: sydney
    51          postcode: 2000
    52          CBD: yes
    53        school: Sydney Grammar
    54  
    55  dvars:
    56  
    57    - name: sprig_trim
    58      value: '{{ trim "  hello       "}}'
    59      desc: test if sprig is still working
    60      flags: [vvvv,]
    61  
    62    - name: var_slice_index
    63      desc: check if the builtin is still working
    64      value: "{{ index .admins 1 }}"
    65      flags: [vvvv,]
    66  
    67    - name: gtf_url_encoding
    68      value: '{{ "http://www.example.org/foo?a=b&c=d" | urlencode}}'
    69      flags: [vvvv,]
    70  
    71    - name: gtf_ljust
    72      value: '{{ hello | ljust 20}}'
    73      flags: [vvvv,]
    74  
    75  tasks:
    76    -
    77      name: task
    78      task:
    79  
    80        -
    81          func: shell
    82          do:
    83            - echo "check the value of other dvar using vvvv flag print out"