Skip to content

Commit

Permalink
feat(ssh): implement task for ssh (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismayta committed Dec 30, 2024
1 parent 8782301 commit 4a2d4f3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ssh/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ tasks:
vars:
STAGE: testing

make:pem:prod:
desc: Make pem for stage prod
run: once
cmds:
- task: make
vars:
STAGE: prod

make:
desc: generate ssh pem
run: once
Expand All @@ -64,7 +72,9 @@ tasks:
mkdir -p {{.KEYBASE_PROJECT_PATH}}/{{.STAGE}}/keys/
- >-
mv {{.PROJECT_NAME}}-{{.STAGE}} {{.KEYBASE_PROJECT_PATH}}/{{.STAGE}}/keys/
- >-
mv {{.PROJECT_NAME}}-{{.STAGE}}.pub {{.KEYBASE_PROJECT_PATH}}/{{.STAGE}}/keys/
- >-
mv {{.PROJECT_NAME}}-{{.STAGE}}.pem {{.KEYBASE_PROJECT_PATH}}/{{.STAGE}}/keys/
status:
- test -f {{.KEYBASE_PROJECT_PATH}}/{{.STAGE}}/keys/{{.PROJECT_NAME}}-{{.STAGE}}
Expand Down Expand Up @@ -94,3 +104,17 @@ tasks:
- task: export
vars:
STAGE: prod

make:user:
desc: generate ssh pem username
run: once
deps:
- task: check
cmds:
- >-
ssh-keygen -q -m PEM -t rsa -b 4096
-C "{{.USERNAME}}" -f {{.USERNAME}} -P ""
- >-
openssl rsa -in {{.USERNAME}} -outform pem > {{.USERNAME}}.pem
- >-
chmod 0600 {{.USERNAME}}.pem

0 comments on commit 4a2d4f3

Please sign in to comment.