public class DeployKt
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bucketName(java.lang.String apiName,
java.lang.String envName,
java.lang.String suffix,
java.lang.String prefix)
Returns the name of a bucket for the group and API with the specified suffix.
|
static java.lang.String |
codeBucketName(java.lang.String apiName,
java.lang.String envName,
java.lang.String prefix)
Returns the default name of the S3 bucket from which code is deployed
|
static java.lang.String |
createBucket(AwsProfile profile,
java.lang.String apiName,
java.lang.String envName,
java.lang.String suffix,
java.lang.String prefix)
Creates an S3 bucket to hold static files.
|
static java.util.List<java.lang.String> |
deployStages(AwsProfile profile,
java.lang.String apiId,
java.lang.String apiName,
java.util.List<ws.osiris.aws.Stage> stages,
boolean stackCreated)
Deploys the API to the stages and returns the names of the stages that were updated.
|
static java.lang.String |
staticFilesBucketName(java.lang.String apiName,
java.lang.String envName,
java.lang.String prefix)
Returns the name of the static files bucket for the API.
|
static java.lang.String |
uploadFile(AwsProfile profile,
java.nio.file.Path file,
java.lang.String bucketName,
java.lang.String key)
Uploads a file to an S3 bucket and returns the URL of the file in S3.
|
static java.lang.String |
uploadFile(AwsProfile profile,
java.nio.file.Path file,
java.lang.String bucketName,
java.nio.file.Path baseDir,
java.lang.String key,
java.lang.String bucketDir)
Uploads a file to an S3 bucket and returns the URL of the file in S3.
|
public static java.util.List<java.lang.String> deployStages(AwsProfile profile, java.lang.String apiId, java.lang.String apiName, java.util.List<ws.osiris.aws.Stage> stages, boolean stackCreated)
Deploys the API to the stages and returns the names of the stages that were updated.
If the API is being deployed for the first time then all stages are deployed. If the API
was updated then only stages where deployOnUpdate is true are deployed.
public static java.lang.String createBucket(AwsProfile profile, java.lang.String apiName, java.lang.String envName, java.lang.String suffix, java.lang.String prefix)
Creates an S3 bucket to hold static files.
The bucket name is ${API name}.static-files, converted to lower case.
If the bucket already exists the function does nothing.
public static java.lang.String uploadFile(AwsProfile profile, java.nio.file.Path file, java.lang.String bucketName, java.lang.String key)
Uploads a file to an S3 bucket and returns the URL of the file in S3.
public static java.lang.String uploadFile(AwsProfile profile, java.nio.file.Path file, java.lang.String bucketName, java.nio.file.Path baseDir, java.lang.String key, java.lang.String bucketDir)
Uploads a file to an S3 bucket and returns the URL of the file in S3.
The file should be under baseDir on the filesystem. The S3 key for the file will be the relative path
from the base directory to the file.
For example, if baseDir is /foo/bar and the file is /foo/bar/baz/qux.txt then the file will be
uploaded to S3 with the key `baz/qux.txt
The key can be specified by the caller in which case it is used instead of automatically generating a key.
public static java.lang.String bucketName(java.lang.String apiName,
java.lang.String envName,
java.lang.String suffix,
java.lang.String prefix)
Returns the name of a bucket for the group and API with the specified suffix.
The bucket name is
public static java.lang.String codeBucketName(java.lang.String apiName,
java.lang.String envName,
java.lang.String prefix)
Returns the default name of the S3 bucket from which code is deployed
public static java.lang.String staticFilesBucketName(java.lang.String apiName,
java.lang.String envName,
java.lang.String prefix)
Returns the name of the static files bucket for the API.