public class DeployKt
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bucketName(java.lang.String appName,
java.lang.String envName,
java.lang.String suffix,
java.lang.String prefix)
Returns the name of a bucket for the environment and API with the specified prefix and 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 bucketName)
Creates an S3 bucket.
|
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.
|
@NotNull
public static java.util.List<java.lang.String> deployStages(@NotNull
AwsProfile profile,
@NotNull
java.lang.String apiId,
@NotNull
java.lang.String apiName,
@NotNull
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.
@NotNull
public static java.lang.String createBucket(@NotNull
AwsProfile profile,
@NotNull
java.lang.String bucketName)
Creates an S3 bucket.
If the bucket already exists the function does nothing.
@NotNull
public static java.lang.String uploadFile(@NotNull
AwsProfile profile,
@NotNull
java.nio.file.Path file,
@NotNull
java.lang.String bucketName,
@Nullable
java.lang.String key)
Uploads a file to an S3 bucket and returns the URL of the file in S3.
@NotNull
public static java.lang.String uploadFile(@NotNull
AwsProfile profile,
@NotNull
java.nio.file.Path file,
@NotNull
java.lang.String bucketName,
@NotNull
java.nio.file.Path baseDir,
@Nullable
java.lang.String key,
@Nullable
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.
@NotNull
public static java.lang.String bucketName(@NotNull
java.lang.String appName,
@Nullable
java.lang.String envName,
@NotNull
java.lang.String suffix,
@Nullable
java.lang.String prefix)
@NotNull
public static java.lang.String codeBucketName(@NotNull
java.lang.String apiName,
@Nullable
java.lang.String envName,
@Nullable
java.lang.String prefix)
Returns the default name of the S3 bucket from which code is deployed
@NotNull
public static java.lang.String staticFilesBucketName(@NotNull
java.lang.String apiName,
@Nullable
java.lang.String envName,
@Nullable
java.lang.String prefix)
Returns the name of the static files bucket for the API.