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 gcp bash script for easy PR deployment #2

Merged
merged 17 commits into from
Aug 24, 2021

Conversation

kertal
Copy link
Collaborator

@kertal kertal commented Aug 11, 2021

This PR is adding a script that simplifies the process of deploying a Github PR to google cloud

Usage

Deploy a PR in

./kbn-dev.sh deploy pr {numberOfPR}

Update the instance of a PR

./kbn-dev.sh deploy pr {numberOfPR}

SSH into the instance of a PR

./kbn-dev.sh ssh pr {numberOfPR}

Destroy a PR

./kbn-dev.sh destroy pr {numberOfPR}

Show deployments

./kbn-dev.sh

What's more ...

... it also works with branches and tags
./kbn-dev.sh deploy branch {nameOfBranch}
./kbn-dev.sh deploy tag {nameOfTag}

Btw currently there is no check if a PR or branch or tag exists, but of course this should be done

Why only GCP ?

Because I'm familiar to GCP and havr access to it, but of course it should be possible to extend it to AWS or Azure


kibana_syslog=/var/log/syslog

grep -m 1 "bundles compiled successfully" <(tail -f -n +1 $kibana_syslog)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's cumbersome to detect Kibana finished building, this works a least in recent minors, but in case it doesn't work, deployment needs to be checked manually

@kertal kertal marked this pull request as ready for review August 12, 2021 05:30
gcp/main.tf Outdated
"chmod +x /tmp/bootstrap.sh",
"nohup /tmp/bootstrap.sh ${var.kibana_repo_url} ${var.kibana_repo_branch}",
"chmod +x /tmp/*.sh",
"/tmp/install.sh ${var.kibana_repo_url} ${var.kibana_repo_branch} && /tmp/bootstrap.sh && /tmp/start.sh ",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splitting of the original bootstrap.sh script so only parts can be executed

Copy link
Owner

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get over how cool this is!! Added a few ideas.

Would you be willing to add some documentation explaining deployments.txt and how that works?

gcp/variables.tf Show resolved Hide resolved
kibana.dev.yml Outdated Show resolved Hide resolved
kbn-dev-gcp.sh Outdated Show resolved Hide resolved
kbn-dev-gcp.sh Outdated Show resolved Hide resolved
@kertal kertal requested a review from lukeelmers August 17, 2021 22:50
Copy link
Owner

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so awesome and brings the project to another level. Thanks @kertal! 🚀

fi
log "🍅 Checking for Kibana UI to be available"
eval "ssh -q -o StrictHostKeyChecking=no ubuntu@${PUBLIC_IP} /tmp/check_ui_online.sh"
log "🥗 🥯 ☕ - Kibana UI is available (${KIBANA_URL}) "
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love your strong emoji game

@lukeelmers lukeelmers merged commit 8ce72cb into lukeelmers:main Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants