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

Add Nix flake along with usage instructions #15

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

[*.go]
Expand All @@ -21,5 +18,5 @@ indent_size = 2
[*.xml]
indent_size = 2

[Makefile]
[{Makefile,.envrc}]
indent_style = tab
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if command -v nix &>/dev/null; then
use flake
PATH_add "$PWD/result/bin"
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
vendor/
bin/
dist/

/result
/.pre-commit-config.yaml
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ All files are located inside Jenkins home directory:

I've tested this on Jenkins 1.625.1 and 2.141

### Run using a binary
## Usage

### Pre-Built Binary

Mac (Intel CPU only):

Expand Down Expand Up @@ -61,7 +63,7 @@ Or if you have the files locally:
-c credentials.xml \
-o json

### Run using docker
### Docker

If you are worried about the binary sending your credentials over the network (it does not do that)
then run a container with disabled network:
Expand Down Expand Up @@ -97,8 +99,15 @@ With files locally:
-s hudson.util.Secret \
-c credentials.xml \
-o json

### Build the binary yourself

### Nix

Assuming you have enabled [Flakes](https://nixos.wiki/wiki/Flakes) in your Nix configuration, you can use the provided [`flake.nix`](./flake.nix) to build and run this project.

- To build and run the binary without installing it: `nix run github:hoto/jenkins-credentials-decryptor -- --help`
- To install in the current profile: `nix profile install github:hoto/jenkins-credentials-decryptor`

### Build Locally

If you are worried about executing a random binary from the internet then:

Expand Down
245 changes: 245 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading