Skip to content
Merged
44 changes: 27 additions & 17 deletions .github/workflows/generate-ec2-quickstart-sha256-checksum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,42 @@ name: Generate SHA256 Checksum
on:
pull_request:
paths:
- 'AWS/EC2/ec2-install.sh' # Trigger only when the install.sh file in the AWS/EC2 directory is changed
- 'AWS/EC2'
types:
- opened
- synchronize
- reopened

# Needed so the workflow can push the regenerated checksum back onto the PR branch.
permissions:
contents: write

jobs:
generate-checksum:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Generate SHA256 checksum for install.sh in AWS/EC2 directory
run: |
# Generate SHA256 checksum for the install.sh script located in AWS/EC2
sha256sum AWS/EC2/ec2-install.sh > AWS/EC2/ec2-install.sh.sha256
- name: Checkout the PR branch
uses: actions/checkout@v7
with:
# Check out the actual PR branch (not the detached merge ref) so we can commit back to it.
ref: ${{ github.head_ref }}

- name: Commit SHA256 file to AWS/EC2 directory
run: |
# Set up Git config
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
- name: Generate SHA256 checksum for ec2-install.sh
# Run inside AWS/EC2 so the checksum file records the bare "ec2-install.sh" name.
# The quickstart guide downloads the script to the working directory and runs
# `sha256sum -c ec2-install.sh.sha256`, which expects the bare filename, not a path.
working-directory: AWS/EC2
run: sha256sum ec2-install.sh > ec2-install.sh.sha256

# Add the generated checksum file in the AWS/EC2 directory
git add AWS/EC2/ec2-install.sh.sha256
git commit -m "Add SHA256 checksum for ec2-install.sh in AWS/EC2 directory"
git push
- name: Commit the checksum if it changed
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
if git diff --quiet -- AWS/EC2/ec2-install.sh.sha256; then
echo "Checksum already up to date; nothing to commit."
else
git add AWS/EC2/ec2-install.sh.sha256
git commit -m "chore: update ec2-install.sh.sha256 [skip ci]"
git push
fi
12 changes: 6 additions & 6 deletions AWS/EC2/ec2-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ usage() {
echo -e "${WHITE}${BOLD}Develocity Installation Script${NOFORMAT}"
echo -e "\nUsage: $(basename "${BASH_SOURCE[0]}") [-h][-v][-l][-hn] [-u]"

echo -e "\n${WHITE}${BOLD}Example: ./install.sh -l develocity.license -hn develocity.example.io${NOFORMAT}"
echo -e "\n${WHITE}${BOLD}Example: ./ec2-install.sh -l develocity.license -hn develocity.example.io${NOFORMAT}"

echo -e "\nThe script sets up a lightweight Kubernetes (K3s) environment in which Develocity is deployed using Helm."
echo -e "The license (-l, --license) and hostname (-hn, --hostname) flags are always required."

echo -e "\nThe script is tested with Ubuntu 24.04 x86_64 (AMI)."
echo -e "\nThe script is tested with Ubuntu 26.04 x86_64 (AMI)."

echo -e "If you have questions please contact the Develocity support team."

Expand Down Expand Up @@ -231,7 +231,7 @@ installHelm(){
return
fi

local url="https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3"
local url="https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-4"
checkUrl "${url}"

logInfo "Installing Helm..."
Expand All @@ -254,7 +254,7 @@ installPlatformChart(){
ge-standalone \
gradle/gradle-enterprise-standalone \
--set global.hostname="${hostname}" \
--set-file global.license.file=./"${license}" \
--set-file global.license.file="${license}" \
|| exitError "Failed to install the Develocity Helm chart"
}

Expand Down Expand Up @@ -447,7 +447,7 @@ Access Develocity via the browser at: ${GREEN}http://${hostname}${NOFORMAT}

If you have any questions or need any assistance contact the Develocity support team or your customer success representative.

The installation script created a pre-configured setting.gradle.kts file for you.
The installation script created a pre-configured settings.gradle.kts file for you.


"""
Expand All @@ -461,7 +461,7 @@ Access Develocity via the browser at: ${GREEN}http://${hostname}${NOFORMAT}
while :; do
case "${1-}" in
-h | --help) usage ;;
-v | --version) echo "$Script_Version"; exit 0 ;;
-v | --version) echo "$SCRIPT_VERSION"; exit 0 ;;
--no-color) NO_COLOR=1 ;;
-l | --license)
if [[ -f "${2-}" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion AWS/EC2/ec2-install.sh.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
adf0f5886eb49c1832c1c8851d9fdde86547fca314154251a313a5c96f75e816 ec2-install.sh
3fb3a529802fffd779029c08903d449a47d17aef0ea1761940d9d5736955ef94 ec2-install.sh