Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run CI checks

on:
push:
branches:
- develop

jobs:
build:
runs-on: [self-hosted, linux]
timeout-minutes: 150

steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Build AMI
run: |
packer build -timestamp-ui -color=false -on-error=abort -var-file common.vars.json -var-file development-arm.vars.json amazon.json
34 changes: 18 additions & 16 deletions amazon.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"region": "af-south-1",
"ami_regions": "af-south-1",
"ami": "ami-08a4b40f2fe1e4b35",
"ami_name": "supabase-postgres-13.3.0.4",
"environment": "prod",
"ansible_arguments": "--skip-tags,install-postgrest,--skip-tags,install-pgbouncer,--skip-tags,install-supabase-internal"
"profile": "{{env `AWS_PROFILE`}}"
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"profile": "{{user `profile`}}",
"region": "{{user `region`}}",
"ami_regions": "{{user `ami_regions`}}",
"source_ami": "{{user `ami`}}",
"instance_type": "m5.2xlarge",
"source_ami": "{{user `ubuntu-2004`}}",
"instance_type": "{{user `instance-type`}}",
"ssh_username": "ubuntu",
"ami_name": "{{user `ami_name`}}",
"ami_name": "supabase-postgres-{{user `postgres-version`}}",
"tags": {
"environment": "{{user `environment`}}",
"appType": "postgres"
"appType": "postgres",
"creator": "packer"
},
"run_tags": {
"creator": "packer"
},
"snapshot_tags": {
"creator": "packer"
},
"run_volume_tags": {
"creator": "packer"
},
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 16,
"volume_type": "gp2",
"volume_type": "gp3",
"delete_on_termination": true
}
]
Expand All @@ -45,7 +47,7 @@
"type": "ansible",
"user": "ubuntu",
"playbook_file": "ansible/playbook.yml",
"extra_arguments": "{{user `ansible_arguments`}}"
"extra_arguments": "--skip-tags,install-postgrest"
},
{
"execute_command": "echo 'packer' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'",
Expand Down
3 changes: 3 additions & 0 deletions common.vars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"postgres-version": "13.3.0.5-rc0"
}
8 changes: 8 additions & 0 deletions development-arm.vars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ami_regions": "ap-southeast-1",
"arch": "arm64",
"environment": "dev",
"instance-type": "t4g.2xlarge",
"region": "ap-southeast-1",
"ubuntu-2004": "ami-077adae4d983338da"
}