Skip to content

Commit

Permalink
switch to php 8.3, add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
kringkaste committed Mar 6, 2024
1 parent 9cfec28 commit 2c4d87d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: "packer validate packer.pkr.hcl"

- name: Validate ansible playbooks
uses: ansible/ansible-lint-action@main
uses: ansible/ansible-lint-action@main
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
init:
packer init packer.pkr.hcl

test: init
packer validate packer.pkr.hcl
ansible-lint

build: test
packer build packer.pkr.hcl

all: build
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# AWS-Baseimage

This repository contains the [Chef](https://www.chef.io/) cookbooks and the [Packer](https://www.packer.io/) configuration
to generate the AWS AMI, which we use at [codemonauts](https://codemonauts.com/)
to start our EC2 instances.
This repository contains the [Ansible](https://www.ansible.com/) cookbooks and the [Packer](https://www.packer.io/) configuration
to generate the AWS AMI, which we use at [codemonauts](https://codemonauts.com/) to start our EC2 instances.

If you find some problems or errors in this repositoy feel free to open an issue
or directly fix it with an pull request if you want to.
If you find some problems or errors in this repositoy feel free to open an issue or directly fix it with an pull request if you want to.

## Content
As a basis we choose the latest Ubuntu LTS from the official AWS AMI store. On top of this we did the following for the **base** images:
Expand All @@ -22,13 +20,12 @@ Additionaly on top for the **web** images:
* Install PHP-FPM and some PHP Modules which are used by CraftCMS

## Images build by this repo
All images are public and available in eu-central-1 and eu-west-1. The *XXX* in the AMI name is the timestamp during build in the format `YYYY-MM-DD-hhmm`
All images are public and available in eu-central-1 and eu-west-1. The *XXX* in the AMI name is the timestamp during build in the format `YYYY-MM-DD-hh-mm`.

**arm64**
* Ubuntu Focal, Base (codemonauts-arm-base-focal_XXX)
* Ubuntu Focal, Web with PHP 8.0 (codemonauts-arm-web-focal-php80_XXX)
* Ubuntu Jammy, Base (codemonauts-arm-base-jammy_XXX)
* Ubuntu Jammy, Web with PHP 8.3 (codemonauts-arm-web-jammy-php83_XXX)

**amd64**
* Ubuntu Focal, Base (codemonauts-base-focal_XXX)
* Ubuntu Focal, Web with PHP 7.4 (codemonauts-web-focal-php74_XXX)
* Ubuntu Focal, Web with PHP 7.0 (codemonauts-web-focal-php70_XXX)
* Ubuntu Jammy, Base (codemonauts-base-jammy_XXX)
* Ubuntu Jammy, Web with PHP 7.4 (codemonauts-web-jammy-php74_XXX)
16 changes: 8 additions & 8 deletions packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,22 @@ build {
}
}

# arm-web-jammy-82
source "amazon-ebs" "arm64-web-jammy-php82" {
# arm-web-jammy-83
source "amazon-ebs" "arm64-web-jammy-php83" {
ami_groups = ["all"]
ami_name = "codemonauts-arm-web-jammy-php82_${formatdate("YYYY-MM-DD-hh-mm", timestamp())}"
ami_name = "codemonauts-arm-web-jammy-php83_${formatdate("YYYY-MM-DD-hh-mm", timestamp())}"
ami_regions = ["eu-west-1"]
instance_type = "t4g.micro"
region = "eu-central-1"
source_ami = "${data.amazon-ami.ubuntu-jammy-arm64.id}"
ssh_username = "ubuntu"
tags = {
Amazon_AMI_Management_Identifier = "arm64_web_jammy_82"
Amazon_AMI_Management_Identifier = "arm64_web_jammy_83"
}
}
build {
name = "arm64-web-jammy-82"
sources = ["source.amazon-ebs.arm64-web-jammy-php82"]
name = "arm64-web-jammy-83"
sources = ["source.amazon-ebs.arm64-web-jammy-php83"]

provisioner "shell" {
inline = [
Expand All @@ -171,12 +171,12 @@ build {
playbook_file = "webserver.yaml"
extra_arguments = [
"-e",
"php_version=8.2"
"php_version=8.3"
]
}

post-processor "amazon-ami-management" {
identifier = "arm64_web_jammy_82"
identifier = "arm64_web_jammy_83"
keep_releases = "3"
regions = ["eu-central-1", "eu-west-1"]
}
Expand Down

0 comments on commit 2c4d87d

Please sign in to comment.