Alpha (#4)
* chore: initial push to be able to work together * chore: add missing wait folder * chore: add missing folders * chore: cleanup alpha branch * feat: mssql alpha instance (#2) * fix: remove unused attribute types and functions from backup models * fix: update API client references to use sqlserverflexalpha package * fix: update package references to use sqlserverflexalpha and modify user data source model * fix: add sqlserverflexalpha user data source to provider * fix: add sqlserverflexalpha user resource and update related functionality * chore: add stackit_sqlserverflexalpha_user resource and instance_id variable * fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database --------- Co-authored-by: Andre Harms <andre.harms@stackit.cloud> Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud> * feat: add sqlserver instance * chore: fixing tests * chore: update docs --------- Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud> Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
This commit is contained in:
parent
45073a716b
commit
2733834fc9
351 changed files with 62744 additions and 3 deletions
23
scripts/check-docs.sh
Executable file
23
scripts/check-docs.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) STACKIT
|
||||
|
||||
|
||||
# This script is used to ensure for PRs the docs are up-to-date via the CI pipeline
|
||||
# Usage: ./check-docs.sh
|
||||
set -eo pipefail
|
||||
|
||||
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||
|
||||
before_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}')
|
||||
|
||||
# re-generate the docs
|
||||
$ROOT_DIR/scripts/tfplugindocs.sh
|
||||
|
||||
after_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}')
|
||||
|
||||
if [[ "$before_hash" == "$after_hash" ]]; then
|
||||
echo "Docs are up-to-date"
|
||||
else
|
||||
echo "Changes detected. Docs are *not* up-to-date."
|
||||
exit 1
|
||||
fi
|
||||
20
scripts/lint-golangci-lint.sh
Executable file
20
scripts/lint-golangci-lint.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) STACKIT
|
||||
|
||||
# This script lints the SDK modules and the internal examples
|
||||
# Pre-requisites: golangci-lint
|
||||
set -eo pipefail
|
||||
|
||||
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||
GOLANG_CI_YAML_PATH="${ROOT_DIR}/golang-ci.yaml"
|
||||
GOLANG_CI_ARGS="--allow-parallel-runners --timeout=5m --config=${GOLANG_CI_YAML_PATH}"
|
||||
|
||||
if type -p golangci-lint >/dev/null; then
|
||||
:
|
||||
else
|
||||
echo "golangci-lint not installed, unable to proceed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ${ROOT_DIR}
|
||||
golangci-lint run ${GOLANG_CI_ARGS}
|
||||
25
scripts/project.sh
Executable file
25
scripts/project.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) STACKIT
|
||||
|
||||
|
||||
# This script is used to manage the project, only used for installing the required tools for now
|
||||
# Usage: ./project.sh [action]
|
||||
# * tools: Install required tools to run the project
|
||||
set -eo pipefail
|
||||
|
||||
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||
|
||||
action=$1
|
||||
|
||||
if [ "$action" = "help" ]; then
|
||||
[ -f "$0".man ] && man "$0".man || echo "No help, please read the script in ${script}, we will add help later"
|
||||
elif [ "$action" = "tools" ]; then
|
||||
cd ${ROOT_DIR}
|
||||
|
||||
go mod download
|
||||
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0
|
||||
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@v0.21.0
|
||||
else
|
||||
echo "Invalid action: '$action', please use $0 help for help"
|
||||
fi
|
||||
59
scripts/replace.sh
Executable file
59
scripts/replace.sh
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) STACKIT
|
||||
|
||||
# Add replace directives to local files to go.work
|
||||
set -eo pipefail
|
||||
|
||||
while getopts "s:" option; do
|
||||
case "${option}" in
|
||||
s)
|
||||
SDK_DIR=${OPTARG}
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "call: $0 [-s sdk-dir] <apis*>"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
if [ -z "$SDK_DIR" ]; then
|
||||
SDK_DIR=../stackit-sdk-generator/sdk-repo-updated
|
||||
echo "No SDK_DIR set, using $SDK_DIR"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f go.work ]; then
|
||||
go work init
|
||||
go work use .
|
||||
else
|
||||
echo "go.work already exists"
|
||||
fi
|
||||
|
||||
if [ $# -gt 0 ];then
|
||||
# modules passed via commandline
|
||||
for service in $*; do
|
||||
if [ ! -d $SDK_DIR/services/$service ]; then
|
||||
echo "service directory $SDK_DIR/services/$service does not exist"
|
||||
exit 1
|
||||
fi
|
||||
echo "replacing selected service $service"
|
||||
if [ "$service" = "core" ]; then
|
||||
go work edit -replace github.com/stackitcloud/stackit-sdk-go/core=$SDK_DIR/core
|
||||
else
|
||||
go work edit -replace github.com/stackitcloud/stackit-sdk-go/services/$service=$SDK_DIR/services/$service
|
||||
fi
|
||||
done
|
||||
else
|
||||
# replace all modules
|
||||
echo "replacing all services"
|
||||
go work edit -replace github.com/stackitcloud/stackit-sdk-go/core=$SDK_DIR/core
|
||||
for n in $(find ${SDK_DIR}/services -name go.mod);do
|
||||
service=$(dirname $n)
|
||||
service=${service#${SDK_DIR}/services/}
|
||||
go work edit -replace github.com/stackitcloud/stackit-sdk-go/services/$service=$(dirname $n)
|
||||
done
|
||||
fi
|
||||
go work edit -fmt
|
||||
go work sync
|
||||
19
scripts/tfplugindocs.sh
Executable file
19
scripts/tfplugindocs.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (c) STACKIT
|
||||
|
||||
# Pre-requisites: tfplugindocs
|
||||
set -eo pipefail
|
||||
|
||||
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||
EXAMPLES_DIR="${ROOT_DIR}/examples"
|
||||
PROVIDER_NAME="stackitprivatepreview"
|
||||
|
||||
# Create a new empty directory for the docs
|
||||
if [ -d ${ROOT_DIR}/docs ]; then
|
||||
rm -rf ${ROOT_DIR}/docs
|
||||
fi
|
||||
mkdir -p ${ROOT_DIR}/docs
|
||||
|
||||
echo ">> Generating documentation"
|
||||
tfplugindocs generate \
|
||||
--provider-name "stackitprivatepreview"
|
||||
Loading…
Add table
Add a link
Reference in a new issue