Skip to content

GCP Marketplace VM Creation Workflow #28

GCP Marketplace VM Creation Workflow

GCP Marketplace VM Creation Workflow #28

# This is a basic workflow to help you get started with Actions
name: GCP Marketplace VM Creation Workflow
# Controls when the action will run.
# Controls when the action will run.
on:
workflow_dispatch:
inputs:
name:
description: "VM Name"
required: true
zone:
description: "GCP Zone for VM creation"
required: true
default: us-east1-b
version:
description: "Couchbase Server/Gateway Version"
required: true
default: "7.0.2"
syncgateway:
description: "Gateway (Y/N)?"
type: choice
required: true
default: "N"
options:
- "Y"
- "N"
syncgatewayversion:
description: "Couchbase Sync Gateway Version"
required: true
default: "3.0.4"
license:
description: "Marketplace License"
required: true
family:
description: "VM Family Name"
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
gcp-vm-release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: GCP Setup
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_VM_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_COUCHBASE_PUBLIC_SA_KEY }}
export_default_credentials: true
- name: Echo $GITHUB_WORKSPACE
run: echo "$GITHUB_WORKSPACE"
# Runs a set of commands using the runners shell
- name: Create Couchbase Server Enterprise Image
if: ${{ github.event.inputs.syncgateway == 'N' }}
env:
NAME: ${{github.event.inputs.name}}
ZONE: ${{github.event.inputs.zone}}
VERSION: ${{github.event.inputs.version}}
LICENSE: ${{github.event.inputs.license}}
FAMILY: ${{github.event.inputs.family}}
timeout-minutes: 15
run: |
bash ${GITHUB_WORKSPACE}/gcp/couchbase-vm-generation/create.sh \
-l "$LICENSE" \
-n "$NAME" \
-z "$ZONE" \
-p couchbase-public \
-f ubuntu-2004-lts \
-i ubuntu-os-cloud \
-c "$FAMILY" \
-v "$VERSION"
- name: Create Couchbase Sync Gateway Image
if: ${{ github.event.inputs.syncgateway == 'Y' }}
env:
NAME: ${{github.event.inputs.name}}
ZONE: ${{github.event.inputs.zone}}
VERSION: ${{github.event.inputs.syncgatewayversion}}
LICENSE: ${{github.event.inputs.license}}
FAMILY: ${{github.event.inputs.family}}
timeout-minutes: 15
run: |
bash ${GITHUB_WORKSPACE}/gcp/couchbase-vm-generation/create.sh \
-l "$LICENSE" \
-n "$NAME" \
-z "$ZONE" \
-p couchbase-public \
-f ubuntu-2004-lts \
-i ubuntu-os-cloud \
-c "$FAMILY" \
-v "$VERSION" \
-g