Code snippets used in blog post "Contributing to Open Source Projects II - sdkman": https://pbassiner.github.io/blog/contributing_to_open_source_projects_ii_-_sdkman.html
Created
December 27, 2016 14:28
-
-
Save pbassiner/d9df5e60477a4d1b0d8ef354e9a9f6ea to your computer and use it in GitHub Desktop.
Blog Post - Contributing to Open Source Projects II - sdkman: Ansible and bash script snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Register sdk installation status | |
shell: ls ~/.sdkman | |
failed_when: false | |
register: sdk_installed | |
- name: Download sdkman | |
get_url: url=https://get.sdkman.io dest=/tmp/sdkman.sh validate_certs=no | |
when: sdk_installed.stdout == "" | |
- name: Install sdkman | |
script: /tmp/sdkman.sh | |
when: sdk_installed.stdout == "" | |
- name: Force sdkman update & install JVM development tools using sdkman | |
script: sdkman.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local base_name="$(date +%s%N | sha256sum | base64 | head -c 32 ; echo)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source "$HOME/.sdkman/bin/sdkman-init.sh" | |
sdk selfupdate force | |
sdk flush candidates | |
echo "Y" | sdk install java # Accept license | |
sdk install sbt | |
sdk install maven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source "$HOME/.sdkman/bin/sdkman-init.sh" | |
sdk selfupdate force | |
sdk flush candidates | |
# Hack to avoid using cat with /dev/random, while waiting for PR to be merged | |
sed -i 's/cat \/dev\/urandom/head \/dev\/urandom/g' /$HOME/.sdkman/src/sdkman-install.sh | |
source "$HOME/.sdkman/bin/sdkman-init.sh" | |
echo "Y" | sdk install java # Accept license | |
sdk install sbt | |
sdk install maven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local base_name="$(head /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment