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

[IT-3523] Run the deploy for test branches #23

Merged
merged 1 commit into from
Dec 12, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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.
Expand Down
Loading