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

Feature/cicd hetzner deploy #89

Draft
wants to merge 149 commits into
base: main
Choose a base branch
from

Conversation

NexusNull
Copy link
Collaborator

Overview:
This pull request extends the functionality by introducing an automated server deployment mechanism using Terraform and Ansible. The key enhancement includes configuring the terraform.tf file located in cicd/infra/ to utilize the Hetzner API for seamless server provisioning. Additionally, a GitHub workflow has been incorporated to automate the deployment process.

Workflow Details:

The GitHub workflow initiates the deployment process upon specific triggers (e.g., pull request merges to a designated branch, scheduled intervals).
It executes the Terraform and Ansible deployment scripts, orchestrating the provisioning and configuration of servers based on the defined infrastructure specifications.
Error handling and notifications are incorporated within the workflow to ensure visibility and prompt resolution of any deployment issues.

Purpose and Benefits:

Automation: Facilitates automated deployment, reducing manual intervention and associated errors.
Reliability: Ensures consistent and reliable server setup and configuration across deployments.
Visibility: The GitHub workflow provides transparency into the deployment process and facilitates monitoring.

@NexusNull NexusNull self-assigned this Dec 26, 2023
@thmsndk
Copy link
Contributor

thmsndk commented Dec 27, 2023

Just the first things that springs to mind

.vscode should not be added to .gitignore
The extensions.json should not be removed either
it's responsible for the linting and code formatting.
It also looks like there is a lot of code reverts compared to the main branch, they are probably not intentional. Might be merge issues

I'll look at the PR in more detail later ☺

.gitignore Outdated Show resolved Hide resolved
.vscode/extensions.json Outdated Show resolved Hide resolved
api.py Outdated Show resolved Hide resolved
app.yaml Outdated Show resolved Hide resolved
config.py Outdated
Comment on lines 108 to 120
if is_sdk:
if self:
url=urlparse(self.request.url)
protocol=url.scheme
hostname=url.hostname
else:
protocol="http"
hostname=sdk_domain

domain.base_url=protocol + "://" + hostname
domain.pref_url=domain.base_url
domain.base_url=self and "http://%s"%self.request.headers.get("Host") or "http://%s.%s"%(sdk_domain[1],sdk_domain[2])
domain.pref_url=self and "http://%s"%self.request.headers.get("Host") or "http://%s.%s"%(sdk_domain[1],sdk_domain[2])
domain.server_ip="192.168.1.125"
domain.stripe_pkey=stripe_pkey
domain.stripe_enabled=False
domain.https_mode=False
domain.domain=hostname
domain.domain=self and ["www",self.request.headers.get("Host").split(".")[0],self.request.headers.get("Host").split(".")[1]] or sdk_domain
else:
protocol="http"
if self and "https" in (self.request.headers.get("Cf-Visitor") or ""): protocol="https"
domain.base_url=protocol + "://" + live_domain
domain.pref_url=domain.base_url
domain.base_url="%s://%s.%s"%(protocol,live_domain[1],live_domain[2])
domain.pref_url="https://%s.%s"%(live_domain[1],live_domain[2])
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use the code from main, it supports running in development mode as well as production.
The code here seems like older, previous code.

scripts/process_gallery.js Outdated Show resolved Hide resolved
scripts/run_a_command.js Outdated Show resolved Hide resolved
scripts/run_servers.js Outdated Show resolved Hide resolved
scripts/test_iap.js Outdated Show resolved Hide resolved
scripts/update_machines.js Outdated Show resolved Hide resolved
@NexusNull
Copy link
Collaborator Author

NexusNull commented Dec 28, 2023

Just the first things that springs to mind

.vscode should not be added to .gitignore The extensions.json should not be removed either it's responsible for the linting and code formatting. It also looks like there is a lot of code reverts compared to the main branch, they are probably not intentional. Might be merge issues

I'll look at the PR in more detail later ☺

This is still a draft, I appreciate the review but it isn't ready yet. This is mainly so I can see where changes are compared to the base branch, as you already figured out there are things I need to adjust.

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.

3 participants