diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c36308b..4a5fe25 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -28,7 +28,7 @@ jobs: deploy: name: Deploy to AWS org-sagebase-imagecentral runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }} + if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/test/') || startsWith(github.ref, 'refs/tags/v') }} needs: [ "validate" ] permissions: id-token: write diff --git a/README.md b/README.md index 2dd19a9..6045802 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,25 @@ source_profile = jsmith@imagecentral Now you will be able to build an image and deploy it to Imagecentral. +### Image Accessability +This project is setup to build publicly accessible images. To change it to +build private images please refer to the [packer documentation](https://packer.io/docs/builders/amazon-ebs.html) +for `ami_users` and `snapshot_users`options. + +### Testing +As a pre-deployment step we syntatically validate our packer json +files with [pre-commit](https://pre-commit.com). + +Please install pre-commit, once installed the file validations will +automatically run on every commit. Alternatively you can manually +execute the validations by running `pre-commit run --all-files`. + ### Manual AMI Build If you would like to test building an AMI run: ``` cd src +packer plugins install github.com/hashicorp/amazon +packer plugins install github.com/hashicorp/ansible AWS_PROFILE=packer-service-imagecentral AWS_DEFAULT_REGION=us-east-1 packer build -var AmiImageName=my-test-image -var PACKER_LOG=1 template.json ``` @@ -56,19 +71,10 @@ Packer will do the following: __Notes__: * Packer deploys a new AMI to the AWS account specified by the AwsProfile * Subsequent builds may require the [-force](https://packer.io/docs/commands/build.html#force) flag + * Test AMIs can be built automatically by pushing directly to a branch beginning with `test/` -### Image Accessability -This project is setup to build publicly accessible images. To change it to -build private images please refer to the [packer documentation](https://packer.io/docs/builders/amazon-ebs.html) -for `ami_users` and `snapshot_users`options. - -### Testing -As a pre-deployment step we syntatically validate our packer json -files with [pre-commit](https://pre-commit.com). - -Please install pre-commit, once installed the file validations will -automatically run on every commit. Alternatively you can manually -execute the validations by running `pre-commit run --all-files`. +The process for testing the integration of an AMI with cloudformation init scripts +is outlined in the [`organizations-infra` docs for service catalog](https://github.com/Sage-Bionetworks-IT/organizations-infra/blob/master/sceptre/scipool/README.md) ### CI Workflow The workflow to provision AWS AMI is done using pull requests.