Browse Source

Add AWS Builder (#707)

* add github actions workflows

* add marketplace placeholders

* minor changes

* increment build number

* fix yaml

* fix build version

* make main step uppercase

* Update dev.yml

* use cache instead of docker hub

* load image to docker client

* change cache key

* minor changes

* missing quote

* add aws pipeline

Co-authored-by: Sebastian Stehle <sebastian@squidex.io>
pull/708/head
Henrique Goncalves 5 years ago
committed by GitHub
parent
commit
d22c17beb9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .github/workflows/marketplace-aws.yml
  2. 2
      .github/workflows/marketplace-azure.yml
  3. 2
      .github/workflows/marketplace-digitalocean.yml
  4. 2
      .github/workflows/marketplace-gcp.yml
  5. 2
      .github/workflows/marketplace-heroku.yml
  6. 2
      .github/workflows/marketplace-kubernetes.yml
  7. 2
      .github/workflows/marketplace-render.yml
  8. 2
      .github/workflows/marketplace-vultr.yml
  9. 62
      packer/aws.pkr.hcl

6
.github/workflows/marketplace-aws.yml

@ -3,7 +3,7 @@ concurrency: marketplace-aws
on:
release:
types: [released]
types: [ released ]
jobs:
validate:
@ -13,7 +13,6 @@ jobs:
uses: actions/checkout@v2
- name: Validate Template
if: false
uses: hashicorp/packer-github-actions@master
with:
command: validate
@ -32,7 +31,6 @@ jobs:
uses: rlespinasse/github-slug-action@v3.x
- name: Build
if: false
uses: hashicorp/packer-github-actions@master
with:
command: build
@ -41,4 +39,6 @@ jobs:
env:
PACKER_LOG: 1
PKR_VAR_squidex_version: "${{ env.GITHUB_REF_SLUG }}"
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
working-directory: packer/

2
.github/workflows/marketplace-azure.yml

@ -3,7 +3,7 @@ concurrency: marketplace-azure
on:
release:
types: [released]
types: [ released ]
jobs:
validate:

2
.github/workflows/marketplace-digitalocean.yml

@ -3,7 +3,7 @@ concurrency: marketplace-digitalocean
on:
release:
types: [released]
types: [ released ]
jobs:
validate:

2
.github/workflows/marketplace-gcp.yml

@ -3,7 +3,7 @@ concurrency: marketplace-gcp
on:
release:
types: [released]
types: [ released ]
jobs:
validate:

2
.github/workflows/marketplace-heroku.yml

@ -3,7 +3,7 @@ concurrency: marketplace-heroku
on:
release:
types: [released]
types: [ released ]
jobs:
validate:

2
.github/workflows/marketplace-kubernetes.yml

@ -3,7 +3,7 @@ concurrency: marketplace-kubernetes
on:
release:
types: [released]
types: [ released ]
jobs:
validate:

2
.github/workflows/marketplace-render.yml

@ -3,7 +3,7 @@ concurrency: marketplace-render
on:
release:
types: [released]
types: [ released ]
jobs:
validate:

2
.github/workflows/marketplace-vultr.yml

@ -3,7 +3,7 @@ concurrency: marketplace-vultr
on:
release:
types: [released]
types: [ released ]
jobs:
validate:

62
packer/aws.pkr.hcl

@ -0,0 +1,62 @@
variable "squidex_version" {
type = string
default = "5.7.0"
}
source "amazon-ebs" "aws" {
ami_groups = [
"all"]
ami_virtualization_type = "hvm"
ami_name = "squidex-${replace(var.squidex_version, ".", "-")}-{{ timestamp }}"
instance_type = "t2.small"
region = "us-east-1"
source_ami_filter {
filters = {
virtualization-type = "hvm"
name = "ubuntu/images/*/ubuntu-focal-20.04-amd64-server-*"
root-device-type = "ebs"
}
owners = [
"099720109477"]
most_recent = true
}
ssh_username = "ubuntu"
ami_regions = [
"eu-north-1",
"ap-south-1",
"eu-west-3",
"eu-west-2",
"eu-west-1",
"ap-northeast-3",
"ap-northeast-2",
"ap-northeast-1",
"sa-east-1",
"ca-central-1",
"ap-southeast-1",
"ap-southeast-2",
"eu-central-1",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2",
]
}
build {
sources = [
"source.amazon-ebs.aws"
]
provisioner "ansible" {
ansible_env_vars = [
"ANSIBLE_HOST_KEY_CHECKING=False",
"ANSIBLE_SSH_ARGS='-F /dev/null -o ForwardAgent=no -o ControlMaster=auto -o ControlPersist=60s'",
"ANSIBLE_NOCOLOR=True"
]
extra_arguments = [
"--extra-vars",
"squidex_version=${var.squidex_version}"]
playbook_file = "./ansible/playbook.yml"
use_proxy = false
}
}
Loading…
Cancel
Save