|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +PRODUCT_VERSION="${1?Argument specifying new AWS Marketplace product version is required.}" |
| 4 | + |
| 5 | +DETAILS_JSON='{ |
| 6 | + "DeliveryOptions": [ |
| 7 | + { |
| 8 | + "Details": { |
| 9 | + "ContainerProductDeliveryOptionDetails": { |
| 10 | + "ContainerImages": [ |
| 11 | + { |
| 12 | + "ImageDigest": "sha256:abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", |
| 13 | + "ImageTag": "latest" |
| 14 | + } |
| 15 | + ], |
| 16 | + "DeliveryOptionTitle": "Deploy using Helm and Terraform", |
| 17 | + "DeliveryOptionType": "Public", |
| 18 | + "Description": "This option supports deployment of Liferay using Helm and Terraform.\n\nService Dependencies\n\nThere are 3 service dependencies which are instantiated using Terraform scripts; an RDS Postgres database, an OpenSearch domain and an S3 bucket.\n\nThese are created within the AWS account executing the Terraform scripts and are fully under control of the account owner.", |
| 19 | + "EcrRepositoryArn": "arn:aws:ecr:us-east-1:123456789012:repository/my-ecr-repo", |
| 20 | + "EcrRepositoryName": "liferay/charts", |
| 21 | + "HelmInstallationNamespace": "liferay-system", |
| 22 | + "HelmReleaseName": "liferay", |
| 23 | + "KubernetesServiceAccountName": "liferay-default", |
| 24 | + "SupportedRegions": [ |
| 25 | + "us-east-1", |
| 26 | + "us-west-2" |
| 27 | + ], |
| 28 | + "SupportedServices": [ |
| 29 | + "Amazon Elastic Kubernetes Service (EKS)" |
| 30 | + ] |
| 31 | + } |
| 32 | + }, |
| 33 | + |
| 34 | + } |
| 35 | + ], |
| 36 | + "Version": { |
| 37 | + "ReleaseNotes": "My new Release notes", |
| 38 | + "VersionTitle": "'${PRODUCT_VERSION}'" |
| 39 | + } |
| 40 | +}' |
| 41 | +ENTITY_ID="prod-7xd5pjyie6zee" |
| 42 | + |
| 43 | + |
| 44 | +CHANGE_SET_JSON='[ |
| 45 | + { |
| 46 | + "ChangeType": "AddDeliveryOptions", |
| 47 | + "Details": '"${DETAILS_JSON}"', |
| 48 | + "Entity": { |
| 49 | + "Identifier": "'${ENTITY_ID}'", |
| 50 | + "Type": "'${ENTITY_TYPE}'" |
| 51 | + } |
| 52 | + } |
| 53 | +]' |
| 54 | +CHANGE_SET_JSON_STRING=$(echo "${CHANGE_SET_JSON}" | jq 'tostring') |
| 55 | + |
| 56 | +configure_aws() { |
| 57 | + aws sso login |
| 58 | +} |
| 59 | + |
| 60 | +start_change_set() { |
| 61 | + aws marketplate-catalog start-change-set \ |
| 62 | + --catalog "AWSMarketplace" \ |
| 63 | + --change-set "${CHANGE_SET_JSON_STRING}" |
| 64 | +} |
| 65 | + |
| 66 | +main() { |
| 67 | + echo "Using product version: ${PRODUCT_VERSION}" |
| 68 | + |
| 69 | + configure_aws |
| 70 | + |
| 71 | + start_change_set |
| 72 | +} |
| 73 | + |
| 74 | +main |
0 commit comments