From aa0ba1e2d0f574795529c79e3193b9ab82580a2a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Mar 2026 06:21:41 +0000 Subject: [PATCH 1/7] feat: migrate to stackql-deploy Rust binary (v2.x) with AWS SSM test workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - action.yml: replace Python/pip install with `cargo install stackql-deploy` (the Rust binary from crates.io); remove custom_registry input; make stack_dir/stack_env optional to support the info command; guard --output-file to build command only; expand supported commands to include teardown - workflows: replace k8s test with end-to-end AWS SSM parameter lifecycle: deploy → test → manifest tag update → redeploy → test → teardown (always) - examples/aws-ssm-parameter: new minimal stack demonstrating awscc SSM parameter create/update/delete with the Rust stackql-deploy binary https://claude.ai/code/session_01JCJyZX33jGMPqKd77jYnkX --- .../workflows/stackql-deploy-actions-test.yml | 91 ++++++++++++++++--- action.yml | 76 ++++++++-------- .../resources/aws/ssm/parameters.iql | 71 +++++++++++++++ .../aws-ssm-parameter/stackql_manifest.yml | 46 ++++++++++ 4 files changed, 235 insertions(+), 49 deletions(-) create mode 100644 examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql create mode 100644 examples/aws-ssm-parameter/stackql_manifest.yml diff --git a/.github/workflows/stackql-deploy-actions-test.yml b/.github/workflows/stackql-deploy-actions-test.yml index ee12c0a..c9c4370 100644 --- a/.github/workflows/stackql-deploy-actions-test.yml +++ b/.github/workflows/stackql-deploy-actions-test.yml @@ -1,31 +1,96 @@ -name: Test StackQL Deploy Action +name: StackQL Deploy Action Test (AWS SSM) on: push: branches: - main + jobs: - stackql-actions-test: - name: StackQL Actions Test + aws-ssm-test: + name: Deploy, Test, Update, and Teardown AWS SSM Parameter runs-on: ubuntu-latest env: - GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} - + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} + steps: - name: Checkout - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4 + + # ----------------------------------------------------------------------- + # Step 1: Deploy the SSM parameter + # ----------------------------------------------------------------------- + - name: Deploy SSM Parameter + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + + # ----------------------------------------------------------------------- + # Step 2: Test the deployed SSM parameter + # ----------------------------------------------------------------------- + - name: Test SSM Parameter + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + + # ----------------------------------------------------------------------- + # Step 3: Update the manifest - add an extra tag + # ----------------------------------------------------------------------- + - name: Update Manifest - Add Tag + shell: bash + run: | + # Append an additional tag to the test_ssm_parameter resource tags value. + # yq v4 is pre-installed on ubuntu-latest runners. + yq -i ' + (.resources[] | select(.name == "test_ssm_parameter") | .props[] | select(.name == "tags")).value += + [{"Key": "stackql:updated", "Value": "true"}] + ' examples/aws-ssm-parameter/stackql_manifest.yml - - name: StackQL Deploy Info + echo "Updated manifest:" + cat examples/aws-ssm-parameter/stackql_manifest.yml + + # ----------------------------------------------------------------------- + # Step 4: Redeploy with the updated manifest (tag update) + # ----------------------------------------------------------------------- + - name: Redeploy SSM Parameter with Updated Tag uses: ./ with: - command: 'info' + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' - - name: Run StackQL Deploy Action + # ----------------------------------------------------------------------- + # Step 5: Test again after the update + # ----------------------------------------------------------------------- + - name: Test SSM Parameter (Post-Update) uses: ./ with: command: 'test' - stack_dir: 'examples/k8s-the-hard-way' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + + # ----------------------------------------------------------------------- + # Step 6: Teardown - always run to avoid leaving resources behind + # ----------------------------------------------------------------------- + - name: Teardown SSM Parameter + if: always() + uses: ./ + with: + command: 'teardown' + stack_dir: 'examples/aws-ssm-parameter' stack_env: 'dev' - env_vars: 'GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo' - # log_level: 'debug' - output_file: 'deployment-outputs.json' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' diff --git a/action.yml b/action.yml index 9f127e6..3e839e5 100644 --- a/action.yml +++ b/action.yml @@ -1,15 +1,15 @@ name: 'stackql-deploy' -description: 'Deploy and test stacks using stackql-deploy' +description: 'Deploy and test stacks using stackql-deploy (Rust edition)' inputs: command: - description: 'stackql-deploy command to run (`build` or `test`)' + description: 'stackql-deploy command to run (`build`, `test`, `teardown`, or `info`)' required: true stack_dir: description: 'repo directory containing `stackql_manifest.yml` and `resources` dir' - required: true + required: false stack_env: description: 'environment to deploy or test (e.g., `dev`, `prod`)' - required: true + required: false env_vars: description: 'environment variables or secrets imported into a stack (format: `KEY=value,KEY2=value2`)' required: false @@ -20,22 +20,19 @@ inputs: description: 'show queries run in the output logs' required: false log_level: - description: 'set the logging level (`INFO` or `DEBUG`, defaults to `INFO`)' - required: false + description: 'set the logging level (`info`, `debug`, `trace`, `warn`, or `error`, defaults to `info`)' + required: false dry_run: description: 'perform a dry run of the operation' required: false - custom_registry: - description: 'custom registry URL to be used for stackql' - required: false on_failure: - description: 'action on failure' + description: 'action on failure (`error`, `rollback`, or `ignore`, defaults to `error`)' required: false show_info: - description: 'show stackql-deploy info output' + description: 'show stackql-deploy info output before running the command' required: false output_file: - description: 'output file to capture deployment outputs (JSON format)' + description: 'output file to capture deployment outputs as JSON (supported for `build` command only)' required: false outputs: @@ -46,14 +43,15 @@ outputs: runs: using: 'composite' steps: - - name: Install Python - uses: actions/setup-python@v6.0.0 - with: - python-version: '3.13' - - name: Install stackql-deploy shell: bash - run: pip install -q stackql-deploy pyyaml || { echo "pip install failed"; exit 1; } + run: | + if ! command -v stackql-deploy &> /dev/null; then + echo "Installing stackql-deploy from crates.io..." + cargo install stackql-deploy || { echo "cargo install failed"; exit 1; } + else + echo "stackql-deploy already installed: $(stackql-deploy --version 2>/dev/null || echo 'version unknown')" + fi - name: Run stackql-deploy id: stackql-deploy @@ -66,6 +64,13 @@ runs: echo "" fi + # Handle info command (no stack_dir/stack_env needed) + if [ "${{ inputs.command }}" == "info" ]; then + stackql-deploy info + exit 0 + fi + + # Build env var options (-e KEY=VALUE ...) ENV_OPTS="" if [ -n "${{ inputs.env_vars }}" ]; then IFS=',' read -r -a env_array <<< "${{ inputs.env_vars }}" @@ -74,7 +79,15 @@ runs: done fi - STACKQL_DEPLOY_CMD="stackql-deploy ${{ inputs.command }} ${{ inputs.stack_dir }} ${{ inputs.stack_env }}" + STACKQL_DEPLOY_CMD="stackql-deploy ${{ inputs.command }}" + + # Append positional args only when provided + if [ -n "${{ inputs.stack_dir }}" ]; then + STACKQL_DEPLOY_CMD+=" ${{ inputs.stack_dir }}" + fi + if [ -n "${{ inputs.stack_env }}" ]; then + STACKQL_DEPLOY_CMD+=" ${{ inputs.stack_env }}" + fi if [ -n "${{ inputs.env_file }}" ]; then STACKQL_DEPLOY_CMD+=" --env-file ${{ inputs.env_file }}" @@ -88,28 +101,25 @@ runs: if [ "${{ inputs.dry_run }}" == "true" ]; then STACKQL_DEPLOY_CMD+=" --dry-run" fi - if [ -n "${{ inputs.custom_registry }}" ]; then - STACKQL_DEPLOY_CMD+=" --custom-registry ${{ inputs.custom_registry }}" - fi if [ -n "${{ inputs.on_failure }}" ]; then STACKQL_DEPLOY_CMD+=" --on-failure ${{ inputs.on_failure }}" fi - - # Handle output file + + # --output-file is only supported by the build command OUTPUT_FILE="" - if [ -n "${{ inputs.output_file }}" ]; then + if [ -n "${{ inputs.output_file }}" ] && [ "${{ inputs.command }}" == "build" ]; then OUTPUT_FILE="${{ inputs.output_file }}" STACKQL_DEPLOY_CMD+=" --output-file $OUTPUT_FILE" fi echo "executing: $STACKQL_DEPLOY_CMD $ENV_OPTS" - + # Run command and capture exit code set +e $STACKQL_DEPLOY_CMD $ENV_OPTS EXIT_CODE=$? set -e - + # Handle failure if [ $EXIT_CODE -ne 0 ]; then echo "## ❌ StackQL Deploy ${{ inputs.command }} Failed" >> $GITHUB_STEP_SUMMARY @@ -123,24 +133,18 @@ runs: exit $EXIT_CODE fi - # Capture outputs if output file was specified (success path) + # Capture outputs if output file was specified (build command, success path) if [ -n "$OUTPUT_FILE" ] && [ -f "$OUTPUT_FILE" ]; then - # Read the JSON content DEPLOYMENT_OUTPUTS=$(cat "$OUTPUT_FILE") - - # Set the outputs for the action + echo "deployment_outputs<> $GITHUB_OUTPUT echo "$DEPLOYMENT_OUTPUTS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - # Add to job summary with formatted output + echo "## 📦 StackQL Deploy ${{ inputs.command }}:" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - - # Parse and display each key-value pair echo "$DEPLOYMENT_OUTPUTS" | jq -r 'to_entries[] | "**\(.key):** \(.value)"' >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "_Completed at $(date -u +'%Y-%m-%d %H:%M:%S UTC')_" >> $GITHUB_STEP_SUMMARY echo "Deployment outputs captured successfully" diff --git a/examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql b/examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql new file mode 100644 index 0000000..a569380 --- /dev/null +++ b/examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql @@ -0,0 +1,71 @@ +/*+ exists */ +SELECT count(*) as count +FROM awscc.ssm.parameters +WHERE region = '{{ region }}' AND +Identifier = '{{ name }}' +; +/*+ create */ +INSERT INTO awscc.ssm.parameters ( + Type, + Value, + Description, + Policies, + AllowedPattern, + Tier, + Tags, + DataType, + Name, + region +) +SELECT + '{{ type }}', + '{{ value }}', + '{{ description }}', + '{{ policies }}', + '{{ allowed_pattern }}', + '{{ tier }}', + '{{ tags }}', + '{{ data_type }}', + '{{ name }}', + '{{ region }}'; +/*+ update */ +UPDATE awscc.ssm.parameters +SET PatchDocument = string('{{ { + "Type": type, + "Value": value, + "Description": description, + "Policies": policies, + "AllowedPattern": allowed_pattern, + "Tier": tier, + "Tags": tags, + "DataType": data_type +} | generate_patch_document }}') +WHERE + region = '{{ region }}' AND + Identifier = '{{ name }}'; +/*+ statecheck, retries=5, retry_delay=10 */ +SELECT count(*) as count +FROM awscc.ssm.parameters +WHERE +region = '{{ region }}' AND +Identifier = '{{ name }}' +; +/*+ exports */ +SELECT +type, +value, +description, +policies, +allowed_pattern, +tier, +tags, +data_type, +name +FROM awscc.ssm.parameters +WHERE region = '{{ region }}' AND +Identifier = '{{ name }}'; +/*+ delete */ +DELETE FROM awscc.ssm.parameters +WHERE + Identifier = '{{ name }}' AND + region = '{{ region }}'; diff --git a/examples/aws-ssm-parameter/stackql_manifest.yml b/examples/aws-ssm-parameter/stackql_manifest.yml new file mode 100644 index 0000000..1bb9db2 --- /dev/null +++ b/examples/aws-ssm-parameter/stackql_manifest.yml @@ -0,0 +1,46 @@ +version: 1 +name: "stackql-deploy-action-test" +description: SSM parameter test stack for stackql-deploy-action CI validation +providers: + - awscc +globals: + - name: region + description: aws region + value: "{{ AWS_REGION }}" + - name: global_tags + value: + - Key: 'stackql:stack-name' + Value: "{{ stack_name }}" + - Key: 'stackql:stack-env' + Value: "{{ stack_env }}" + - Key: 'stackql:resource-name' + Value: "{{ resource_name }}" +resources: + + - name: test_ssm_parameter + file: aws/ssm/parameters.iql + props: + - name: name + value: "/{{ stack_name }}/{{ stack_env }}/test-param" + - name: type + value: "String" + - name: value + value: "stackql-deploy-action-test-value" + - name: description + value: "Test SSM parameter for stackql-deploy-action CI" + - name: policies + value: "" + - name: allowed_pattern + value: "" + - name: tier + value: "Standard" + - name: tags + value: [] + merge: + - global_tags + - name: data_type + value: "text" + exports: + - name + - value + - type From 7252a20555934050fbdd470210df0c932aa9c297 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 19:00:00 +1100 Subject: [PATCH 2/7] added local test --- .gitignore | 4 + .../resources/aws/ssm/parameters.iql | 11 +- .../aws-ssm-parameter/stackql_manifest.yml | 18 +- examples/k8s-the-hard-way/README.md | 57 ----- .../k8s-the-hard-way/resources/firewalls.iql | 33 --- .../resources/forwarding_rule.iql | 36 --- .../resources/get_controller_instances.iql | 6 - .../resources/health_checks.iql | 45 ---- .../k8s-the-hard-way/resources/instances.iql | 60 ----- .../k8s-the-hard-way/resources/network.iql | 43 ---- .../resources/public_address.iql | 35 --- .../k8s-the-hard-way/resources/routes.iql | 45 ---- .../k8s-the-hard-way/resources/subnetwork.iql | 54 ----- .../resources/target_pool.iql | 42 ---- .../k8s-the-hard-way/stackql_manifest.yml | 222 ------------------ examples/workflow-with-outputs.yml | 78 ------ local_setup.sh | 2 + local_test.sh | 60 +++++ 18 files changed, 75 insertions(+), 776 deletions(-) create mode 100644 .gitignore delete mode 100644 examples/k8s-the-hard-way/README.md delete mode 100644 examples/k8s-the-hard-way/resources/firewalls.iql delete mode 100644 examples/k8s-the-hard-way/resources/forwarding_rule.iql delete mode 100644 examples/k8s-the-hard-way/resources/get_controller_instances.iql delete mode 100644 examples/k8s-the-hard-way/resources/health_checks.iql delete mode 100644 examples/k8s-the-hard-way/resources/instances.iql delete mode 100644 examples/k8s-the-hard-way/resources/network.iql delete mode 100644 examples/k8s-the-hard-way/resources/public_address.iql delete mode 100644 examples/k8s-the-hard-way/resources/routes.iql delete mode 100644 examples/k8s-the-hard-way/resources/subnetwork.iql delete mode 100644 examples/k8s-the-hard-way/resources/target_pool.iql delete mode 100644 examples/k8s-the-hard-way/stackql_manifest.yml delete mode 100644 examples/workflow-with-outputs.yml create mode 100644 local_setup.sh create mode 100644 local_test.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d124f27 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +stackql* +.stackql/ +.env +.claude \ No newline at end of file diff --git a/examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql b/examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql index a569380..dda1358 100644 --- a/examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql +++ b/examples/aws-ssm-parameter/resources/aws/ssm/parameters.iql @@ -4,13 +4,12 @@ FROM awscc.ssm.parameters WHERE region = '{{ region }}' AND Identifier = '{{ name }}' ; + /*+ create */ INSERT INTO awscc.ssm.parameters ( Type, Value, Description, - Policies, - AllowedPattern, Tier, Tags, DataType, @@ -21,21 +20,18 @@ SELECT '{{ type }}', '{{ value }}', '{{ description }}', - '{{ policies }}', - '{{ allowed_pattern }}', '{{ tier }}', '{{ tags }}', '{{ data_type }}', '{{ name }}', '{{ region }}'; + /*+ update */ UPDATE awscc.ssm.parameters SET PatchDocument = string('{{ { "Type": type, "Value": value, "Description": description, - "Policies": policies, - "AllowedPattern": allowed_pattern, "Tier": tier, "Tags": tags, "DataType": data_type @@ -43,6 +39,7 @@ SET PatchDocument = string('{{ { WHERE region = '{{ region }}' AND Identifier = '{{ name }}'; + /*+ statecheck, retries=5, retry_delay=10 */ SELECT count(*) as count FROM awscc.ssm.parameters @@ -50,6 +47,7 @@ WHERE region = '{{ region }}' AND Identifier = '{{ name }}' ; + /*+ exports */ SELECT type, @@ -64,6 +62,7 @@ name FROM awscc.ssm.parameters WHERE region = '{{ region }}' AND Identifier = '{{ name }}'; + /*+ delete */ DELETE FROM awscc.ssm.parameters WHERE diff --git a/examples/aws-ssm-parameter/stackql_manifest.yml b/examples/aws-ssm-parameter/stackql_manifest.yml index 1bb9db2..a51712d 100644 --- a/examples/aws-ssm-parameter/stackql_manifest.yml +++ b/examples/aws-ssm-parameter/stackql_manifest.yml @@ -9,14 +9,10 @@ globals: value: "{{ AWS_REGION }}" - name: global_tags value: - - Key: 'stackql:stack-name' - Value: "{{ stack_name }}" - - Key: 'stackql:stack-env' - Value: "{{ stack_env }}" - - Key: 'stackql:resource-name' - Value: "{{ resource_name }}" + 'stackql:stack-name': "{{ stack_name }}" + 'stackql:stack-env': "{{ stack_env }}" + 'stackql:resource-name': "{{ resource_name }}" resources: - - name: test_ssm_parameter file: aws/ssm/parameters.iql props: @@ -28,16 +24,10 @@ resources: value: "stackql-deploy-action-test-value" - name: description value: "Test SSM parameter for stackql-deploy-action CI" - - name: policies - value: "" - - name: allowed_pattern - value: "" - name: tier value: "Standard" - name: tags - value: [] - merge: - - global_tags + value: "{{ global_tags }}" - name: data_type value: "text" exports: diff --git a/examples/k8s-the-hard-way/README.md b/examples/k8s-the-hard-way/README.md deleted file mode 100644 index 6cee363..0000000 --- a/examples/k8s-the-hard-way/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# example `stackql-deploy` stack - -Based upon the [Kubernetes the Hard Way](https://github.com/kelseyhightower/kubernetes-the-hard-way) project. - -## about `stackql-deploy` - -[`stackql-deploy`](https://pypi.org/project/stackql-deploy/) is a multi cloud deployment automation and testing framework which is an alternative to Terraform or similar IaC tools. `stackql-deploy` uses a declarative model/ELT based approach to cloud resource deployment (inspired by [`dbt`](https://www.getdbt.com/)). Advantages of `stackql-deploy` include: - -- declarative framework -- no state file (state is determined from the target environment) -- multi-cloud/omni-cloud ready -- includes resource tests which can include secure config tests - -## instaling `stackql-deploy` - -`stackql-deploy` is installed as a python based CLI using... - -```bash -pip install stackql-deploy -``` - -## getting started with `stackql-deploy` - -Once installed, use the `init` command to scaffold a sample project directory to get started: - -```bash -stackql-deploy init k8s-the-hard-way -``` - -this will create a directory named `k8s-the-hard-way` which can be updated for your stack, as you can see in this project. - -## deploying using `stackql-deploy` - -```bash -export GOOGLE_CREDENTIALS=$(cat ./creds.json) -# deploy a stack -stackql-deploy build \ -k8s-the-hard-way \ -dev \ --e GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo \ ---dry-run \ ---log-leve DEBUG - -# test a stack -stackql-deploy test \ -examples/k8s-the-hard-way \ -dev \ --e GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo \ ---dry-run - -# teardown a stack -stackql-deploy teardown \ -k8s-the-hard-way \ -dev \ --e GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo \ ---dry-run -``` diff --git a/examples/k8s-the-hard-way/resources/firewalls.iql b/examples/k8s-the-hard-way/resources/firewalls.iql deleted file mode 100644 index c936034..0000000 --- a/examples/k8s-the-hard-way/resources/firewalls.iql +++ /dev/null @@ -1,33 +0,0 @@ -/*+ preflight */ -SELECT COUNT(*) as count FROM google.compute.firewalls -WHERE project = '{{ project }}' -AND name = '{{ fw_name }}' - -/*+ create */ -INSERT INTO google.compute.firewalls -( - project, - data__name, - data__network, - data__direction, - data__sourceRanges, - data__allowed -) -SELECT - '{{ project }}', - '{{ fw_name}}', - '{{ vpc_link }}', - '{{ fw_direction }}', - '{{ fw_source_ranges }}', - '{{ fw_allowed }}' - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT COUNT(*) as count FROM google.compute.firewalls -WHERE project = '{{ project }}' -AND name = '{{ fw_name }}' -AND network = '{{ vpc_link }}' - -/*+ delete, retries=20, retry_delay=10 */ -DELETE FROM google.compute.firewalls -WHERE project = '{{ project }}' -AND firewall = '{{ fw_name }}' \ No newline at end of file diff --git a/examples/k8s-the-hard-way/resources/forwarding_rule.iql b/examples/k8s-the-hard-way/resources/forwarding_rule.iql deleted file mode 100644 index 2eefe16..0000000 --- a/examples/k8s-the-hard-way/resources/forwarding_rule.iql +++ /dev/null @@ -1,36 +0,0 @@ -/*+ preflight */ -SELECT COUNT(*) as count FROM google.compute.forwarding_rules -WHERE region = '{{ region }}' -AND project = '{{ project }}' -AND forwardingRule = '{{ forwarding_rule_name }}' - -/*+ create */ -INSERT INTO google.compute.forwarding_rules( - project, - region, - data__name, - data__IPAddress, - data__loadBalancingScheme, - data__portRange, - data__target -) -SELECT - '{{ project }}', - '{{ region }}', - '{{ forwarding_rule_name }}', - '{{ address }}', - '{{ forwarding_rule_load_balancing_scheme }}', - '{{ forwarding_rule_port_range }}', - '{{ target_pool_link }}' - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT COUNT(*) as count FROM google.compute.forwarding_rules -WHERE region = '{{ region }}' -AND project = '{{ project }}' -AND forwardingRule = '{{ forwarding_rule_name }}' - -/*+ delete, retries=20, retry_delay=10 */ -DELETE FROM google.compute.forwarding_rules -WHERE project = '{{ project }}' - AND region = '{{ region }}' - AND forwardingRule = '{{ forwarding_rule_name }}' \ No newline at end of file diff --git a/examples/k8s-the-hard-way/resources/get_controller_instances.iql b/examples/k8s-the-hard-way/resources/get_controller_instances.iql deleted file mode 100644 index 36d7aef..0000000 --- a/examples/k8s-the-hard-way/resources/get_controller_instances.iql +++ /dev/null @@ -1,6 +0,0 @@ -/*+ exports */ -SELECT JSON_GROUP_ARRAY(json_object('instance', selfLink)) as controller_instances -FROM google.compute.instances -WHERE project = '{{ project }}' -AND zone = '{{ default_zone }}' -AND name like '%-{{ stack_env }}-controller-%' \ No newline at end of file diff --git a/examples/k8s-the-hard-way/resources/health_checks.iql b/examples/k8s-the-hard-way/resources/health_checks.iql deleted file mode 100644 index 1db865e..0000000 --- a/examples/k8s-the-hard-way/resources/health_checks.iql +++ /dev/null @@ -1,45 +0,0 @@ -/*+ preflight */ -SELECT COUNT(*) as count FROM google.compute.http_health_checks -WHERE project = '{{ project }}' -AND httpHealthCheck = '{{ health_check_name }}' - -/*+ create */ -INSERT INTO google.compute.http_health_checks( - project, - data__name, - data__checkIntervalSec, - data__description, - data__healthyThreshold, - data__host, - data__port, - data__requestPath, - data__timeoutSec, - data__unhealthyThreshold -) -SELECT - '{{ project }}', - '{{ health_check_name }}', - {{ health_check_interval_sec }}, - '{{ health_check_description }}', - {{ health_check_healthy_threshold }}, - '{{ health_check_host }}', - {{ health_check_port }}, - '{{ health_check_path }}', - {{ health_check_timeout_sec }}, - {{ health_check_unhealthy_threshold }} - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT COUNT(*) as count FROM google.compute.http_health_checks -WHERE project = '{{ project }}' -AND httpHealthCheck = '{{ health_check_name }}' - -/*+ delete, retries=20, retry_delay=10 */ -DELETE FROM google.compute.http_health_checks -WHERE project = '{{ project }}' -AND httpHealthCheck = '{{ health_check_name }}' - -/*+ exports */ -SELECT selfLink as health_check_link -FROM google.compute.http_health_checks -WHERE project = '{{ project }}' -AND httpHealthCheck = '{{ health_check_name }}' \ No newline at end of file diff --git a/examples/k8s-the-hard-way/resources/instances.iql b/examples/k8s-the-hard-way/resources/instances.iql deleted file mode 100644 index 7ca29f3..0000000 --- a/examples/k8s-the-hard-way/resources/instances.iql +++ /dev/null @@ -1,60 +0,0 @@ -/*+ preflight */ -SELECT - CASE - WHEN COUNT(*) = {{ num_instances | int }} THEN 1 - ELSE 0 - END AS count -FROM google.compute.instances -WHERE project = '{{ project }}' -AND zone = '{{ default_zone }}' -AND instance IN ({% for i in range(num_instances | int) %}'{{ instance_name_prefix }}-{{ loop.index }}'{% if not loop.last %}, {% endif %}{% endfor %}) - -/*+ create */ -{% for network_interface in network_interfaces %} -INSERT INTO google.compute.instances - ( - zone, - project, - data__name, - data__machineType, - data__canIpForward, - data__deletionProtection, - data__scheduling, - data__networkInterfaces, - data__disks, - data__serviceAccounts, - data__tags - ) - SELECT -'{{ default_zone }}', -'{{ project }}', -'{{ instance_name_prefix }}-{{ loop.index }}', -'{{ machine_type }}', -true, -false, -'{{ scheduling | tojson }}', -'{{ network_interface | tojson }}', -'{{ disks | tojson }}', -'{{ service_accounts | tojson }}', -'{{ tags | tojson }}'; -{% endfor %} - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT - CASE - WHEN COUNT(*) = {{ num_instances | int }} THEN 1 - ELSE 0 - END AS count -FROM google.compute.instances -WHERE project = '{{ project }}' -AND zone = '{{ default_zone }}' -AND status = 'RUNNING' -AND instance IN ({% for i in range(num_instances | int) %}'{{ instance_name_prefix }}-{{ loop.index }}'{% if not loop.last %}, {% endif %}{% endfor %}) - -/*+ delete */ -{% for network_interface in network_interfaces %} -DELETE FROM google.compute.instances -WHERE project = '{{ project }}' -AND zone = '{{ default_zone }}' -AND instance = '{{ instance_name_prefix }}-{{ loop.index }}'; -{% endfor %} \ No newline at end of file diff --git a/examples/k8s-the-hard-way/resources/network.iql b/examples/k8s-the-hard-way/resources/network.iql deleted file mode 100644 index de84c88..0000000 --- a/examples/k8s-the-hard-way/resources/network.iql +++ /dev/null @@ -1,43 +0,0 @@ -/*+ preflight */ -SELECT COUNT(*) as count FROM google.compute.networks -WHERE name = '{{ vpc_name }}' -AND project = '{{ project }}' - -/*+ create */ -INSERT INTO google.compute.networks -( - project, - data__name, - data__autoCreateSubnetworks, - data__routingConfig -) -SELECT -'{{ project }}', -'{{ vpc_name }}', -false, -'{"routingMode": "REGIONAL"}' - -/*+ update */ -UPDATE google.compute.networks -SET data__autoCreateSubnetworks = false -AND data__routingConfig = '{"routingMode": "REGIONAL"}' -WHERE network = '{{ vpc_name }}' AND project = '{{ project }}' - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT COUNT(*) as count FROM google.compute.networks -WHERE name = '{{ vpc_name }}' -AND project = '{{ project }}' -AND autoCreateSubnetworks = false -AND JSON_EXTRACT(routingConfig, '$.routingMode') = 'REGIONAL' - -/*+ delete, retries=20, retry_delay=10 */ -DELETE FROM google.compute.networks -WHERE network = '{{ vpc_name }}' AND project = '{{ project }}' - -/*+ exports */ -SELECT -'{{ vpc_name }}' as vpc_name, -selfLink as vpc_link -FROM google.compute.networks -WHERE name = '{{ vpc_name }}' -AND project = '{{ project }}' diff --git a/examples/k8s-the-hard-way/resources/public_address.iql b/examples/k8s-the-hard-way/resources/public_address.iql deleted file mode 100644 index d187748..0000000 --- a/examples/k8s-the-hard-way/resources/public_address.iql +++ /dev/null @@ -1,35 +0,0 @@ -/*+ preflight */ -SELECT COUNT(*) as count FROM google.compute.addresses -WHERE name = '{{ address_name }}' -AND project = '{{ project }}' -AND region = '{{ region }}' - -/*+ create */ -INSERT INTO google.compute.addresses -( - project, - region, - data__name -) -SELECT -'{{ project }}', -'{{ region }}', -'{{ address_name }}' - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT COUNT(*) as count FROM google.compute.addresses -WHERE name = '{{ address_name }}' -AND project = '{{ project }}' -AND region = '{{ region }}' - -/*+ delete */ -DELETE FROM google.compute.addresses -WHERE address = '{{ address_name }}' AND project = '{{ project }}' -AND region = '{{ region }}' - -/*+ exports */ -SELECT address -FROM google.compute.addresses -WHERE name = '{{ address_name }}' -AND project = '{{ project }}' -AND region = '{{ region }}' diff --git a/examples/k8s-the-hard-way/resources/routes.iql b/examples/k8s-the-hard-way/resources/routes.iql deleted file mode 100644 index a1b24e1..0000000 --- a/examples/k8s-the-hard-way/resources/routes.iql +++ /dev/null @@ -1,45 +0,0 @@ -/*+ preflight */ -SELECT - CASE - WHEN COUNT(*) = {{ num_routes | int }} THEN 1 - ELSE 0 - END AS count -FROM google.compute.routes -WHERE project = '{{ project }}' -AND route IN ({% for i in range(num_routes | int) %}'{{ route_name_prefix }}-{{ loop.index }}'{% if not loop.last %}, {% endif %}{% endfor %}) - -/*+ create */ -{% for route in route_data %} -INSERT INTO google.compute.routes( - project, - data__destRange, - data__name, - data__network, - data__nextHopIp, - data__priority -) -SELECT - '{{ project }}', - '{{ route.dest_range }}', - '{{ route_name_prefix }}-{{ loop.index }}', - '{{ vpc_link }}', - '{{ route.next_hop_ip }}', - {{ route_priority }}; -{% endfor %} - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT - CASE - WHEN COUNT(*) = {{ num_routes | int }} THEN 1 - ELSE 0 - END AS count -FROM google.compute.routes -WHERE project = '{{ project }}' -AND route IN ({% for i in range(num_routes | int) %}'{{ route_name_prefix }}-{{ loop.index }}'{% if not loop.last %}, {% endif %}{% endfor %}) - -/*+ delete, retries=20, retry_delay=10 */ -{% for route in route_data %} -DELETE FROM google.compute.routes -WHERE project = '{{ project }}' -AND route = '{{ route_name_prefix }}-{{ loop.index }}'; -{% endfor %} \ No newline at end of file diff --git a/examples/k8s-the-hard-way/resources/subnetwork.iql b/examples/k8s-the-hard-way/resources/subnetwork.iql deleted file mode 100644 index c66f5bb..0000000 --- a/examples/k8s-the-hard-way/resources/subnetwork.iql +++ /dev/null @@ -1,54 +0,0 @@ -/*+ preflight */ -SELECT COUNT(*) as count FROM google.compute.subnetworks -WHERE subnetwork = '{{ subnet_name }}' -AND project = '{{ project }}' -AND region = '{{ region }}' -AND network = '{{ vpc_link }}' - -/*+ create */ -INSERT INTO google.compute.subnetworks -( - project, - region, - data__name, - data__network, - data__ipCidrRange, - data__privateIpGoogleAccess -) -SELECT -'{{ project }}', -'{{ region }}', -'{{ subnet_name }}', -'{{ vpc_link }}', -'{{ ip_cidr_range }}', -true - -/*+ update */ -UPDATE google.compute.subnetworks -SET -data__name = '{{ subnet_name }}', -data__network = '{{ vpc_link }}', -data__ipCidrRange = '{{ ip_cidr_range }}', -data__privateIpGoogleAccess = true -WHERE subnetwork = '{{ subnet_name }}' -AND project = '{{ project }}' -AND region = '{{ region }}' - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT COUNT(*) as count FROM google.compute.subnetworks_usable -WHERE project = '{{ project }}' -AND subnetwork = 'https://www.googleapis.com/compute/v1/projects/{{ project }}/regions/{{ region }}/subnetworks/{{ subnet_name }}' - -/*+ delete */ -DELETE FROM google.compute.subnetworks -WHERE subnetwork = '{{ subnet_name }}' AND project = '{{ project }}' -AND region = '{{ region }}' - -/*+ exports */ -SELECT -name as subnet_name, -selfLink as subnet_link -FROM google.compute.subnetworks -WHERE subnetwork = '{{ subnet_name }}' -AND project = '{{ project }}' -AND region = '{{ region }}' diff --git a/examples/k8s-the-hard-way/resources/target_pool.iql b/examples/k8s-the-hard-way/resources/target_pool.iql deleted file mode 100644 index 4ad4a27..0000000 --- a/examples/k8s-the-hard-way/resources/target_pool.iql +++ /dev/null @@ -1,42 +0,0 @@ -/*+ preflight */ -SELECT COUNT(*) as count FROM google.compute.target_pools -WHERE project = '{{ project }}' - AND region = '{{ region }}' - AND targetPool = '{{ target_pool_name }}' - -/*+ create */ -INSERT INTO google.compute.target_pools( - project, - region, - data__name, - data__healthChecks, - data__instances, - data__sessionAffinity -) -SELECT - '{{ project }}', - '{{ region }}', - '{{ target_pool_name }}', - '{{ target_pool_health_checks }}', - '{{ target_pool_instances }}', - '{{ target_pool_session_affinity }}' - -/*+ postdeploy, retries=5, retry_delay=10 */ -SELECT COUNT(*) as count FROM google.compute.target_pools -WHERE project = '{{ project }}' - AND region = '{{ region }}' - AND targetPool = '{{ target_pool_name }}' - -/*+ delete, retries=20, retry_delay=10 */ -DELETE FROM google.compute.target_pools -WHERE project = '{{ project }}' - AND region = '{{ region }}' - AND targetPool = '{{ target_pool_name }}' - -/*+ exports */ -SELECT -selfLink as target_pool_link -FROM google.compute.target_pools -WHERE targetPool = '{{ target_pool_name }}' -AND project = '{{ project }}' -AND region = '{{ region }}' diff --git a/examples/k8s-the-hard-way/stackql_manifest.yml b/examples/k8s-the-hard-way/stackql_manifest.yml deleted file mode 100644 index 10939f0..0000000 --- a/examples/k8s-the-hard-way/stackql_manifest.yml +++ /dev/null @@ -1,222 +0,0 @@ -version: 1 -name: kubernetes-the-hard-way -description: stackql-deploy example for kubernetes-the-hard-way -providers: - - google -globals: -- name: project - description: google project name - value: "{{ GOOGLE_PROJECT }}" -- name: region - value: australia-southeast1 -- name: default_zone - value: australia-southeast1-a -resources: -- name: network - description: vpc network for k8s-the-hard-way sample app - props: - - name: vpc_name - description: name for the vpc - value: "{{ stack_name }}-{{ stack_env }}-vpc" - exports: - - vpc_name - - vpc_link -- name: subnetwork - props: - - name: subnet_name - value: "{{ stack_name }}-{{ stack_env }}-{{ region }}-subnet" - - name: ip_cidr_range - values: - prd: - value: 192.168.0.0/16 - sit: - value: 10.10.0.0/16 - dev: - value: 10.240.0.0/24 - exports: - - subnet_name - - subnet_link -# - name: public_address -# props: -# - name: address_name -# value: "{{ stack_name }}-{{ stack_env }}-{{ region }}-ip-addr" -# exports: -# - address -# - name: controller_instances -# file: instances.iql -# props: -# - name: num_instances -# value: 3 -# - name: instance_name_prefix -# value: "{{ stack_name }}-{{ stack_env }}-controller" -# - name: disks -# value: -# - autoDelete: true -# boot: true -# initializeParams: -# diskSizeGb: 10 -# sourceImage: https://compute.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts -# mode: READ_WRITE -# type: PERSISTENT -# - name: machine_type -# value: "https://compute.googleapis.com/compute/v1/projects/{{ project }}/zones/{{ default_zone }}/machineTypes/f1-micro" -# - name: scheduling -# value: {automaticRestart: true} -# - name: tags -# value: {items: ["{{ stack_name }}", "controller"]} -# - name: service_accounts -# value: -# - email: default -# scopes: -# - https://www.googleapis.com/auth/compute -# - https://www.googleapis.com/auth/devstorage.read_only -# - https://www.googleapis.com/auth/logging.write -# - https://www.googleapis.com/auth/monitoring -# - https://www.googleapis.com/auth/service.management.readonly -# - https://www.googleapis.com/auth/servicecontrol -# - name: network_interfaces -# values: -# dev: -# value: -# - {networkIP: "10.240.0.10", subnetwork: "{{ subnet_link }}", accessConfigs: [{name: external-nat, type: ONE_TO_ONE_NAT}]} -# - {networkIP: "10.240.0.11", subnetwork: "{{ subnet_link }}", accessConfigs: [{name: external-nat, type: ONE_TO_ONE_NAT}]} -# - {networkIP: "10.240.0.12", subnetwork: "{{ subnet_link }}", accessConfigs: [{name: external-nat, type: ONE_TO_ONE_NAT}]} -# - name: worker_instances -# file: instances.iql -# props: -# - name: num_instances -# value: 3 -# - name: instance_name_prefix -# value: "{{ stack_name }}-{{ stack_env }}-worker" -# - name: disks -# value: -# - autoDelete: true -# boot: true -# initializeParams: -# diskSizeGb: 10 -# sourceImage: https://compute.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts -# mode: READ_WRITE -# type: PERSISTENT -# - name: machine_type -# value: "https://compute.googleapis.com/compute/v1/projects/{{ project }}/zones/{{ default_zone }}/machineTypes/f1-micro" -# - name: scheduling -# value: {automaticRestart: true} -# - name: tags -# value: {items: ["{{ stack_name }}", "worker"]} -# - name: service_accounts -# value: -# - email: default -# scopes: -# - https://www.googleapis.com/auth/compute -# - https://www.googleapis.com/auth/devstorage.read_only -# - https://www.googleapis.com/auth/logging.write -# - https://www.googleapis.com/auth/monitoring -# - https://www.googleapis.com/auth/service.management.readonly -# - https://www.googleapis.com/auth/servicecontrol -# - name: network_interfaces -# values: -# dev: -# value: -# - {networkIP: "10.240.0.20", subnetwork: "{{ subnet_link }}", accessConfigs: [{name: external-nat, type: ONE_TO_ONE_NAT}]} -# - {networkIP: "10.240.0.21", subnetwork: "{{ subnet_link }}", accessConfigs: [{name: external-nat, type: ONE_TO_ONE_NAT}]} -# - {networkIP: "10.240.0.22", subnetwork: "{{ subnet_link }}", accessConfigs: [{name: external-nat, type: ONE_TO_ONE_NAT}]} -# - name: health_checks -# props: -# - name: health_check_name -# value: kubernetes -# - name: health_check_interval_sec -# value: 5 -# - name: health_check_description -# value: Kubernetes Health Check -# - name: health_check_timeout_sec -# value: 5 -# - name: health_check_healthy_threshold -# value: 2 -# - name: health_check_unhealthy_threshold -# value: 2 -# - name: health_check_host -# value: kubernetes.default.svc.cluster.local -# - name: health_check_port -# value: 80 -# - name: health_check_path -# value: /healthz -# exports: -# - health_check_link -# - name: internal_firewall -# file: firewalls.iql -# props: -# - name: fw_name -# value: "{{ stack_name }}-{{ stack_env }}-allow-internal-fw" -# - name: fw_direction -# value: INGRESS -# - name: fw_source_ranges -# values: -# dev: -# value: ["10.240.0.0/24", "10.200.0.0/16"] -# - name: fw_allowed -# value: [{IPProtocol: tcp}, {IPProtocol: udp}, {IPProtocol: icmp}] -# - name: external_firewall -# file: firewalls.iql -# props: -# - name: fw_name -# value: "{{ stack_name }}-{{ stack_env }}-allow-external-fw" -# - name: fw_direction -# value: INGRESS -# - name: fw_source_ranges -# values: -# dev: -# value: ["0.0.0.0/0"] -# - name: fw_allowed -# value: [{IPProtocol: tcp, ports: ["22"]}, {IPProtocol: tcp, ports: ["6443"]},{IPProtocol: icmp}] -# - name: health_check_firewall -# file: firewalls.iql -# props: -# - name: fw_name -# value: "{{ stack_name }}-{{ stack_env }}-allow-health-check-fw" -# - name: fw_direction -# value: INGRESS -# - name: fw_source_ranges -# values: -# dev: -# value: ["209.85.152.0/22", "209.85.204.0/22", "35.191.0.0/16"] -# - name: fw_allowed -# value: [{IPProtocol: tcp}] -# - name: get_controller_instances -# type: query -# exports: -# - controller_instances -# - name: target_pool -# props: -# - name: target_pool_name -# value: "{{ stack_name }}-{{ stack_env }}-target-pool" -# - name: target_pool_session_affinity -# value: NONE -# - name: target_pool_health_checks -# value: ["{{ health_check_link }}"] -# - name: target_pool_instances -# value: "{{ controller_instances }}" -# exports: -# - target_pool_link -# - name: forwarding_rule -# props: -# - name: forwarding_rule_name -# value: "{{ stack_name }}-{{ stack_env }}-forwarding-rule" -# - name: forwarding_rule_load_balancing_scheme -# value: EXTERNAL -# - name: forwarding_rule_port_range -# value: 6443 -# - name: routes -# props: -# - name: num_routes -# value: 3 -# - name: route_name_prefix -# value: "{{ stack_name }}-{{ stack_env }}-route" -# - name: route_priority -# value: 1000 -# - name: route_data -# values: -# dev: -# value: -# - {dest_range: "10.200.0.0/24", next_hop_ip: "10.240.0.20"} -# - {dest_range: "10.200.1.0/24", next_hop_ip: "10.240.0.21"} -# - {dest_range: "10.200.2.0/24", next_hop_ip: "10.240.0.22"} diff --git a/examples/workflow-with-outputs.yml b/examples/workflow-with-outputs.yml deleted file mode 100644 index c351f23..0000000 --- a/examples/workflow-with-outputs.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: StackQL Deploy with Outputs Example -on: - push: - branches: [main] - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Deploy with StackQL - id: stackql-deploy - uses: stackql/stackql-deploy-action@main - with: - command: 'build' - stack_dir: './examples/k8s-the-hard-way' - stack_env: 'prod' - output_file: 'deployment-outputs.json' - env_vars: 'PROJECT_ID=${{ secrets.GOOGLE_PROJECT_ID }},REGION=us-central1' - - - name: Display deployment outputs - run: | - echo "Deployment completed successfully!" - echo "Output file: ${{ steps.stackql-deploy.outputs.deployment_outputs_file }}" - echo "Raw outputs: ${{ steps.stackql-deploy.outputs.deployment_outputs }}" - - - name: Parse specific output values - run: | - # Parse specific values from the JSON output - WORKSPACE_NAME=$(echo '${{ steps.stackql-deploy.outputs.deployment_outputs }}' | jq -r '.databricks_workspace_name // "N/A"') - WORKSPACE_ID=$(echo '${{ steps.stackql-deploy.outputs.deployment_outputs }}' | jq -r '.databricks_workspace_id // "N/A"') - WORKSPACE_STATUS=$(echo '${{ steps.stackql-deploy.outputs.deployment_outputs }}' | jq -r '.databricks_workspace_status // "N/A"') - - echo "Workspace Name: $WORKSPACE_NAME" - echo "Workspace ID: $WORKSPACE_ID" - echo "Workspace Status: $WORKSPACE_STATUS" - - # Add to GitHub Summary - echo "## Deployment Results" >> $GITHUB_STEP_SUMMARY - echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY - echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY - echo "| Workspace Name | $WORKSPACE_NAME |" >> $GITHUB_STEP_SUMMARY - echo "| Workspace ID | $WORKSPACE_ID |" >> $GITHUB_STEP_SUMMARY - echo "| Workspace Status | $WORKSPACE_STATUS |" >> $GITHUB_STEP_SUMMARY - - - name: Use outputs in another step - if: contains(steps.stackql-deploy.outputs.deployment_outputs, 'RUNNING') - run: | - echo "Workspace is running, proceeding with post-deployment tasks..." - # Add your post-deployment logic here - - - name: Upload deployment outputs as artifact - uses: actions/upload-artifact@v4 - with: - name: deployment-outputs - path: ${{ steps.stackql-deploy.outputs.deployment_outputs_file }} - retention-days: 30 - - post-deploy: - needs: deploy - runs-on: ubuntu-latest - if: success() - steps: - - name: Download deployment outputs - uses: actions/download-artifact@v4 - with: - name: deployment-outputs - - - name: Process outputs in separate job - run: | - echo "Processing deployment outputs in a separate job..." - if [ -f "deployment-outputs.json" ]; then - cat deployment-outputs.json - # Process the outputs as needed - fi \ No newline at end of file diff --git a/local_setup.sh b/local_setup.sh new file mode 100644 index 0000000..d2d33b5 --- /dev/null +++ b/local_setup.sh @@ -0,0 +1,2 @@ +curl -L https://bit.ly/stackql-deploy-amd64 | tar -xz +./stackql-deploy info \ No newline at end of file diff --git a/local_test.sh b/local_test.sh new file mode 100644 index 0000000..51df271 --- /dev/null +++ b/local_test.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# local_test.sh - Run the same stackql-deploy steps as the GitHub Actions workflow locally. +# Prerequisites: +# 1. Run `source local_test_setup.sh` to download the stackql-deploy binary. +# 2. Ensure AWS credentials are exported (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN). +# 3. Ensure AWS_REGION is exported. +# 4. yq v4 is installed (for the manifest update step). + +set -euo pipefail + +STACKQL_DEPLOY="./stackql-deploy" +STACK_DIR="examples/aws-ssm-parameter" +STACK_ENV="dev" +LOG_LEVEL="info" +ENV_OPTS="-e AWS_REGION=${AWS_REGION:?AWS_REGION must be set}" + +run_step() { + local step_name="$1" + local command="$2" + echo "" + echo "========================================================================" + echo " ${step_name}" + echo "========================================================================" + echo "executing: ${STACKQL_DEPLOY} ${command} ${STACK_DIR} ${STACK_ENV} --log-level ${LOG_LEVEL} ${ENV_OPTS}" + ${STACKQL_DEPLOY} ${command} ${STACK_DIR} ${STACK_ENV} --log-level ${LOG_LEVEL} ${ENV_OPTS} +} + +# Step 1: Deploy +run_step "Step 1: Deploy SSM Parameter" "build" + +# Step 2: Test +run_step "Step 2: Test SSM Parameter" "test" + +# Step 3: Update manifest - add an extra tag +echo "" +echo "========================================================================" +echo " Step 3: Update Manifest - Add Tag" +echo "========================================================================" +MANIFEST="${STACK_DIR}/stackql_manifest.yml" +YQ_EXPR='(.resources[] | select(.name == "test_ssm_parameter") | .props[] | select(.name == "tags")).value += [{"Key": "stackql:updated", "Value": "true"}]' +echo "executing: yq -Y \"${YQ_EXPR}\" ${MANIFEST}" +yq -Y "${YQ_EXPR}" "${MANIFEST}" > "${MANIFEST}.tmp" && mv "${MANIFEST}.tmp" "${MANIFEST}" +echo "" +echo "Updated manifest:" +cat "${STACK_DIR}/stackql_manifest.yml" + +# Step 4: Redeploy with updated manifest +run_step "Step 4: Redeploy SSM Parameter with Updated Tag" "build" + +# Step 5: Test again after update +run_step "Step 5: Test SSM Parameter (Post-Update)" "test" + +# Step 6: Teardown (always run) +teardown() { + run_step "Step 6: Teardown SSM Parameter" "teardown" +} +trap teardown EXIT + +echo "" +echo "All steps completed successfully. Teardown will run on exit." From 7f8f7afe836d7c2bb00ccc9b3fb8369276126fb3 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 19:13:31 +1100 Subject: [PATCH 3/7] ci test fix --- .../workflows/stackql-deploy-actions-test.yml | 30 +++++++++------ action.yml | 37 +++++++++++++++++-- .../aws-ssm-parameter/stackql_manifest.yml | 2 +- local_test.sh | 14 +++---- 4 files changed, 59 insertions(+), 24 deletions(-) diff --git a/.github/workflows/stackql-deploy-actions-test.yml b/.github/workflows/stackql-deploy-actions-test.yml index c9c4370..9ca27f4 100644 --- a/.github/workflows/stackql-deploy-actions-test.yml +++ b/.github/workflows/stackql-deploy-actions-test.yml @@ -7,8 +7,17 @@ on: jobs: aws-ssm-test: - name: Deploy, Test, Update, and Teardown AWS SSM Parameter - runs-on: ubuntu-latest + name: "Test (${{ matrix.os }})" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - ubuntu-24.04-arm + - macos-latest + - macos-13 + - windows-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -43,25 +52,22 @@ jobs: log_level: 'info' # ----------------------------------------------------------------------- - # Step 3: Update the manifest - add an extra tag + # Step 3: Update the manifest - change the parameter value # ----------------------------------------------------------------------- - - name: Update Manifest - Add Tag + - name: Update Manifest - Update SSM Parameter Value shell: bash run: | - # Append an additional tag to the test_ssm_parameter resource tags value. - # yq v4 is pre-installed on ubuntu-latest runners. - yq -i ' - (.resources[] | select(.name == "test_ssm_parameter") | .props[] | select(.name == "tags")).value += - [{"Key": "stackql:updated", "Value": "true"}] - ' examples/aws-ssm-parameter/stackql_manifest.yml + # Update the SSM parameter value to test that a redeploy detects the change. + sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' examples/aws-ssm-parameter/stackql_manifest.yml + rm -f examples/aws-ssm-parameter/stackql_manifest.yml.bak echo "Updated manifest:" cat examples/aws-ssm-parameter/stackql_manifest.yml # ----------------------------------------------------------------------- - # Step 4: Redeploy with the updated manifest (tag update) + # Step 4: Redeploy with the updated manifest (value update) # ----------------------------------------------------------------------- - - name: Redeploy SSM Parameter with Updated Tag + - name: Redeploy SSM Parameter with Updated Value uses: ./ with: command: 'build' diff --git a/action.yml b/action.yml index 3e839e5..b4747e5 100644 --- a/action.yml +++ b/action.yml @@ -46,11 +46,40 @@ runs: - name: Install stackql-deploy shell: bash run: | - if ! command -v stackql-deploy &> /dev/null; then - echo "Installing stackql-deploy from crates.io..." - cargo install stackql-deploy || { echo "cargo install failed"; exit 1; } - else + if command -v stackql-deploy &> /dev/null; then echo "stackql-deploy already installed: $(stackql-deploy --version 2>/dev/null || echo 'version unknown')" + else + echo "Installing stackql-deploy binary..." + OS="$(uname -s)" + ARCH="$(uname -m)" + case "${OS}-${ARCH}" in + Linux-x86_64) URL="https://bit.ly/stackql-deploy-amd64" ;; + Linux-aarch64) URL="https://bit.ly/stackql-deploy-arm64" ;; + Darwin-arm64) URL="https://bit.ly/stackql-deploy-macos-arm64" ;; + Darwin-x86_64) URL="https://bit.ly/stackql-deploy-macos-amd64" ;; + MINGW*|MSYS*|CYGWIN*) + URL="https://bit.ly/stackql-deploy-windows" ;; + *) + echo "Unsupported platform: ${OS}-${ARCH}" + exit 1 + ;; + esac + + if [[ "$OS" == MINGW* || "$OS" == MSYS* || "$OS" == CYGWIN* ]]; then + curl -L -o stackql-deploy.zip "$URL" + unzip -o stackql-deploy.zip + rm -f stackql-deploy.zip + else + curl -L "$URL" | tar -xz + fi + + # Make available on PATH + chmod +x ./stackql-deploy + echo "${GITHUB_WORKSPACE}" >> "$GITHUB_PATH" + export PATH="${GITHUB_WORKSPACE}:${PATH}" + + echo "stackql-deploy installed:" + ./stackql-deploy info fi - name: Run stackql-deploy diff --git a/examples/aws-ssm-parameter/stackql_manifest.yml b/examples/aws-ssm-parameter/stackql_manifest.yml index a51712d..6847ea9 100644 --- a/examples/aws-ssm-parameter/stackql_manifest.yml +++ b/examples/aws-ssm-parameter/stackql_manifest.yml @@ -21,7 +21,7 @@ resources: - name: type value: "String" - name: value - value: "stackql-deploy-action-test-value" + value: "stackql-deploy-action-test-value-updated" - name: description value: "Test SSM parameter for stackql-deploy-action CI" - name: tier diff --git a/local_test.sh b/local_test.sh index 51df271..71fab4b 100644 --- a/local_test.sh +++ b/local_test.sh @@ -4,7 +4,7 @@ # 1. Run `source local_test_setup.sh` to download the stackql-deploy binary. # 2. Ensure AWS credentials are exported (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN). # 3. Ensure AWS_REGION is exported. -# 4. yq v4 is installed (for the manifest update step). +# 4. sed is available (used to update the manifest). set -euo pipefail @@ -31,21 +31,21 @@ run_step "Step 1: Deploy SSM Parameter" "build" # Step 2: Test run_step "Step 2: Test SSM Parameter" "test" -# Step 3: Update manifest - add an extra tag +# Step 3: Update manifest - change the parameter value echo "" echo "========================================================================" -echo " Step 3: Update Manifest - Add Tag" +echo " Step 3: Update Manifest - Update SSM Parameter Value" echo "========================================================================" MANIFEST="${STACK_DIR}/stackql_manifest.yml" -YQ_EXPR='(.resources[] | select(.name == "test_ssm_parameter") | .props[] | select(.name == "tags")).value += [{"Key": "stackql:updated", "Value": "true"}]' -echo "executing: yq -Y \"${YQ_EXPR}\" ${MANIFEST}" -yq -Y "${YQ_EXPR}" "${MANIFEST}" > "${MANIFEST}.tmp" && mv "${MANIFEST}.tmp" "${MANIFEST}" +echo "executing: sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' ${MANIFEST}" +sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' "${MANIFEST}" +rm -f "${MANIFEST}.bak" echo "" echo "Updated manifest:" cat "${STACK_DIR}/stackql_manifest.yml" # Step 4: Redeploy with updated manifest -run_step "Step 4: Redeploy SSM Parameter with Updated Tag" "build" +run_step "Step 4: Redeploy SSM Parameter with Updated Value" "build" # Step 5: Test again after update run_step "Step 5: Test SSM Parameter (Post-Update)" "test" From 4dce427272b0f7d75a052b5cf1e5cb8630129d47 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 19:20:18 +1100 Subject: [PATCH 4/7] ci runner updates --- .github/workflows/stackql-deploy-actions-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stackql-deploy-actions-test.yml b/.github/workflows/stackql-deploy-actions-test.yml index 9ca27f4..a4de10f 100644 --- a/.github/workflows/stackql-deploy-actions-test.yml +++ b/.github/workflows/stackql-deploy-actions-test.yml @@ -15,9 +15,9 @@ jobs: os: - ubuntu-latest - ubuntu-24.04-arm - - macos-latest - - macos-13 - windows-latest + - macos-latest + - macos-26-intel env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From ee061e815dd09819e7af9cfe0bdb584225f710d3 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 20:20:20 +1100 Subject: [PATCH 5/7] ci updates --- .../workflows/stackql-deploy-actions-test.yml | 276 +++++++++++++++--- 1 file changed, 239 insertions(+), 37 deletions(-) diff --git a/.github/workflows/stackql-deploy-actions-test.yml b/.github/workflows/stackql-deploy-actions-test.yml index a4de10f..4aba82d 100644 --- a/.github/workflows/stackql-deploy-actions-test.yml +++ b/.github/workflows/stackql-deploy-actions-test.yml @@ -5,31 +5,19 @@ on: branches: - main +# Run tests sequentially to avoid race conditions on shared AWS resources. +# Order: Linux amd64 → Linux arm64 → macOS arm → macOS Intel → Windows + jobs: - aws-ssm-test: - name: "Test (${{ matrix.os }})" - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - ubuntu-24.04-arm - - windows-latest - - macos-latest - - macos-26-intel + test-ubuntu-latest: + name: "Test (ubuntu-latest)" + runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - # ----------------------------------------------------------------------- - # Step 1: Deploy the SSM parameter - # ----------------------------------------------------------------------- + - uses: actions/checkout@v4 - name: Deploy SSM Parameter uses: ./ with: @@ -38,10 +26,6 @@ jobs: stack_env: 'dev' env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' log_level: 'info' - - # ----------------------------------------------------------------------- - # Step 2: Test the deployed SSM parameter - # ----------------------------------------------------------------------- - name: Test SSM Parameter uses: ./ with: @@ -50,23 +34,131 @@ jobs: stack_env: 'dev' env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' log_level: 'info' - - # ----------------------------------------------------------------------- - # Step 3: Update the manifest - change the parameter value - # ----------------------------------------------------------------------- - name: Update Manifest - Update SSM Parameter Value shell: bash run: | - # Update the SSM parameter value to test that a redeploy detects the change. sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' examples/aws-ssm-parameter/stackql_manifest.yml rm -f examples/aws-ssm-parameter/stackql_manifest.yml.bak + echo "Updated manifest:" + cat examples/aws-ssm-parameter/stackql_manifest.yml + - name: Redeploy SSM Parameter with Updated Value + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Test SSM Parameter (Post-Update) + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Teardown SSM Parameter + if: always() + uses: ./ + with: + command: 'teardown' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + test-ubuntu-arm: + name: "Test (ubuntu-24.04-arm)" + needs: test-ubuntu-latest + runs-on: ubuntu-24.04-arm + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Deploy SSM Parameter + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Test SSM Parameter + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Update Manifest - Update SSM Parameter Value + shell: bash + run: | + sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' examples/aws-ssm-parameter/stackql_manifest.yml + rm -f examples/aws-ssm-parameter/stackql_manifest.yml.bak echo "Updated manifest:" cat examples/aws-ssm-parameter/stackql_manifest.yml + - name: Redeploy SSM Parameter with Updated Value + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Test SSM Parameter (Post-Update) + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Teardown SSM Parameter + if: always() + uses: ./ + with: + command: 'teardown' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' - # ----------------------------------------------------------------------- - # Step 4: Redeploy with the updated manifest (value update) - # ----------------------------------------------------------------------- + test-macos-arm: + name: "Test (macos-latest)" + needs: test-ubuntu-arm + runs-on: macos-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Deploy SSM Parameter + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Test SSM Parameter + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Update Manifest - Update SSM Parameter Value + shell: bash + run: | + sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' examples/aws-ssm-parameter/stackql_manifest.yml + rm -f examples/aws-ssm-parameter/stackql_manifest.yml.bak + echo "Updated manifest:" + cat examples/aws-ssm-parameter/stackql_manifest.yml - name: Redeploy SSM Parameter with Updated Value uses: ./ with: @@ -75,10 +167,65 @@ jobs: stack_env: 'dev' env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' log_level: 'info' + - name: Test SSM Parameter (Post-Update) + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Teardown SSM Parameter + if: always() + uses: ./ + with: + command: 'teardown' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' - # ----------------------------------------------------------------------- - # Step 5: Test again after the update - # ----------------------------------------------------------------------- + test-macos-intel: + name: "Test (macos-26-intel)" + needs: test-macos-arm + runs-on: macos-26-intel + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Deploy SSM Parameter + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Test SSM Parameter + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Update Manifest - Update SSM Parameter Value + shell: bash + run: | + sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' examples/aws-ssm-parameter/stackql_manifest.yml + rm -f examples/aws-ssm-parameter/stackql_manifest.yml.bak + echo "Updated manifest:" + cat examples/aws-ssm-parameter/stackql_manifest.yml + - name: Redeploy SSM Parameter with Updated Value + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' - name: Test SSM Parameter (Post-Update) uses: ./ with: @@ -87,10 +234,65 @@ jobs: stack_env: 'dev' env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' log_level: 'info' + - name: Teardown SSM Parameter + if: always() + uses: ./ + with: + command: 'teardown' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' - # ----------------------------------------------------------------------- - # Step 6: Teardown - always run to avoid leaving resources behind - # ----------------------------------------------------------------------- + test-windows: + name: "Test (windows-latest)" + needs: test-macos-intel + runs-on: windows-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Deploy SSM Parameter + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Test SSM Parameter + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Update Manifest - Update SSM Parameter Value + shell: bash + run: | + sed -i.bak 's/stackql-deploy-action-test-value/stackql-deploy-action-test-value-updated/' examples/aws-ssm-parameter/stackql_manifest.yml + rm -f examples/aws-ssm-parameter/stackql_manifest.yml.bak + echo "Updated manifest:" + cat examples/aws-ssm-parameter/stackql_manifest.yml + - name: Redeploy SSM Parameter with Updated Value + uses: ./ + with: + command: 'build' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' + - name: Test SSM Parameter (Post-Update) + uses: ./ + with: + command: 'test' + stack_dir: 'examples/aws-ssm-parameter' + stack_env: 'dev' + env_vars: 'AWS_REGION=${{ vars.AWS_REGION }}' + log_level: 'info' - name: Teardown SSM Parameter if: always() uses: ./ From 4f5cb9f85850b9900e4a53de52a550e52918003f Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 20:26:34 +1100 Subject: [PATCH 6/7] ci updates --- .github/workflows/stackql-deploy-actions-test.yml | 10 +++++----- README.md | 4 ++-- action.yml | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/stackql-deploy-actions-test.yml b/.github/workflows/stackql-deploy-actions-test.yml index 4aba82d..fed988f 100644 --- a/.github/workflows/stackql-deploy-actions-test.yml +++ b/.github/workflows/stackql-deploy-actions-test.yml @@ -17,7 +17,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Deploy SSM Parameter uses: ./ with: @@ -76,7 +76,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Deploy SSM Parameter uses: ./ with: @@ -135,7 +135,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Deploy SSM Parameter uses: ./ with: @@ -194,7 +194,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Deploy SSM Parameter uses: ./ with: @@ -253,7 +253,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Deploy SSM Parameter uses: ./ with: diff --git a/README.md b/README.md index 0ab6d50..292a405 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Deploy a Stack uses: stackql/stackql-deploy-action@v1.0.2 @@ -69,7 +69,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Deploy a Stack id: stackql-deploy diff --git a/action.yml b/action.yml index b4747e5..eada45a 100644 --- a/action.yml +++ b/action.yml @@ -52,6 +52,7 @@ runs: echo "Installing stackql-deploy binary..." OS="$(uname -s)" ARCH="$(uname -m)" + echo "Detected platform: ${OS}-${ARCH}" case "${OS}-${ARCH}" in Linux-x86_64) URL="https://bit.ly/stackql-deploy-amd64" ;; Linux-aarch64) URL="https://bit.ly/stackql-deploy-arm64" ;; @@ -64,6 +65,7 @@ runs: exit 1 ;; esac + echo "Download URL: ${URL}" if [[ "$OS" == MINGW* || "$OS" == MSYS* || "$OS" == CYGWIN* ]]; then curl -L -o stackql-deploy.zip "$URL" @@ -73,8 +75,8 @@ runs: curl -L "$URL" | tar -xz fi - # Make available on PATH chmod +x ./stackql-deploy + echo "Binary details: $(file ./stackql-deploy)" echo "${GITHUB_WORKSPACE}" >> "$GITHUB_PATH" export PATH="${GITHUB_WORKSPACE}:${PATH}" From 9486cd704bb68f7c43d7d05b0fcdec561a2e7eee Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 20:43:43 +1100 Subject: [PATCH 7/7] ci updates --- action.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index eada45a..c7e8932 100644 --- a/action.yml +++ b/action.yml @@ -52,14 +52,15 @@ runs: echo "Installing stackql-deploy binary..." OS="$(uname -s)" ARCH="$(uname -m)" + BASE_URL="https://github.com/stackql/stackql-deploy-rs/releases/latest/download" echo "Detected platform: ${OS}-${ARCH}" case "${OS}-${ARCH}" in - Linux-x86_64) URL="https://bit.ly/stackql-deploy-amd64" ;; - Linux-aarch64) URL="https://bit.ly/stackql-deploy-arm64" ;; - Darwin-arm64) URL="https://bit.ly/stackql-deploy-macos-arm64" ;; - Darwin-x86_64) URL="https://bit.ly/stackql-deploy-macos-amd64" ;; + Linux-x86_64) URL="${BASE_URL}/stackql-deploy-linux-x86_64.tar.gz" ;; + Linux-aarch64) URL="${BASE_URL}/stackql-deploy-linux-arm64.tar.gz" ;; + Darwin-arm64) URL="${BASE_URL}/stackql-deploy-macos-arm64.tar.gz" ;; + Darwin-x86_64) URL="${BASE_URL}/stackql-deploy-macos-x86_64.tar.gz" ;; MINGW*|MSYS*|CYGWIN*) - URL="https://bit.ly/stackql-deploy-windows" ;; + URL="${BASE_URL}/stackql-deploy-windows-x86_64.zip" ;; *) echo "Unsupported platform: ${OS}-${ARCH}" exit 1