-
Notifications
You must be signed in to change notification settings - Fork 40
Don't try to deploy nonexistent files #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -340,6 +341,11 @@ func logDeployFiles(files []deployment.DeployableItem, logger loggerV2.Logger) { | |||
func clearDeployFiles(filesToDeploy []string, logger loggerV2.Logger) []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not we perform the file existence check earlier?
At the moment the step output looks like this:
List of files to deploy
- /bitrise/src/Apps/app-stg-release-unsigned.apk
Deploying files
Uploading apk file: /bitrise/src/Apps/app-stg-release-unsigned.apk
analyzing apk
Failed to parse APK info: failed to unzip the APK, error: open /bitrise/src/Apps/app-stg-release-unsigned.apk: no such file or directory
deploy failed, error: failed to get apk infos, output: asset W 01-31 12:06:07 2347 2347] Asset path /bitrise/src/Apps/app-stg-release-unsigned.apk is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded, error: exit status 1
deploy failed, error: failed to get apk infos, output: asset W 01-31 12:06:07 2347 2347] Asset path /bitrise/src/Apps/app-stg-release-unsigned.apk is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded, error: exit status 1
The step lists that it will deploy the /bitrise/src/Apps/app-stg-release-unsigned.apk
file and then later it states it could not deploy the file. Why did it find the file in the first place then?
I would say that we should check if the file exists when we collect the deployable files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my thinking as well! clearDeployFiles()
is called right after collecting the files based on the step inputs:
steps-deploy-to-bitrise-io/main.go
Lines 146 to 150 in a94282c
filesToDeploy, err := collectFilesToDeploy(absDeployPth, config, tmpDir, logger) | |
if err != nil { | |
fail(logger, "%s", err) | |
} | |
clearedFilesToDeploy := clearDeployFiles(filesToDeploy, logger) |
And it's called before printing the list of deployable files (L168)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking of doing it earlier like in the collectFilesToDeploy
method. My thinking was that why are we even finding files which do not exist. The clear function was created more for filtering out the useless files.
Checklist
step.yml
andREADME.md
is updated with the changes (if needed)Version
Requires a MAJOR/MINOR/PATCH version update
Context
Changes
Investigation details
Decisions