Skip to content

Commit

Permalink
Merge pull request #977 from aziontech/dev
Browse files Browse the repository at this point in the history
Deploy to Production - 2024/10/22
  • Loading branch information
PatrickMenoti authored Oct 22, 2024
2 parents e04e6f7 + 1d3e9eb commit 73c1a06
Show file tree
Hide file tree
Showing 49 changed files with 1,347 additions and 84 deletions.
2 changes: 1 addition & 1 deletion cmd/azion/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func main() {
streams := iostreams.System()
httpClient := &http.Client{
Timeout: 20 * time.Second, // TODO: Configure this somewhere
Timeout: 50 * time.Second, // TODO: Configure this somewhere
}

tok, _ := token.ReadSettings()
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/MakeNowJust/heredoc v1.0.0
github.com/aziontech/azionapi-go-sdk v0.133.0
github.com/aziontech/go-thoth v0.0.0-20240228144710-d061a88cc39f
github.com/aziontech/tablecli v0.0.0-20240513193320-c4dbf16b013a
github.com/aziontech/tablecli v0.0.0-20241007135202-07712c07aa9e
github.com/briandowns/spinner v1.23.1
github.com/fatih/color v1.17.0
github.com/go-git/go-git/v5 v5.12.0
Expand All @@ -29,7 +29,7 @@ require (
github.com/tidwall/gjson v1.17.3
github.com/tidwall/sjson v1.2.5
github.com/zRedShift/mimemagic v1.2.0
github.com/zcalusic/sysinfo v1.0.2
github.com/zcalusic/sysinfo v1.1.2
go.uber.org/zap v1.27.0
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -49,7 +49,7 @@ require (
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ github.com/aziontech/go-thoth v0.0.0-20240228144710-d061a88cc39f h1:b0IX6tpiiG+Q
github.com/aziontech/go-thoth v0.0.0-20240228144710-d061a88cc39f/go.mod h1:v4AMg2JrM68ckr2nt7c7PRuOELek/JbVRa62+inlprQ=
github.com/aziontech/tablecli v0.0.0-20240513193320-c4dbf16b013a h1:jKR7y/1ePDPZkfKgqj7gUK9XB7KRHsyHci8tJXD3YTM=
github.com/aziontech/tablecli v0.0.0-20240513193320-c4dbf16b013a/go.mod h1:1GXfg8O4vlOUrZRtMShaaUjJ0d9CQ5acecAMkpZ+fOo=
github.com/aziontech/tablecli v0.0.0-20241007135202-07712c07aa9e h1:4jnF5abLeCo+SqWNvegJjFuK1FUpIuuy09Fsfj2Ys+0=
github.com/aziontech/tablecli v0.0.0-20241007135202-07712c07aa9e/go.mod h1:1GXfg8O4vlOUrZRtMShaaUjJ0d9CQ5acecAMkpZ+fOo=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/briandowns/spinner v1.23.1 h1:t5fDPmScwUjozhDj4FA46p5acZWIPXYE30qW2Ptu650=
Expand Down Expand Up @@ -157,8 +159,8 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down Expand Up @@ -290,8 +292,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zRedShift/mimemagic v1.2.0 h1:tfX2W91dg2wG8YyZAPmameP6q1YuuIw3TveWbc7NnAE=
github.com/zRedShift/mimemagic v1.2.0/go.mod h1:duzwAfYjsWttqB0a7CuXPvriYZ96ytLW0zMfMxDhXCY=
github.com/zcalusic/sysinfo v1.0.2 h1:nwTTo2a+WQ0NXwo0BGRojOJvJ/5XKvQih+2RrtWqfxc=
github.com/zcalusic/sysinfo v1.0.2/go.mod h1:kluzTYflRWo6/tXVMJPdEjShsbPpsFRyy+p1mBQPC30=
github.com/zcalusic/sysinfo v1.1.2 h1:38KUgZQmCxlN9vUTt4miis4rU5ISJXGXOJ2rY7bMC8g=
github.com/zcalusic/sysinfo v1.1.2/go.mod h1:NX+qYnWGtJVPV0yWldff9uppNKU4h40hJIRPf/pGLv4=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
Expand Down
2 changes: 1 addition & 1 deletion messages/build/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "errors"

var (
ErrorBuilding = errors.New("Failed to build your resource. Azion configuration not found. Make sure you are in the root directory of your local repository and have already initialized or linked your resource with the commands 'azion init' or 'azion link'")
ErrorVulcanExecute = errors.New("Error executing Vulcan: %s")
ErrorVulcanExecute = errors.New("Error executing Bundler: %s")
EdgeApplicationsOutputErr = errors.New("This output-ctrl option is not available. Read the readme files found in the repository https://github.com/aziontech/azion-template and try again")
ErrFailedToRunBuildCommand = errors.New("Failed to run the build command. Verify if the command is correct and check the output above for more details. Run the 'azion build' command again or contact Azion's support")
ErrorUnmarshalConfigFile = errors.New("Failed to unmarshal the config.json file. Verify if the file format is JSON or fix its content according to the JSON format specification at https://www.json.org/json-en.html")
Expand Down
4 changes: 2 additions & 2 deletions messages/deploy/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var (
DeployShortDescription = "Deploys an Edge Application"
DeployLongDescription = "Deploys an Edge Application"
DeploySuccessful = "Your Edge Application was deployed successfully\n"
SimpleDeploySuccessful = "Your simple Edge Application was deployed successfully\n"
DeployOutputDomainSuccess = "\nTo visualize your application access the Domain: %v\n"
EdgeApplicationDeployDomainHint = "You may now edit your Domain and add your own CNAMES. To do this you may run 'azion domain update' command and also configure your DNS\n"
DeployOutputCachePurge = "Domain cache was purged\n"
Expand All @@ -21,6 +20,7 @@ var (
EdgeApplicationDeployPathFlag = "Path to where your static files are stored"
EdgeApplicationDeployProjectConfFlag = "Relative path to where your custom azion.json and args.json files are stored"
EdgeApplicationDeploySync = "Synchronizes the local azion.json file with remote resources"
EdgeApplicationDeployLocal = "Runs the entire build and deploy process locally"
EdgeApplicationDeployDryrun = "Simulates the deploy process without carrying out any actual action"
EnvFlag = "Relative path to where your custom .env file is stored"
OriginsSuccessful = "Created Origin for Edge Application\n"
Expand All @@ -33,7 +33,7 @@ var (
DeployFlagNoPrompt = "If sent, whenever the CLI would display an interactive prompt due to an error, it instead just returns the error"
DeployFlagSkipBuild = "If sent, the build command will not be called during the deploy process"
DeployPropagation = "Your application is being deployed to all Azion Edge Locations and it might take a few minutes.\n"
UploadStart = "Uploading static files\n"
UploadStart = "Uploading source files\n"
UploadSuccessful = "\nUpload completed successfully!\n"
BucketInUse = "This bucket's name is already in use, please try another one\n"
AppInUse = "This Edge Application's name is already in use, please try another one\n"
Expand Down
2 changes: 1 addition & 1 deletion messages/dev/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package dev
import "errors"

var (
ErrorVulcanExecute = errors.New("Error executing Vulcan: %s")
ErrorVulcanExecute = errors.New("Error executing Bundler: %s")
ErrFailedToRunDevCommand = errors.New("Failed to run dev command. Verify if the command is correct and check the output above for more details. Run the 'azion dev' command again or contact Azion's support")
)
1 change: 1 addition & 0 deletions messages/dev/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ var (
DevShortDescription = "Starts a local development server for the current application"
DevLongDescription = "Starts a local development server for the current application, so it's possible to preview and test it locally before the deployment"
IsFirewall = "Indicates whether the function to be run is intended for the Edge Firewall"
PortFlag = "Indicates which port to use when starting localhost environment"
)
6 changes: 3 additions & 3 deletions messages/init/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import "errors"
var (
EdgeApplicationsOutputErr = errors.New("This output-ctrl option is not available. Read the readme files found in the repository https://github.com/aziontech/azion-template and try again")

ErrorVulcanExecute = errors.New("Error executing Vulcan: %s")
ErrorUpdatingVulcan = errors.New("Failed to update Vulcan: %s")
ErrorInstallVulcan = errors.New("Failed to install Vulcan: %s")
ErrorVulcanExecute = errors.New("Error executing Bundler: %s")
ErrorUpdatingVulcan = errors.New("Failed to update Bundler: %s")
ErrorInstallVulcan = errors.New("Failed to install Bundler: %s")
ErrorOpeningConfigFile = errors.New("Failed to open the config.json file. The file doesn't exist, is corrupted, or has an invalid JSON format. Verify if the file format is JSON or fix its content according to the JSON format specification at https://www.json.org/json-en.html")
ErrorUnmarshalConfigFile = errors.New("Failed to unmarshal the config.json file. Verify if the file format is JSON or fix its content according to the JSON format specification at https://www.json.org/json-en.html")
ErrFailedToRunInitCommand = errors.New("Failed to run the init step command. Verify if the command is correct and check the output above for more details. Try the 'azion init' command again or contact Azion's support")
Expand Down
3 changes: 3 additions & 0 deletions messages/init/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const (
FLAG_TEMPLATE = "The Template's name"
FLAG_PACKAGE_MANAGE = "Specify the package manager to use (e.g., npm, yarn, pnpm)"
FLAG_AUTO = "If sent, the entire flow of the command will be run without interruptions"
FLAG_SYNC = "Synchronizes the local azion.json file with remote resources. Use this flag when deploying your project from this command"
FLAG_LOCAL = "Runs the entire build and deploy process locally. Use this flag when deploying your project from this command"
)

var (
Expand Down Expand Up @@ -38,4 +40,5 @@ var (
AskLocalDev = "Do you want to start a local development server? (y/N)"
AskGitignore = "Azion CLI creates some files during the build process for internal use. Would you like to add these to your .gitignore file? (Y/n)"
WrittenGitignore = "Sucessfully written to your .gitignore file\n"
ChangeWorkingDir = "Make sure to change to the new working directory before running building or deploying your project\n"
)
6 changes: 3 additions & 3 deletions messages/link/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import "errors"
var (
EdgeApplicationsOutputErr = errors.New("This output-ctrl option is not available. Read the readme files found in the repository https://github.com/aziontech/azion-template and try again")

ErrorVulcanExecute = errors.New("Error executing Vulcan: %s")
ErrorUpdatingVulcan = errors.New("Failed to update Vulcan: %s")
ErrorInstallVulcan = errors.New("Failed to install Vulcan: %s")
ErrorVulcanExecute = errors.New("Error executing Bundler: %s")
ErrorUpdatingVulcan = errors.New("Failed to update Bundler: %s")
ErrorInstallVulcan = errors.New("Failed to install Bundler: %s")
ErrorOpeningConfigFile = errors.New("Failed to open the config.json file. The file doesn't exist, is corrupted, or has an invalid JSON format. Verify if the file format is JSON or fix its content according to the JSON format specification at https://www.json.org/json-en.html")
ErrorUnmarshalConfigFile = errors.New("Failed to unmarshal the config.json file. Verify if the file format is JSON or fix its content according to the JSON format specification at https://www.json.org/json-en.html")
ErrorGetAllTags = errors.New("Failed to return all reference tags in a repository. Verify your repository tags and try again. If the error persists, contact Azion support.")
Expand Down
6 changes: 5 additions & 1 deletion messages/link/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package link

const (
FLAG_PACKAGE_MANAGE = "Specify the package manager to use (e.g., npm, yarn, pnpm)"
FLAG_SYNC = "Synchronizes the local azion.json file with remote resources. Use this flag when deploying your project from this command"
FLAG_LOCAL = "Runs the entire build and deploy process locally. Use this flag when deploying your project from this command"
)

var (
//link cmd
EdgeApplicationsLinkUsage = "link [flags]"
EdgeApplicationsLinkShortDescription = "Links a local repo or project folder to an existing application on Azion"
EdgeApplicationsLinkShortDescription = "Creates configuration used to build and deploy applications on Azion"
EdgeApplicationsLinkLongDescription = "Defines primary parameters based on a given name and application preset to link a Project to an Azion Edge Application"
EdgeApplicationsLinkRunningCmd = "Running link step command:\n\n"
EdgeApplicationsLinkFlagName = "The Edge Application's name"
Expand Down Expand Up @@ -35,4 +37,6 @@ var (
const (
FLAG_REMOTE = "Clones a remote repository to be linked to an Azion Edge Application"
FLAGPATHCONF = "Relative path to where your custom azion.json and args.json files are stored"
ASKPREBUILD = "Do you allow Azion to build your project in order to generate configuration files? (Y/n)"
BUILDLATER = "Please, remember to run azion build --preset [preset-name], in order to generate the necessary configuration files\n"
)
2 changes: 1 addition & 1 deletion messages/vulcan/messages.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package vulcan

var (
//vulcan version
//Bundler version
NewMajorVersion = "There is a new version of an azion build tool. Please update your CLI to use these new features"
)
2 changes: 1 addition & 1 deletion pkg/api/cache_setting/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/edge_applications/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/edge_function/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/origin/origin.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/personal_token/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/realtime_purge/realtime_purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/rules_engine/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/variables/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewClient(c *http.Client, url string, token string) *Client {
conf.Servers = sdk.ServerConfigurations{
{URL: url},
}
conf.HTTPClient.Timeout = 30 * time.Second
conf.HTTPClient.Timeout = 50 * time.Second

return &Client{
apiClient: sdk.NewAPIClient(conf),
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/edge_storage/bucket/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func NewBucketCmd(delete *DeleteBucketCmd, f *cmdutil.Factory) *cobra.Command {
if err != nil {
if msg.ERROR_NO_EMPTY_BUCKET == err.Error() {
logger.FInfo(f.IOStreams.Out, "Bucket deletion was scheduled successfully\n")
return schedule.NewSchedule(bucketName, schedule.DELETE_BUCKET)
return schedule.NewSchedule(nil, bucketName, schedule.DELETE_BUCKET)
} else {
return fmt.Errorf(msg.ERROR_DELETE_BUCKET, err.Error())
}
Expand Down
Loading

0 comments on commit 73c1a06

Please sign in to comment.