Open nastacio opened 4 years ago
If you want to do deploy without a build, please use this flag while running appsody deploy
:
--no-build Deploys the application without building a new image or modifying the deployment manifest file.
Just to explain the behaviour:
When appsody build
is run
Even though the application files haven't changed, they are extracted again and for the build engine, these are new files every time - resulting in not using the previous layer.
To automatically do this would need us to not clean up extracted folder and to somehow track if changes have been made since last extract etc. which could be messy.
Closing this as working as designed.
@nastacio please feel free to re-open if you believe Appsody could do something better here.
@neeraj-laad , apparently I cannot reopen the issue (no button for it) .
Users of appsody build
have no knowledge of what to put in app-deploy.yaml
and somehow I did not realize the build step is what was creating and updating the file with the contents of --pull-url
(that information is never available at build stage) .
If you take OKD/OpenShift as an example, the push-url
parameter will almost always be different than pull-url
because the push URL is the external URL of the registry and the pull URL is the internal URL visible from inside the cluster. Due to that URL difference, one must specify a differentpull-url
in appsody deploy
, but using --no-build
will prevent an update to app-deploy.yaml
In short, this adds to the current design virtually preventing the deployer from using the --no-build
flag unless they are lucky enough to have the correct applicationImage
value for their environment in app-deploy.yaml
.
Best-case scenario, the deployer has permission to push a change applicationImage
in app-deploy.yaml, fixing the problem for them and passing it along to the next user of the image.
Describe the bug If you call
appsody build
and thenappsody deploy
in sequence, without any code modifications in between,appsody deploy
will rebuild the whole application again before deployment.To Reproduce Steps to reproduce the behavior:
Create a new application with
appsody init incubator/java-openliberty
(same result withjava-spring-boot2
andnodejs-express
)Deploy the application to a target container with
Start the deployment again:
Expected behavior If no code was modified since the last build, then the code should not be rebuilt.
Actual behavior
appsody deploy...
triggers a full docker build of the code before initiating the deployment.Environment Details (please complete the following information):
If applicable please specify:
Screenshots If applicable, add screenshots to help explain your problem.
Additional context I think the problem is the absence of
app-deploy.yaml
in the.dockerignore
file for each stack.One could argue this is a problem with the stacks, but it is probably best to fix this globally in the appsody cli (maybe appending the
app-deploy.yaml
to.dockerignore
before builds) .