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

Provide a way to output results (--output-file) to a file #455

Closed
onedr0p opened this issue Dec 22, 2023 · 0 comments · Fixed by #457 or #459
Closed

Provide a way to output results (--output-file) to a file #455

onedr0p opened this issue Dec 22, 2023 · 0 comments · Fixed by #457 or #459

Comments

@onedr0p
Copy link
Contributor

onedr0p commented Dec 22, 2023

As discussed in Discord, it would be great to have an arg to output to a file. My use case would be to use the new container we built in a Github workflow like this since redirecting to stdout won't work using the container.

      - name: Diff Resources
        uses: docker://ghcr.io/allenporter/flux-local:main
        with:
          args: >
            diff ${{ matrix.resources }}
              --unified 6
              --path-orig live/${{ matrix.paths }}
              --path pr/${{ matrix.paths }}
              --strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
              --limit-bytes 10000
              --all-namespaces
              --sources "home-kubernetes"
              --output-file diff.patch

      - name: Generate Diff
        id: diff
        run: |
          echo "diff<<EOF" >> $GITHUB_OUTPUT
          cat diff.patch >> $GITHUB_OUTPUT
          echo "EOF" >> $GITHUB_OUTPUT
allenporter added a commit that referenced this issue Dec 22, 2023
Add --output-file flag to get cluster action to allow writing output
directly to a file. This makes it easier to invoke from a docker
container and will simplify many of the github actions.

Example usage:
```
$ flux-local get cluster --path tests/testdata/cluster -o yaml --output-file=/tmp/yaml
```

Tested manually, and implicitly through default argument using
`/dev/stdout`.
Fixes #455
@allenporter allenporter reopened this Dec 22, 2023
allenporter added a commit that referenced this issue Dec 22, 2023
Add the --output-file command for `diff` and `build`. Also update the
diff action to use the output file command as in the example in the
feature request.

Fixes #455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants