Compare commits
28 commits
v0.2.0-alp
...
alpha
| Author | SHA1 | Date | |
|---|---|---|---|
| 233efb259d | |||
| 03776cc7fd | |||
| 9060aa9f6a | |||
|
|
5a1dc9cd94 | ||
| d34927537a | |||
|
|
83b0860115 | ||
|
|
97645d7a66 | ||
|
|
94f3dad963 | ||
|
|
c081f5f7bd | ||
|
|
8ab8656b5c | ||
|
|
63435e5e63 | ||
|
|
e974ccf906 | ||
|
|
1fd2df5c76 | ||
|
|
aaabadde1a | ||
|
|
0a5bc30d9c | ||
|
|
8ff6b2a4d8 | ||
| 3dbb04c917 | |||
| a1d1750a79 | |||
| 76af35f27d | |||
| 01deb9022d | |||
|
|
91fe23f5e8 | ||
|
|
4913ff1c3a | ||
|
|
431f6eff8c | ||
|
|
a310d1454a | ||
|
|
7d4cbb6b08 | ||
|
|
4cc801a7f3 | ||
|
|
4eff763519 | ||
|
|
2733834fc9 |
40 changed files with 978 additions and 146 deletions
5
.github/actions/acc_test/action.yaml
vendored
5
.github/actions/acc_test/action.yaml
vendored
|
|
@ -94,6 +94,11 @@ runs:
|
|||
fi
|
||||
echo "::endgroup::"
|
||||
|
||||
# Install latest version of Terraform
|
||||
- uses: hashicorp/setup-terraform@v4
|
||||
with:
|
||||
terraform_wrapper: false
|
||||
|
||||
- name: Setup JAVA
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
|
|
|
|||
1
.github/actions/clean_up/README.md
vendored
Normal file
1
.github/actions/clean_up/README.md
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
# acceptance test action
|
||||
168
.github/actions/clean_up/action.yaml
vendored
Normal file
168
.github/actions/clean_up/action.yaml
vendored
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
name: CleanUp Project Resources
|
||||
description: "Acceptance Testing CleanUp"
|
||||
|
||||
inputs:
|
||||
project_id:
|
||||
description: "STACKIT project ID for tests"
|
||||
required: true
|
||||
|
||||
region:
|
||||
description: "STACKIT region for tests"
|
||||
default: 'eu01'
|
||||
required: true
|
||||
|
||||
tf_resource_prefix:
|
||||
description: "prefix in resource names"
|
||||
default: 'tf-acc-'
|
||||
required: true
|
||||
|
||||
service_account_json_content:
|
||||
description: "STACKIT service account JSON file contents"
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
service_account_json_content_b64:
|
||||
description: "STACKIT service account JSON file contents"
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
list_only:
|
||||
description: "only list resources, DO NOT delete"
|
||||
required: true
|
||||
default: 'true'
|
||||
|
||||
log_level:
|
||||
description: "Log Level"
|
||||
required: true
|
||||
default: 'warning'
|
||||
|
||||
outputs:
|
||||
cli-version:
|
||||
description: "stackit cli version"
|
||||
value: ${{ steps.stackit_version.outputs.version }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install needed tools
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::group::apt install"
|
||||
set -e
|
||||
apt-get -y -qq update >apt_update.log 2>apt_update_err.log
|
||||
if [ $? -ne 0 ]; then
|
||||
cat apt_update.log apt_update_err.log
|
||||
fi
|
||||
apt-get -y -qq install curl gnupg jq >apt_get.log 2>apt_get_err.log
|
||||
if [ $? -ne 0 ]; then
|
||||
cat apt_get.log apt_get_err.log
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::apt add source"
|
||||
curl https://packages.stackit.cloud/keys/key.gpg | gpg --dearmor -o /usr/share/keyrings/stackit.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/stackit.gpg] https://packages.stackit.cloud/apt/cli stackit main" | tee -a /etc/apt/sources.list.d/stackit.list
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::apt install stackit cli"
|
||||
apt-get -y -qq update >apt_update.log 2>apt_update_err.log
|
||||
if [ $? -ne 0 ]; then
|
||||
cat apt_update.log apt_update_err.log
|
||||
fi
|
||||
apt-get -y -qq install stackit >apt_get.log 2>apt_get_err.log
|
||||
if [ $? -ne 0 ]; then
|
||||
cat apt_get.log apt_get_err.log
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Check stackit cli version
|
||||
id: stackit_version
|
||||
run: |
|
||||
set -e
|
||||
VERSION=$(stackit --version | grep "Version:" | cut -d " " -f 2)
|
||||
echo "stackit cli version: ${VERSION}"
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- name: Creating service_account file from json input
|
||||
if: inputs.service_account_json_content != ''
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::group::create service account file"
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
echo "${{ inputs.service_account_json_content }}" > .svc_acc.json
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Creating service_account file from base64 json input
|
||||
if: inputs.service_account_json_content_b64 != ''
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::group::create service account file"
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
echo "${{ inputs.service_account_json_content_b64 }}" | base64 -d > .svc_acc.json
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Check service account file exists
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
if [[ ! -s .svc_acc.json ]]; then
|
||||
echo "ERROR: service account file missing or empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Retrieve resources
|
||||
run: |
|
||||
echo "::group::retrieve resources"
|
||||
set -e
|
||||
echo "authenticating api"
|
||||
STACKIT_SERVICE_ACCOUNT_KEY_PATH="${PWD}/.svc_acc.json"
|
||||
export STACKIT_SERVICE_ACCOUNT_KEY_PATH
|
||||
stackit auth activate-service-account --service-account-key-path .svc_acc.json
|
||||
|
||||
echo "SQL Server Flex resources:"
|
||||
stackit --verbosity ${{ inputs.log_level }} --project-id "${{ inputs.project_id }}" beta sqlserverflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}"))'
|
||||
|
||||
echo "PostgreSQL Flex resources:"
|
||||
stackit --verbosity ${{ inputs.log_level }} --project-id "${{ inputs.project_id }}" postgresflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}"))'
|
||||
|
||||
echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- name: Delete SQL Server Flex resources
|
||||
if: ${{ inputs.list_only != 'true' }}
|
||||
run: |
|
||||
echo "::group::delete SQL Server Flex resources"
|
||||
set -e
|
||||
stackit --verbosity ${{ inputs.log_level }} auth activate-service-account --service-account-key-path .svc_acc.json
|
||||
for s in $(stackit --verbosity ${{ inputs.log_level }} --project-id ${{ inputs.project_id }} beta sqlserverflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}")) | .id'); do stackit --verbosity ${{ inputs.log_level }} -y --project-id ${{ inputs.project_id }} beta sqlserverflex instance delete $s; done
|
||||
echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- name: Skip Delete SQL Server Flex resources
|
||||
if: ${{ inputs.list_only == 'true' }}
|
||||
run: |
|
||||
set -e
|
||||
echo "Skip deleting: list only mode"
|
||||
shell: bash
|
||||
|
||||
- name: Delete PostgreSQL Flex resources
|
||||
if: ${{ inputs.list_only != 'true' }}
|
||||
run: |
|
||||
echo "::group::delete PostgreSQL Flex resources"
|
||||
set -e
|
||||
stackit auth activate-service-account --service-account-key-path .svc_acc.json
|
||||
for s in $(stackit --verbosity ${{ inputs.log_level }} --project-id ${{ inputs.project_id }} postgresflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}")) | .id'); do stackit --verbosity ${{ inputs.log_level }} -y --project-id ${{ inputs.project_id }} postgresflex instance delete $s; done
|
||||
echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- name: Skip Delete PostgreSQL Flex resources
|
||||
if: ${{ inputs.list_only == 'true' }}
|
||||
run: |
|
||||
set -e
|
||||
echo "Skip deleting: list only mode"
|
||||
shell: bash
|
||||
12
.github/workflows/ci_new.yaml
vendored
12
.github/workflows/ci_new.yaml
vendored
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
config:
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
name: Check GoReleaser config
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: stackit-docker
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
|
@ -40,7 +40,7 @@ jobs:
|
|||
|
||||
prepare:
|
||||
name: Prepare GO cache
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: stackit-docker
|
||||
permissions:
|
||||
actions: read # Required to identify workflow run.
|
||||
checks: write # Required to add status summary.
|
||||
|
|
@ -102,7 +102,7 @@ jobs:
|
|||
needs:
|
||||
- config
|
||||
- prepare
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: stackit-docker
|
||||
permissions:
|
||||
actions: read # Required to identify workflow run.
|
||||
checks: write # Required to add status summary.
|
||||
|
|
@ -185,7 +185,7 @@ jobs:
|
|||
|
||||
testing:
|
||||
name: CI run tests
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: stackit-docker
|
||||
needs:
|
||||
- config
|
||||
- prepare
|
||||
|
|
@ -278,7 +278,7 @@ jobs:
|
|||
main:
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
name: CI run build and linting
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: stackit-docker
|
||||