mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
443d2471d2
# Checklist for submitter If some of the following don't apply, delete the relevant line. - [ ] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [ ] Documented any API changes (docs/Using-Fleet/REST-API.md or docs/Contributing/API-for-contributors.md) - [ ] Documented any permissions changes - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [ ] Added/updated tests - [ ] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).
73 lines
2.6 KiB
YAML
73 lines
2.6 KiB
YAML
name: Deploy Dogfood Environment
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
DOCKER_IMAGE:
|
|
description: 'The full name of the docker image to be deployed. (e.g. fleetdm/fleet:v4.30.0)'
|
|
required: true
|
|
|
|
# This allows a subsequently queued workflow run to interrupt previous runs
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
# fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
|
|
shell: bash
|
|
working-directory: infrastructure/dogfood/terraform/aws-tf-module
|
|
|
|
env:
|
|
AWS_REGION: us-east-2
|
|
ECR_REPOSITORY: fleet-test
|
|
AWS_IAM_ROLE: arn:aws:iam::160035666661:role/github-actions-role
|
|
TF_ACTIONS_WORKING_DIR: infrastructure/dogfood/terraform/aws-tf-module
|
|
TF_WORKSPACE: fleet
|
|
TF_VAR_fleet_image: ${{ github.event.inputs.DOCKER_IMAGE || 'fleetdm/fleet:main' }}
|
|
TF_VAR_fleet_license: ${{ secrets.DOGFOOD_LICENSE_KEY }}
|
|
TF_VAR_slack_webhook: ${{ secrets.SLACK_G_HELP_P1_WEBHOOK_URL }}
|
|
TF_VAR_fleet_sentry_dsn: ${{ secrets.DOGFOOD_SENTRY_DSN }}
|
|
TF_VAR_elastic_url: ${{ secrets.ELASTIC_APM_SERVER_URL }}
|
|
TF_VAR_elastic_token: ${{ secrets.ELASTIC_APM_SECRET_TOKEN }}
|
|
|
|
permissions:
|
|
id-token: write
|
|
contents: read # This is required for actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy Fleet Dogfood Environment
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
|
- id: fail-on-main
|
|
run: "false"
|
|
if: ${{ github.ref == 'main' }}
|
|
- uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
|
with:
|
|
role-to-assume: ${{env.AWS_IAM_ROLE}}
|
|
aws-region: ${{ env.AWS_REGION }}
|
|
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
|
|
with:
|
|
terraform_version: 1.3.8
|
|
terraform_wrapper: false
|
|
- name: Terraform Init
|
|
id: init
|
|
run: terraform init
|
|
- name: Terraform fmt
|
|
id: fmt
|
|
run: terraform fmt -check
|
|
continue-on-error: true
|
|
- name: Terraform Validate
|
|
id: validate
|
|
run: terraform validate -no-color
|
|
- name: Terraform Plan
|
|
id: plan
|
|
run: terraform plan -no-color
|
|
continue-on-error: true
|
|
# first we'll scale everything down and create the new task definitions
|
|
- name: Terraform Apply
|
|
id: apply
|
|
run: terraform apply -auto-approve
|