diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 89666a9563..dcf3b28aed 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -7,11 +7,19 @@ jobs:
name: Build
runs-on: ubuntu-22.04
steps:
+ ###################################################
+ #
+ # Prepare
+ #
+ ###################################################
+
- name: (PREPARE) Set up QEMU
uses: docker/setup-qemu-action@v2
- name: (PREPARE) Checkout Repository
uses: actions/checkout@v3
+ with:
+ lfs: true
- name: (PREPARE) Setup Node
uses: actions/setup-node@v3
@@ -22,6 +30,12 @@ jobs:
- name: (PREPARE) Install Dependencies
run: rm -rf node_modules && yarn --frozen-lockfile
+ ###################################################
+ #
+ # Build
+ #
+ ###################################################
+
- name: (BUILD) Build Project
run: yarn build
@@ -58,6 +72,12 @@ jobs:
tar -cJf ${BINARY}.xz ${BINARY}
done
+ ###################################################
+ #
+ # Release
+ #
+ ###################################################
+
- name: (RELEASE) Delete Build Release
run: gh release delete build-${GITHUB_SHA} || true
env:
diff --git a/.github/workflows/night.yaml b/.github/workflows/night.yaml
new file mode 100644
index 0000000000..78f2a2b4e5
--- /dev/null
+++ b/.github/workflows/night.yaml
@@ -0,0 +1,169 @@
+# GitHub runner seems not to support ipv6, thus, we can not test on bwCloud.
+# See https://github.com/actions/runner-images/issues/668
+
+name: Night
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: '20 4 * * 2'
+ push:
+ branches:
+ - fix/night-workflow
+
+concurrency: night
+jobs:
+ night:
+ name: Night
+ runs-on: ubuntu-22.04
+ steps:
+ ###################################################
+ #
+ # Prepare
+ #
+ ###################################################
+
+ - name: (PREPARE) Checkout Repository
+ uses: actions/checkout@v3
+ with:
+ lfs: true
+
+ - name: (PREPARE) Setup Git
+ run: |
+ git config --global user.name "${GITHUB_ACTOR}"
+ git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}"
+
+ - name: (PREPARE) Setup gcloud CLI
+ uses: google-github-actions/setup-gcloud@v1
+ with:
+ version: 438.0.0
+
+ - name: (PREPARE) Setup GCP credentials
+ uses: actions/github-script@v3
+ with:
+ script: |
+ if (!process.env.GCP_CREDENTIALS) throw 'GCP_CREDENTIALS undefined'
+ const fs = require('fs')
+ const file = 'gcp-credentials.json'
+ const content = new Buffer.from(process.env.GCP_CREDENTIALS, 'base64').toString('utf-8')
+ fs.writeFileSync(file, content)
+ env:
+ GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
+
+ - name: (PREPARE) Setup Terraform
+ uses: actions/github-script@v3
+ with:
+ script: |
+ if (!process.env.TERRAFORM_API_TOKEN) throw 'TERRAFORM_TOKEN undefined'
+ const fs = require('fs')
+ const path = require('path')
+ const dir = path.resolve(process.env.HOME, '.terraform.d')
+ const file = path.resolve(dir, 'credentials.tfrc.json')
+ const content = JSON.stringify({
+ "credentials": {
+ "app.terraform.io": {
+ "token": process.env.TERRAFORM_API_TOKEN
+ }
+ }
+ }, null, 4)
+ fs.mkdirSync(dir)
+ fs.writeFileSync(file, content)
+ env:
+ TERRAFORM_API_TOKEN: ${{ secrets.TERRAFORM_API_TOKEN }}
+
+ - name: (PREPARE) Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.x
+ cache: pip
+
+ - name: (PREPARE) Install xOpera
+ run: pip install opera==0.6.9
+
+ - name: (PREPARE) Cache Unfurl
+ uses: actions/cache@v3
+ with:
+ path: /home/runner/.unfurl_home
+ key: unfurl-home
+
+ - name: (PREPARE) Install Unfurl
+ run: |
+ pip install unfurl==0.7.1
+ yes | unfurl home --init
+
+ ###################################################
+ #
+ # Installation
+ #
+ ###################################################
+
+ - name: (INSTALLATION) Install vintner
+ run: curl -fsSL https://vintner.opentosca.org/install.sh | sudo bash -
+
+ - name: (INSTALLATION) Verify signature
+ run: |
+ curl https://vintner.opentosca.org/vintner-release.gpg | gpg --import
+ wget https://github.com/opentosca/opentosca-vintner/releases/download/latest/vintner-linux-x64.asc
+ gpg --verify vintner-linux-x64.asc /usr/bin/vintner
+
+ - name: (INSTALLATION) Test setup
+ run: |
+ vintner --version
+ vintner setup init
+ vintner setup benchmark --seeds 10 250
+
+ ###################################################
+ #
+ # xOpera Motivation
+ #
+ ###################################################
+
+ - name: (XOPERA-MOTIVATION) Deploy the production variant of xopera-motivation on GCP
+ run: |
+ vintner setup clean
+ vintner setup init
+
+ vintner orchestrators init xopera --no-venv
+ vintner orchestrators enable --orchestrator xopera
+
+ vintner templates import --template motivation --path examples/xopera-motivation
+ vintner instances create --instance motivation --template motivation
+ vintner instances resolve --instance motivation --presets prod
+
+ cp examples/xopera-motivation/deployment-inputs.example.yaml examples/xopera-motivation/deployment-inputs.ignored.yaml
+ sed -i "/gcp_service_account_file:/c\gcp_service_account_file: $(pwd)/gcp-credentials.json" examples/xopera-motivation/deployment-inputs.ignored.yaml
+ vintner instances deploy --instance motivation --inputs examples/xopera-motivation/deployment-inputs.ignored.yaml
+
+ - name: (XOPERA-MOTIVATION) Test the production variant of xopera-motivation on GCP
+ run: curl https://application-dot-stoetzms-387808.ey.r.appspot.com
+
+ - name: (XOPERA-MOTIVATION) Undeploy the production variant of xopera-motivation on GCP
+ run: vintner instances undeploy --instance motivation
+ if: always()
+
+ ###################################################
+ #
+ # Unfurl Artifacts
+ #
+ ###################################################
+
+ - name: (UNFURL-ARTIFACTS) Deploy the enterprise plan of unfurl-artifacts on GCP
+ run: |
+ vintner setup clean
+ vintner setup init
+
+ vintner orchestrators init unfurl --no-venv
+ vintner orchestrators enable --orchestrator unfurl
+
+ vintner templates import --template artifacts --path examples/unfurl-artifacts
+ vintner instances create --instance artifacts --template artifacts
+ vintner instances resolve --instance artifacts --inputs examples/unfurl-artifacts/tests/enterprise/inputs.yaml
+
+ echo "gcp_credentials: $(pwd)/gcp-credentials.json" > examples/unfurl-artifacts/deployment-inputs.ignored.yaml
+ vintner instances deploy --instance artifacts --inputs examples/unfurl-artifacts/deployment-inputs.ignored.yaml
+
+ - name: (UNFURL-ARTIFACTS) Test the enterprise plan of unfurl-artifacts on GCP
+ run: curl https://shop-dot-stoetzms-387808.ey.r.appspot.com
+
+ - name: (UNFURL-ARTIFACTS) Undeploy the enterprise plan of unfurl-artifacts on GCP
+ run: vintner instances undeploy --instance artifacts
+ if: always()
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index cdc39fad2e..6aff8c7a2f 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -4,19 +4,26 @@ on:
push:
branches:
- main
- - fix/workflow
+ - fix/release-workflow
jobs:
release:
name: Release
runs-on: ubuntu-22.04
steps:
+ ###################################################
+ #
+ # Prepare
+ #
+ ###################################################
+
- name: (PREPARE) Set up QEMU
uses: docker/setup-qemu-action@v2
- name: (PREPARE) Checkout Repository
uses: actions/checkout@v3
with:
+ lfs: true
fetch-depth: 0
- name: (PREPARE) Setup Apt Packages
@@ -40,7 +47,13 @@ jobs:
cache: pip
- name: (PREPARE) Install xOpera
- run: pip install opera
+ run: pip install opera==0.6.9
+
+ ###################################################
+ #
+ # Test
+ #
+ ###################################################
- name: (TEST) Check ESLint
run: yarn lint:check
@@ -57,6 +70,12 @@ jobs:
- name: (TEST) Run Tests
run: yarn test
+ ###################################################
+ #
+ # Build
+ #
+ ###################################################
+
- name: (BUILD) Build Project
run: yarn build
@@ -93,6 +112,12 @@ jobs:
tar -cJf ${BINARY}.xz ${BINARY}
done
+ ###################################################
+ #
+ # Release
+ #
+ ###################################################
+
- name: (RELEASE) Delete Latest Release
run: gh release delete latest || true
env:
@@ -128,6 +153,12 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ ###################################################
+ #
+ # Docs
+ #
+ ###################################################
+
- name: (DOCS) Setup Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index b1e6e02407..423081cdd0 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -10,11 +10,19 @@ jobs:
name: Tests
runs-on: ubuntu-22.04
steps:
+ ###################################################
+ #
+ # Prepare
+ #
+ ###################################################
+
- name: (PREPARE) Set up QEMU
uses: docker/setup-qemu-action@v2
- name: (PREPARE) Checkout Repository
uses: actions/checkout@v3
+ with:
+ lfs: true
- name: (PREPARE) Setup Node
uses: actions/setup-node@v3
@@ -32,7 +40,13 @@ jobs:
cache: pip
- name: (PREPARE) Install xOpera
- run: pip install opera
+ run: pip install opera==0.6.9
+
+ ###################################################
+ #
+ # Test
+ #
+ ###################################################
- name: (TEST) Check ESLint
run: yarn lint:check
@@ -49,6 +63,12 @@ jobs:
- name: (TEST) Run Tests
run: yarn test
+ ###################################################
+ #
+ # Build
+ #
+ ###################################################
+
- name: (BUILD) Build Project
run: yarn build
@@ -64,6 +84,12 @@ jobs:
- name: (BUILD) Package Binaries
run: yarn package
+ ###################################################
+ #
+ # Docs
+ #
+ ###################################################
+
- name: (DOCS) Install Dependencies
run: yarn docs:install
diff --git a/README.md b/README.md
index 42598d4043..4ddfa299d7 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,10 @@
# OpenTOSCA Vintner
-> Check out the [step-by-step guide](https://vintner.opentosca.org/variability4tosca/guides/artifacts) for the publication submitted at _CoopIS 2023_. Additional links are [below](#step-by-step-guides).
+> Check out the [step-by-step guide](https://vintner.opentosca.org/variability4tosca/guides/artifacts) for the publication submitted at _CoopIS 2023_. Additional links are [below](#stoetzner-2023-VDMMv2).
-[![release](https://github.com/opentosca/opentosca-vintner/actions/workflows/release.yaml/badge.svg?branch=main)](https://github.com/opentosca/opentosca-vintner/actions/workflows/release.yaml)
-[![Codacy Badge](https://app.codacy.com/project/badge/Grade/acec5103cf9b4f1bb1fa25bc5a99076d)](https://www.codacy.com/gh/OpenTOSCA/opentosca-vintner/dashboard?utm_source=github.com&utm_medium=referral&utm_content=OpenTOSCA/opentosca-vintner&utm_campaign=Badge_Grade)
+[![Release](https://github.com/opentosca/opentosca-vintner/actions/workflows/release.yaml/badge.svg?branch=main)](https://github.com/opentosca/opentosca-vintner/actions/workflows/release.yaml)
+[![Night](https://github.com/OpenTOSCA/opentosca-vintner/actions/workflows/night.yaml/badge.svg)](https://github.com/OpenTOSCA/opentosca-vintner/actions/workflows/night.yaml)
+[![Codacy Static Code Analysis Badge](https://app.codacy.com/project/badge/Grade/acec5103cf9b4f1bb1fa25bc5a99076d)](https://www.codacy.com/gh/OpenTOSCA/opentosca-vintner/dashboard?utm_source=github.com&utm_medium=referral&utm_content=OpenTOSCA/opentosca-vintner&utm_campaign=Badge_Grade)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](https://vintner.opentosca.org/code-of-conduct)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Platforms](https://img.shields.io/badge/Platforms-Linux%20%7C%20Windows-606c38.svg)](https://vintner.opentosca.org)
@@ -28,6 +29,7 @@ This repository holds the following specifications and profiles.
This repository holds the step-by-step guides of the following publications.
+
- **Managing the Variability of Component Implementations and Their Deployment Configurations Across Heterogeneous Deployment Technologies**
- CoopIS 2023
- _Currently under Review_
@@ -35,7 +37,7 @@ This repository holds the step-by-step guides of the following publications.
- [Model of the Motivating Scenario](examples/unfurl-artifacts)
- [Models of the Complexity Evaluation](examples/unfurl-artifacts/stats)
-
+
- **Modeling Different Deployment Variants of a Composite Application in a Single Declarative Deployment Model**
- Algorithms 2022
- https://doi.org/10.3390/a15100382
diff --git a/docs/docs/development/index.md b/docs/docs/development/index.md
index c6f557fd1a..6a49b418b9 100644
--- a/docs/docs/development/index.md
+++ b/docs/docs/development/index.md
@@ -46,6 +46,10 @@ Branches should be names as follows
Please squash your commits into a single commit with a short but meaningful message and delete the branch afterwards.
The commit message should not have a link to the merge request.
+## GitHub Flow
+
+Our branching workflow follows [GitHub Flow](https://docs.github.com/de/get-started/quickstart/github-flow){target=_blank}.
+
## Signed Commits
Commits are required to be signed.
@@ -389,3 +393,8 @@ Thereby, an existing release and `latest` tag is deleted.
There is only one release at total.
During the workflow the string `__VERSION__` inside a Javascript file is replace with the current commit hash.
The current version can be checked using `vintner --version`.
+
+## Night
+
+Every night, the `night` workflow is scheduled.
+This workflow ensures that the latest release is correctly signed and can be executed.
\ No newline at end of file
diff --git a/docs/docs/orchestrators.md b/docs/docs/orchestrators.md
index 5cad7be3d6..58ef5e5816 100644
--- a/docs/docs/orchestrators.md
+++ b/docs/docs/orchestrators.md
@@ -23,7 +23,7 @@ vintner orchestrators enable --orchestrator xopera-wsl
## Unfurl
```shell linenums="1"
-pip install unfurl[full]
+pip install unfurl
unfurl home --init
vintner orchestrators init unfurl
@@ -32,7 +32,7 @@ vintner orchestrators enable --orchestrator unfurl
## Unfurl WSL
```shell linenums="1"
-pip install unfurl[full]
+pip install unfurl
unfurl home --init
vintner orchestrators init unfurl-wsl
diff --git a/docs/docs/variability4tosca/guides/pruning/index.md b/docs/docs/variability4tosca/guides/pruning/index.md
index 43345ea68c..eb7510ec2a 100644
--- a/docs/docs/variability4tosca/guides/pruning/index.md
+++ b/docs/docs/variability4tosca/guides/pruning/index.md
@@ -35,7 +35,7 @@ vintner orchestrators enable --orchestrator xopera
Deploy the cloud variant of the pruning application.
Therefore, import the template, create an instance, resolve the variability and finally deploy the application.
-An example for the deployment inputs is given in {{ repo_link('examples/xopera-pruning/inputs.example.yaml') }}.
+An example for the deployment inputs is given in {{ repo_link('examples/xopera-pruning/deployment-inputs.example.yaml') }}.
```shell linenums="1"
# Add variable service template
diff --git a/docs/docs/variability4tosca/motivation/index.md b/docs/docs/variability4tosca/motivation/index.md
index 50217f7e66..e2ae47c477 100644
--- a/docs/docs/variability4tosca/motivation/index.md
+++ b/docs/docs/variability4tosca/motivation/index.md
@@ -100,7 +100,7 @@ The deployment will take some minutes.
```shell linenums="1"
# Deploy instance
-# See examples/xopera-motivation/inputs.example.yaml as reference
+# See examples/xopera-motivation/deployment-inputs.example.yaml as reference
vintner instances deploy --instance motivation --inputs ${INPUTS_PATH}
```
diff --git a/examples/xopera-motivation/inputs.example.yaml b/examples/xopera-motivation/deployment-inputs.example.yaml
similarity index 95%
rename from examples/xopera-motivation/inputs.example.yaml
rename to examples/xopera-motivation/deployment-inputs.example.yaml
index efb4a30f43..e377473509 100644
--- a/examples/xopera-motivation/inputs.example.yaml
+++ b/examples/xopera-motivation/deployment-inputs.example.yaml
@@ -2,6 +2,7 @@ release: abcdefgh
gcp_region: europe-west3
gcp_service_account_file: '***********************'
+gcp_project: stoetzms-387808
root_password: some-secret
diff --git a/examples/xopera-motivation/lib/gcp/appengine/engine/playbooks/create.yaml b/examples/xopera-motivation/lib/gcp/appengine/engine/playbooks/create.yaml
index 7afd91bf5d..eb3b98f9dc 100644
--- a/examples/xopera-motivation/lib/gcp/appengine/engine/playbooks/create.yaml
+++ b/examples/xopera-motivation/lib/gcp/appengine/engine/playbooks/create.yaml
@@ -1,10 +1,10 @@
---
-- name: Create GCP Engine App
+- name: Create GCP App Engine
hosts: all
gather_facts: false
tasks:
- name: active service account
- shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
+ shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'
# https://cloud.google.com/sql/docs/mysql/connect-instance-cloud-shell
- name: Enable Cloud Build API
diff --git a/examples/xopera-motivation/lib/gcp/sql/db/playbooks/create.yaml b/examples/xopera-motivation/lib/gcp/sql/db/playbooks/create.yaml
index 6d0c101589..80bad980ad 100644
--- a/examples/xopera-motivation/lib/gcp/sql/db/playbooks/create.yaml
+++ b/examples/xopera-motivation/lib/gcp/sql/db/playbooks/create.yaml
@@ -4,7 +4,7 @@
gather_facts: false
tasks:
- name: active service account
- shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
+ shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'
# https://cloud.google.com/sql/docs/mysql/create-manage-databases
- name: Create Database
diff --git a/examples/xopera-motivation/lib/gcp/sql/db/playbooks/delete.yaml b/examples/xopera-motivation/lib/gcp/sql/db/playbooks/delete.yaml
index 8d6024c48e..ff3a127582 100644
--- a/examples/xopera-motivation/lib/gcp/sql/db/playbooks/delete.yaml
+++ b/examples/xopera-motivation/lib/gcp/sql/db/playbooks/delete.yaml
@@ -4,7 +4,7 @@
gather_facts: false
tasks:
- name: active service account
- shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
+ shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'
# https://cloud.google.com/sql/docs/mysql/create-manage-databases
- name: Create Database
diff --git a/examples/xopera-motivation/lib/gcp/sql/dbms/playbooks/create.yaml b/examples/xopera-motivation/lib/gcp/sql/dbms/playbooks/create.yaml
index 9cfb2d9cec..c42f6bc873 100644
--- a/examples/xopera-motivation/lib/gcp/sql/dbms/playbooks/create.yaml
+++ b/examples/xopera-motivation/lib/gcp/sql/dbms/playbooks/create.yaml
@@ -4,7 +4,7 @@
gather_facts: false
tasks:
- name: active service account
- shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }}'
+ shell: 'gcloud auth activate-service-account --key-file {{ service_account_file }} --project {{ project }}'
# https://cloud.google.com/sql/docs/mysql/connect-instance-cloud-shell
- name: Enable Cloud SQL Admin API
@@ -12,11 +12,7 @@
# https://cloud.google.com/sql/docs/mysql/create-instance
- name: Create Instance
- shell: 'gcloud sql instances create {{ instance_name }} --tier {{ instance_tier }} --region {{ region }} --database-version={{ database_version }} --authorized-networks {{ authorized_networks }} --async'
- register: create_command
-
- - name: Wait until instance is created
- shell: 'gcloud beta sql operations wait {{ (create_command.stdout | from_yaml).name }}'
+ shell: 'gcloud sql instances create {{ instance_name }} --tier {{ instance_tier }} --region {{ region }} --database-version={{ database_version }} --authorized-networks {{ authorized_networks }} --timeout unlimited'
# https://cloud.google.com/sql/docs/mysql/create-instance
- name: Set Root Password
diff --git a/examples/xopera-motivation/lib/gcp/types.yaml b/examples/xopera-motivation/lib/gcp/types.yaml
index cfd15082b0..e4c2b7baa0 100644
--- a/examples/xopera-motivation/lib/gcp/types.yaml
+++ b/examples/xopera-motivation/lib/gcp/types.yaml
@@ -8,6 +8,8 @@ node_types:
type: string
service_account_file:
type: string
+ project:
+ type: string
capabilities:
host:
type: tosca.capabilities.Compute
@@ -30,18 +32,21 @@ node_types:
root_password:
type: string
+ authorized_networks:
+ type: string
+ # default: 0.0.0.0/0
+
region:
type: string
default: {get_property: [SELF, host, region]}
- # default: europe-west3
service_account_file:
type: string
default: {get_property: [SELF, host, service_account_file]}
- authorized_networks:
+ project:
type: string
- # default: 0.0.0.0/0
+ default: {get_property: [SELF, host, project]}
attributes:
public_address:
@@ -76,6 +81,10 @@ node_types:
type: string
value: {get_property: [SELF, root_password]}
+ authorized_networks:
+ type: string
+ value: {get_property: [SELF, authorized_networks]}
+
region:
type: string
value: {get_property: [SELF, region]}
@@ -84,9 +93,9 @@ node_types:
type: string
value: {get_property: [SELF, service_account_file]}
- authorized_networks:
+ project:
type: string
- value: {get_property: [SELF, authorized_networks]}
+ default: {get_property: [SELF, project]}
operations:
create: sql/dbms/playbooks/create.yaml
@@ -113,6 +122,14 @@ node_types:
type: string
default: {get_property: [SELF, host, service_account_file]}
+ region:
+ type: string
+ default: {get_property: [SELF, host, region]}
+
+ project:
+ type: string
+ default: {get_property: [SELF, host, project]}
+
capabilities:
database:
type: tosca.capabilities.Endpoint.Database
@@ -137,6 +154,14 @@ node_types:
type: string
value: {get_property: [SELF, service_account_file]}
+ region:
+ type: string
+ value: {get_property: [SELF, region]}
+
+ project:
+ type: string
+ default: {get_property: [SELF, project]}
+
operations:
create: sql/db/playbooks/create.yaml
delete: sql/db/playbooks/delete.yaml
@@ -156,6 +181,10 @@ node_types:
type: string
default: {get_property: [SELF, host, service_account_file]}
+ project:
+ type: string
+ default: {get_property: [SELF, host, project]}
+
capabilities:
host:
type: tosca.capabilities.Compute
@@ -176,5 +205,9 @@ node_types:
type: string
value: {get_property: [SELF, service_account_file]}
+ project:
+ type: string
+ default: {get_property: [SELF, project]}
+
operations:
create: appengine/engine/playbooks/create.yaml
diff --git a/examples/xopera-motivation/lib/node/application/playbooks/gcp.create.yaml b/examples/xopera-motivation/lib/node/application/playbooks/gcp.create.yaml
index cfcc88cc61..9e285de9fc 100644
--- a/examples/xopera-motivation/lib/node/application/playbooks/gcp.create.yaml
+++ b/examples/xopera-motivation/lib/node/application/playbooks/gcp.create.yaml
@@ -1,10 +1,10 @@
---
-- name: Create GCP Engine App
+- name: Create GCP Node Application
hosts: all
gather_facts: false
tasks:
- name: active service account
- shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }}'
+ shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }} --project {{ gcp_project }}'
- name: Create working directory
tempfile:
diff --git a/examples/xopera-motivation/lib/node/application/playbooks/gcp.delete.yaml b/examples/xopera-motivation/lib/node/application/playbooks/gcp.delete.yaml
index 9194cfd85a..7686284c56 100644
--- a/examples/xopera-motivation/lib/node/application/playbooks/gcp.delete.yaml
+++ b/examples/xopera-motivation/lib/node/application/playbooks/gcp.delete.yaml
@@ -1,10 +1,10 @@
---
-- name: Create GCP Engine App
+- name: Delete GCP Node Application
hosts: all
gather_facts: false
tasks:
- name: active service account
- shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }}'
+ shell: 'gcloud auth activate-service-account --key-file {{ gcp_service_account_file }} --project {{ gcp_project }}'
- name: Create App
shell: 'gcloud app services delete {{ application_name }} --quiet'
diff --git a/examples/xopera-motivation/lib/node/types.yaml b/examples/xopera-motivation/lib/node/types.yaml
index 4cb302da4c..d594b2d063 100644
--- a/examples/xopera-motivation/lib/node/types.yaml
+++ b/examples/xopera-motivation/lib/node/types.yaml
@@ -55,6 +55,12 @@ node_types:
gcp_service_account_file:
type: string
+ gcp_region:
+ type: string
+
+ gcp_project:
+ type: string
+
attributes:
public_address:
type: string
@@ -103,6 +109,13 @@ node_types:
type: string
value: {get_property: [SELF, gcp_service_account_file]}
+ gcp_region:
+ type: string
+ value: {get_property: [SELF, gcp_region]}
+
+ gcp_project:
+ type: string
+ value: {get_property: [SELF, gcp_project]}
operations:
create:
implementation:
diff --git a/examples/xopera-motivation/scripts/demo-prod.sh b/examples/xopera-motivation/scripts/demo-prod.sh
new file mode 100644
index 0000000000..966b74e280
--- /dev/null
+++ b/examples/xopera-motivation/scripts/demo-prod.sh
@@ -0,0 +1,12 @@
+#! /usr/bin/bash
+set -e
+
+yarn cli setup clean
+yarn cli setup init
+yarn cli orchestrators init xopera-wsl
+yarn cli orchestrators enable --orchestrator xopera-wsl
+
+yarn cli templates import --template motivation --path examples/xopera-motivation
+yarn cli instances create --instance motivation --template motivation
+yarn cli instances resolve --instance motivation --presets prod
+yarn cli instances deploy --instance motivation --inputs examples/xopera-motivation/deployment-inputs.ignored.yaml
diff --git a/examples/xopera-motivation/demo.sh b/examples/xopera-motivation/scripts/demo.sh
similarity index 100%
rename from examples/xopera-motivation/demo.sh
rename to examples/xopera-motivation/scripts/demo.sh
diff --git a/examples/xopera-motivation/variable-service-template.yaml b/examples/xopera-motivation/variable-service-template.yaml
index a3b267337e..b54d9ad600 100644
--- a/examples/xopera-motivation/variable-service-template.yaml
+++ b/examples/xopera-motivation/variable-service-template.yaml
@@ -11,6 +11,9 @@ topology_template:
release:
type: string
+ gcp_project:
+ type: string
+
gcp_region:
type: string
@@ -95,6 +98,8 @@ topology_template:
vm_ssh_user: {get_input: private_vm_ssh_user}
vm_ssh_key_file: {get_input: private_vm_ssh_key_file}
gcp_service_account_file: {get_input: gcp_service_account_file}
+ gcp_project: {get_input: gcp_project}
+ gcp_region: {get_input: gcp_region}
requirements:
- host:
node: dev_runtime
@@ -148,6 +153,7 @@ topology_template:
properties:
region: {get_input: gcp_region}
service_account_file: {get_input: gcp_service_account_file}
+ project: {get_input: gcp_project}
dev_runtime:
type: node.runtime