Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for multiple init-script #101

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

sunggun-yu
Copy link
Owner

  • implement an array type for init-script with the run keyword
  • maintain backward compatibility for init-script as a single string
  • upgrade Go YAML version from v2 to v3
  • corrected typos in comments

Multiple init-script will be useful for reusable command with YAML Anchor

example of multiple init-script

commons:
  gcloud-login: &commons-gcloud-login |
    echo "login gcloud ..."
    gcloud auth login

profiles:
  my-profile-1:
    env:
      - name: VAR
        value: val
    init-script: |
      echo "meow"
      echo "woof"

  my-profile-2:
    env:
      - name: VAR
        value: val
    init-script: |
      - run: echo meow
      - run: |
          echo "woof"
          echo "meow"
      - file: "/some/path/this-will-be-ignored-only-run-keyword-is-supported"

  my-profile-3:
    env:
      - name: TEST1
        value: ~/.config
    init-script:
      - run: |
          echo "getting password from keepass ..."
          keepassxc-cli show -sa password /Users/myusuer/Documents/KeePass/default.kdbx test
      - run: *commons-gcloud-login
      - run: |
          echo "configure docker login for gcr ..."
          gcloud auth configure-docker gcr.io

  my-profile-4:
    env:
      - name: TEST1
        value: ~/.config
    init-script:
      - run: *commons-gcloud-login
      - run: |
          echo "configure docker login for gcr ..."
          gcloud auth configure-docker gcr.io

- implement an array type for `init-script` with the `run` keyword
- maintain backward compatibility for `init-script` as a single string
- upgrade Go YAML version from v2 to v3
- corrected typos in comments
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1c92017) 93.84% compared to head (66d6f04) 94.28%.
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   93.84%   94.28%   +0.44%     
==========================================
  Files          17       18       +1     
  Lines         682      735      +53     
==========================================
+ Hits          640      693      +53     
  Misses         24       24              
  Partials       18       18              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sunggun-yu sunggun-yu merged commit b27a0cd into main Nov 22, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant