builder: drop invalidation logic
This commit is contained in:
parent
d6d00d25da
commit
650733849d
21
builder.py
21
builder.py
@ -58,7 +58,6 @@ TARGETS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MANIFEST_URI = os.getenv("MANIFEST_URI")
|
MANIFEST_URI = os.getenv("MANIFEST_URI")
|
||||||
CF_DISTRIBUTION = os.getenv("CF_DISTRIBUTION")
|
|
||||||
S3_BUCKET = os.getenv("S3_BUCKET")
|
S3_BUCKET = os.getenv("S3_BUCKET")
|
||||||
|
|
||||||
|
|
||||||
@ -144,19 +143,6 @@ def uploadToS3(source, destination):
|
|||||||
s3.upload_file(source, S3_BUCKET, destination)
|
s3.upload_file(source, S3_BUCKET, destination)
|
||||||
|
|
||||||
|
|
||||||
def invalidateCF(path):
|
|
||||||
cf = boto3.client("cloudfront")
|
|
||||||
res = cf.create_invalidation(
|
|
||||||
DistributionId=CF_DISTRIBUTION,
|
|
||||||
InvalidationBatch={
|
|
||||||
"Paths": {"Quantity": 1, "Items": [path]},
|
|
||||||
"CallerReference": str(time.time()).replace(".", ""),
|
|
||||||
},
|
|
||||||
)
|
|
||||||
invalidation_id = res["Invalidation"]["Id"]
|
|
||||||
return invalidation_id
|
|
||||||
|
|
||||||
|
|
||||||
def packageUpload(target):
|
def packageUpload(target):
|
||||||
package = f"fedora-{RELEASE}-{target['id']}-{TODAY}.zip"
|
package = f"fedora-{RELEASE}-{target['id']}-{TODAY}.zip"
|
||||||
|
|
||||||
@ -213,14 +199,12 @@ def upload(target):
|
|||||||
packageUpload(target)
|
packageUpload(target)
|
||||||
manifestUpdate()
|
manifestUpdate()
|
||||||
uploadToS3("merged_installer_data.json", "installer_data.json")
|
uploadToS3("merged_installer_data.json", "installer_data.json")
|
||||||
invalidateCF("/installer_data.json")
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option("--update/--no-update", default=False)
|
@click.option("--update/--no-update", default=False)
|
||||||
@click.option("--upload/--no-upload", default=False)
|
@click.option("--upload/--no-upload", default=False)
|
||||||
@click.option("--invalidate/--no-invalidate", default=False)
|
def manifest(update, upload):
|
||||||
def manifest(update, upload, invalidate):
|
|
||||||
if update:
|
if update:
|
||||||
manifestUpdate()
|
manifestUpdate()
|
||||||
manifest = "merged_installer_data.json"
|
manifest = "merged_installer_data.json"
|
||||||
@ -231,9 +215,6 @@ def manifest(update, upload, invalidate):
|
|||||||
|
|
||||||
click.echo(json.dumps(manifest, indent=2))
|
click.echo(json.dumps(manifest, indent=2))
|
||||||
|
|
||||||
if invalidate:
|
|
||||||
invalidateCF("/installer_data.json")
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
def clean():
|
def clean():
|
||||||
|
Loading…
Reference in New Issue
Block a user