Skip to content

Commit

Permalink
Merge pull request #9 from DFE-Digital/enable-dev-deployments
Browse files Browse the repository at this point in the history
Add new booleans to enable deployments to non-prod environments
  • Loading branch information
pritchyspritch authored Nov 14, 2024
2 parents 43c7dd8 + 9a7449f commit d9f4716
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify_tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Check action.yml tag
id: action-tag
run: |
echo action_version=$(grep '==' action.yml | cut -d'=' -f3) >> $GITHUB_OUTPUT
echo action_version=$(grep 'packager==' action.yml | cut -d'=' -f3) >> $GITHUB_OUTPUT
- name: Verify tags
run: |
Expand Down
22 changes: 20 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ inputs:
required: true
type: string
default: config.toml
production:
description: Boolean stating you would like to push to production
required: false
type: boolean
default: true
runs:
using: composite
steps:
Expand All @@ -38,13 +43,26 @@ runs:

- name: Install splunk-app-packager
shell: bash
run: pip install splunk-app-packager==0.0.2
run: pip install splunk-app-packager==0.0.3

- name: package, validate, deploy
- name: package, validate, deploy (production)
shell: bash
env:
SPLUNK_USER: ${{ inputs.splunk_username }}
SPLUNK_PASSWORD: ${{ inputs.splunk_password }}
SPLUNK_ACS_TOKEN: ${{ inputs.splunk_acs_token }}
SPLUNK_ACS_STACK: ${{ inputs.splunk_acs_stack }}
run: sap --prod ${{ inputs.app_package_path }} --config-path ${{ inputs.config_toml_path }}
if: ${{ inputs.production == true }}


- name: package, validate, deploy (development)
shell: bash
env:
SPLUNK_USER: ${{ inputs.splunk_username }}
SPLUNK_PASSWORD: ${{ inputs.splunk_password }}
SPLUNK_ACS_TOKEN: ${{ inputs.splunk_acs_token }}
SPLUNK_ACS_STACK: ${{ inputs.splunk_acs_stack }}
run: sap ${{ inputs.app_package_path }} --config-path ${{ inputs.config_toml_path }}
if: ${{ inputs.production == false }}

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "splunk_app_packager"
version = "0.0.2"
version = "0.0.3"
authors = [
{ name="Sam Pritchard", email="47423802+pritchyspritch@users.noreply.github.com" },
{ name="Ian Pearl", email="ian.pearl@education.gov.uk" },
Expand Down

0 comments on commit d9f4716

Please sign in to comment.