summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolaos Boutalas <nikolaos@boutalas.me>2023-08-07 11:51:30 +0300
committerNikolaos Boutalas <nikolaos@boutalas.me>2023-08-07 11:54:27 +0300
commitad3fa4fef6af05bbc51768785a0d06f110fdd9c5 (patch)
tree62efec17734eeae8119dc07663f8f10ea5da12dc
parent803b8cd7919f6602432cf2f185ee7fc28ba4ed6b (diff)
Add sdkman task
-rw-r--r--dotfiles/sdkman/.sdkmanrc3
-rw-r--r--local.yml1
-rw-r--r--tasks/sdkman.yml24
3 files changed, 28 insertions, 0 deletions
diff --git a/dotfiles/sdkman/.sdkmanrc b/dotfiles/sdkman/.sdkmanrc
new file mode 100644
index 0000000..690971c
--- /dev/null
+++ b/dotfiles/sdkman/.sdkmanrc
@@ -0,0 +1,3 @@
+# Enable auto-env through the sdkman_auto_env config
+# Add key=value pairs of SDKs to use below
+java=17.0.7-zulu
diff --git a/local.yml b/local.yml
index d9d458d..8390656 100644
--- a/local.yml
+++ b/local.yml
@@ -4,4 +4,5 @@
- include: tasks/zsh.yml
- include: tasks/ssh.yml
- include: tasks/node.yml
+ - include: tasks/sdkman.yml
- include: tasks/dotfiles.yml
diff --git a/tasks/sdkman.yml b/tasks/sdkman.yml
new file mode 100644
index 0000000..638912f
--- /dev/null
+++ b/tasks/sdkman.yml
@@ -0,0 +1,24 @@
+- name: Install sdkman
+ shell: curl -s "https://get.sdkman.io?rcupdate=false" | bash
+ args:
+ warn: false
+ tags:
+ - sdkman
+
+- name: Enable sdkman
+ lineinfile:
+ path: "~/.config/zsh/.zshrc"
+ line: |
+ #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
+ export SDKMAN_DIR="$HOME/.sdkman"
+ [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
+ tags:
+ - sdkman
+
+- name: Configure sdkman_auto_env
+ lineinfile:
+ path: "~/.sdkman/etc/config"
+ regexp: '^sdkman_auto_env='
+ line: sdkman_auto_env=true
+ tags:
+ - sdkman