Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,15 @@ jobs:
(Get-Content chocolatey/azion.nuspec) -replace '<version>.*</version>', "<version>$version</version>" | Set-Content chocolatey/azion.nuspec
shell: pwsh

# Step 4: Download the Azion executable
- name: Download Azion executable
run: |
$toolsDir = "$(Resolve-Path .\chocolatey\tools)"
New-Item -ItemType Directory -Force -Path $toolsDir | Out-Null
$outputFile = Join-Path $toolsDir 'azion.exe'
$url = 'http://downloads.azion.com/windows/x86_64/azion'
Invoke-WebRequest -Uri $url -OutFile $outputFile
shell: pwsh

# Step 5: Calculate checksum
# Step 4: Download file temporarily to calculate checksum (do not embed in package)
- name: Calculate checksum
id: calculate-checksum
run: |
$outputFile = "$(Resolve-Path .\chocolatey\tools\azion.exe)"
$checksum = (Get-FileHash -Path $outputFile -Algorithm SHA256).Hash
$url = 'http://downloads.azion.com/windows/x86_64/azion'
$tempFile = Join-Path $env:TEMP 'azion_temp.exe'
Invoke-WebRequest -Uri $url -OutFile $tempFile
$checksum = (Get-FileHash -Path $tempFile -Algorithm SHA256).Hash
Remove-Item $tempFile
echo "::set-output name=checksum::$checksum"
shell: pwsh

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GLOBAL_TOKEN }}

- name: Setting GIT
run: git config --global url."https://${{ secrets.GLOBAL_TOKEN }}:x-oauth-basic@github.com/aziontech".insteadOf "https://github.com/aziontech"
Expand All @@ -33,7 +34,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{github.repository}}.wiki
repository: ${{ github.repository }}.wiki
token: ${{ secrets.GLOBAL_TOKEN }}
path: wiki

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scc-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: SCC Complexity Check
on:
pull_request:
branches: [main]
types: [opened, synchronize, labeled, unlabeled]

jobs:
scc-check:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-scc') }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
25 changes: 0 additions & 25 deletions chocolatey/tools/LICENSE.txt

This file was deleted.

5 changes: 0 additions & 5 deletions chocolatey/tools/VERIFICATION.txt

This file was deleted.

50 changes: 0 additions & 50 deletions chocolatey/tools/chocolateyuninstall.ps1

This file was deleted.

5 changes: 4 additions & 1 deletion pkg/cmd/deploy_remote/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ func (cmd *DeployCmd) doBucket(
client *api.Client,
ctx context.Context,
conf *contracts.AzionApplicationOptions,
msgs *[]string) error {
msgs *[]string,
manifestStorage []contracts.StorageManifest) error {
if conf.Bucket != "" {
return nil
}
Expand All @@ -32,6 +33,8 @@ func (cmd *DeployCmd) doBucket(
bucketAccess := "read_only"
if WriteBucket {
bucketAccess = "read_write"
} else if manifestStorage[0].EdgeAccess != "" {
bucketAccess = manifestStorage[0].EdgeAccess
}
err := client.CreateBucket(ctx, api.RequestBucket{BucketCreateRequest: sdk.BucketCreateRequest{Name: nameBucket, EdgeAccess: bucketAccess}})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/deploy_remote/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (cmd *DeployCmd) Run(f *cmdutil.Factory) error {
if len(manifestStructure.Storage) == 0 {
logger.Debug(msg.SkipBucket)
} else {
err = cmd.doBucket(clients.Bucket, ctx, conf, &msgs)
err = cmd.doBucket(clients.Bucket, ctx, conf, &msgs, manifestStructure.Storage)
if err != nil {
return err
}
Expand Down
8 changes: 5 additions & 3 deletions pkg/v3commands/deploy_remote/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ var injectIntoFunction = `
// bucket: %s
// prefix: %s
//---

/* this temporary binding is used to inject the storage name and prefix into the function file */
globalThis.AZION_BUCKET_NAME = '%s';
globalThis.AZION_BUCKET_PREFIX = '%s';
`

func (cmd *DeployCmd) doFunction(clients *Clients, ctx context.Context, conf *contracts.AzionApplicationOptionsV3, msgs *[]string) error {
Expand Down Expand Up @@ -311,7 +313,7 @@ func (cmd *DeployCmd) createFunction(client *api.Client, ctx context.Context, co
return 0, fmt.Errorf("%s: %w", msg.ErrorCodeFlag, err)
}

prependText := fmt.Sprintf(injectIntoFunction, conf.Bucket, conf.Prefix)
prependText := fmt.Sprintf(injectIntoFunction, conf.Bucket, conf.Prefix, conf.Bucket, conf.Prefix)
newCode := append([]byte(prependText), code...)

reqCre.SetCode(string(newCode))
Expand Down Expand Up @@ -356,7 +358,7 @@ func (cmd *DeployCmd) updateFunction(client *api.Client, ctx context.Context, co
return 0, fmt.Errorf("%s: %w", msg.ErrorCodeFlag, err)
}

prependText := fmt.Sprintf(injectIntoFunction, conf.Bucket, conf.Prefix)
prependText := fmt.Sprintf(injectIntoFunction, conf.Bucket, conf.Prefix, conf.Bucket, conf.Prefix)
newCode := append([]byte(prependText), code...)

reqUpd.SetCode(string(newCode))
Expand Down
Loading