Skip to content

Commit

Permalink
Merge pull request #293 from aziontech/test-debug
Browse files Browse the repository at this point in the history
debug
  • Loading branch information
PatrickMenoti authored Feb 10, 2023
2 parents cd35c0b + f822aec commit 5e2e5f9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/deploy_stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ jobs:
AZION_SSO: ${{ secrets.AZION_SSO_STAGE }}
STORAGE_URL: ${{ secrets.STORAGE_API_STAGE }}
run: make build ENVFILE=./env/stage

- name: test env
env:
AZION_API: ${{ secrets.AZION_API_STAGE }}
AZION_SSO: ${{ secrets.AZION_SSO_STAGE }}
STORAGE_URL: ${{ secrets.STORAGE_API_STAGE }}
run: cat ./env/stage

- name: Cross-build
env:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ BIN := azioncli
BIN_VERSION=$(shell git describe --tags)
# The variables with $$ should be sourced from an envfile
LDFLAGS=-X github.com/aziontech/azion-cli/pkg/cmd/version.BinVersion=$(BIN_VERSION) \
-X github.com/aziontech/azion-cli/pkg/constants.StorageApiURL=$$STORAGE_URL \
-X github.com/aziontech/azion-cli/pkg/constants.AuthURL=$$AUTH_URL \
-X github.com/aziontech/azion-cli/pkg/constants.ApiURL=$$API_URL \
-X github.com/aziontech/azion-cli/pkg/constants.StorageApiURL=$$STORAGE_URL \
-X github.com/aziontech/azion-cli/pkg/cmd/edge_applications/init.TemplateBranch=$$TEMPLATE_BRANCH \
-X github.com/aziontech/azion-cli/pkg/cmd/edge_applications/init.TemplateMajor=$$TEMPLATE_MAJOR
LDFLAGS_STRIP=-s -w
Expand Down
4 changes: 2 additions & 2 deletions env/stage
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
API_URL=https://${AZION_API}
AUTH_URL=https://${AZION_SSO}/api/user/me
STORAGE_URL=${STORAGE_API}
TEMPLATE_BRANCH=dev
TEMPLATE_MAJOR=0
STORAGE_URL=${STORAGE_API}
TEMPLATE_MAJOR=0
2 changes: 1 addition & 1 deletion pkg/api/storage_api/storage_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *Client) CreateVersionId(ctx context.Context, id string) (VersionIdRespo

res, httpResp, err := req.Execute()
if err != nil {
fmt.Println(err)
fmt.Println(err.Error())
fmt.Println(httpResp.Body)
return nil, utils.ErrorPerStatusCode(httpResp, err)
}
Expand Down
12 changes: 11 additions & 1 deletion pkg/cmd/edge_applications/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
msg "github.com/aziontech/azion-cli/messages/edge_applications"
api "github.com/aziontech/azion-cli/pkg/api/storage_api"
"github.com/aziontech/azion-cli/pkg/cmdutil"
"github.com/aziontech/azion-cli/pkg/constants"
"github.com/aziontech/azion-cli/pkg/contracts"
"github.com/aziontech/azion-cli/pkg/iostreams"
"github.com/aziontech/azion-cli/utils"
Expand Down Expand Up @@ -317,13 +318,22 @@ func GetVersionID(cmd *BuildCmd, appID string) (string, error) {
fmt.Println("API URL")
fmt.Println(cmd.f.Config.GetString("api_url"))

fmt.Println("STAGE URL - CONSTANT")
fmt.Println(constants.StorageApiURL)

fmt.Println("API URL - CONSTANT")
fmt.Println(constants.ApiURL)

fmt.Println("SSO - CONSTANT")
fmt.Println(constants.AuthURL)

client := api.NewClient(cmd.f.HttpClient, cmd.f.Config.GetString("storage_url"), cmd.f.Config.GetString("token"))

ctx := context.Background()

verId, err := client.CreateVersionId(ctx, appID)
if err != nil {
fmt.Println(err)
fmt.Println(err.Error())
return "", fmt.Errorf(msg.ErrorGetVersionId.Error(), err)
}

Expand Down

0 comments on commit 5e2e5f9

Please sign in to comment.