Skip to content

Commit

Permalink
minor (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Sep 11, 2024
1 parent d15a453 commit 4e7a57c
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd "$(dirname "$0")"
source configuration.sh

$VINTNER template pull --dir ${TEMPLATE_DIR}
$VINTNER template implement --dir ${TEMPLATE_DIR} --experimental
$VINTNER template implement --dir ${TEMPLATE_DIR}
$VINTNER templates import --template ${TEMPLATE_NAME} --path ${TEMPLATE_DIR}
$VINTNER instances init --instance ${TEMPLATE_NAME} --template ${TEMPLATE_NAME}
$VINTNER instances resolve --instance ${TEMPLATE_NAME} --inputs ${TEMPLATE_DIR}/tests/${VARIANT}/inputs.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
source configuration.sh

# Implement types
$VINTNER template implement --dir ${TEMPLATE_DIR} --experimental
$VINTNER template implement --dir ${TEMPLATE_DIR}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ source configuration.sh
for dir in "../tests/gcp";
do
dir=$(basename $dir)
echo "${dir}: $($VINTNER template quality --template ${TEMPLATE_DIR}/variable-service-template.yaml --experimental --inputs ${TEMPLATE_DIR}/tests/${dir}/inputs.yaml)"
echo "${dir}: $($VINTNER template quality --template ${TEMPLATE_DIR}/variable-service-template.yaml --inputs ${TEMPLATE_DIR}/tests/${dir}/inputs.yaml)"
done
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
source configuration.sh

# Implement types
$VINTNER template implement --dir ${TEMPLATE_DIR} --experimental
$VINTNER template implement --dir ${TEMPLATE_DIR}
2 changes: 1 addition & 1 deletion src/assets/templates/template-init/scripts/implement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
source configuration.sh

# Implement types
$VINTNER template implement --dir ${TEMPLATE_DIR} --experimental
$VINTNER template implement --dir ${TEMPLATE_DIR}
2 changes: 1 addition & 1 deletion src/assets/templates/template-init/scripts/quality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ source configuration.sh
for dir in ../tests/*/;
do
dir=$(basename $dir)
echo "${dir}: $($VINTNER template quality --template ${TEMPLATE_DIR}/variable-service-template.yaml --experimental --inputs ${TEMPLATE_DIR}/tests/${dir}/inputs.yaml)"
echo "${dir}: $($VINTNER template quality --template ${TEMPLATE_DIR}/variable-service-template.yaml --inputs ${TEMPLATE_DIR}/tests/${dir}/inputs.yaml)"
done
8 changes: 3 additions & 5 deletions src/cli/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,7 @@ template

template
.command('quality')
.description('get quality of template (experimental)')
.requiredOption('--experimental', 'enable experimental feature')
.description('get quality of template')
.requiredOption('--template <string>', 'path to service template')
.option('--presets [string...]', 'names of variability presets(env: OPENTOSCA_VINTNER_VARIABILITY_PRESETS)', [])
.option(
Expand All @@ -516,7 +515,6 @@ template
.command('implement')
.description('implement node types')
.requiredOption('--dir <string>', 'path to service template directory')
.requiredOption('--experimental', 'enable experimental feature')
.option('--orchestrator [string]', 'the orchestrator for which node type should be implemented', 'unfurl')
.action(
hae.exit(async options => {
Expand Down Expand Up @@ -1127,8 +1125,8 @@ utils
.option('--no-profile [boolean]')
.option('--base [boolean]', 'include base types', true)
.option('--no-base [boolean]')
.option('--specific [boolean]', 'include specific types', true)
.option('--no-specific [boolean]')
.option('--extended [boolean]', 'include extended types', true)
.option('--no-extended [boolean]')
.addOption(new Option('--format [string]', 'output format').default('yaml').choices(['yaml', 'json']))
.action(
hae.exit(async options => {
Expand Down
6 changes: 0 additions & 6 deletions src/controller/template/implement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@ import path from 'path'
export type TemplateImplementOptions = {
dir: string
orchestrator: string
experimental: string
}

export default async function (options: TemplateImplementOptions) {
/**
* Experimental
*/
assert.isTrue(options.experimental)

/**
* Orchestrator
*/
Expand Down
2 changes: 0 additions & 2 deletions src/controller/template/quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ export type TemplateQualityOptions = {
template: string
presets?: string[]
inputs?: string
experimental: boolean
}

export default async function (options: TemplateQualityOptions) {
assert.isDefined(options.template, 'Template not defined')
assert.isTrue(options.experimental)

/**
* Note, checker does not run on these results!
Expand Down
6 changes: 3 additions & 3 deletions src/controller/utils/normative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type NormativeOptions = {
format?: string
profile?: boolean
base?: boolean
specific?: boolean
extended?: boolean
}

export default async function (options: NormativeOptions) {
Expand All @@ -16,7 +16,7 @@ export default async function (options: NormativeOptions) {
*/
options.format = options.format ?? 'yaml'
options.base = options.base ?? true
options.specific = options.specific ?? true
options.extended = options.extended ?? true

/**
* Normative types
Expand All @@ -29,7 +29,7 @@ export default async function (options: NormativeOptions) {
const types = []
if (options.profile) types.push(normative.profile.template)
if (options.base) types.push(normative.core.template)
if (options.specific) types.push(normative.extended.template)
if (options.extended) types.push(normative.extended.template)

/**
* Simplify
Expand Down

0 comments on commit 4e7a57c

Please sign in to comment.