Deploy Ruby on Rails app to App Engine using Cloud Build
I'm trying to automate the deployment of a Ruby on Rails app to App Engine using Cloud Build.
My app.yaml
looked like this,
runtime: ruby
env: flex
entrypoint: bundle exec rails server
But I'm getting this error,
Step #1: ERROR: (gcloud.app.deploy) There is a cloudbuild.yaml in the current directory, and the runtime field in /workspace/app.yaml is currently set to [runtime: ruby]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [ruby] runtime, please remove the cloudbuild.yaml from this directory.
Then I tried to change the runtime to custom
and add a Dockerfile as custom runtime needs a Dockerfile.
But now I'm getting an error saying,
ERROR: (gcloud.app.deploy) A custom runtime must have exactly one of [Dockerfile] and [cloudbuild.yaml] in the source directory; [/home/milindu/Projects/ElePath-Ruby] contains both
Then I removed Dockerfile also. But now getting into this weird situation. You can see the 'Step #1:' is growing into several like stuck in a recursion.
ruby-on-rails google-app-engine google-cloud-platform google-cloud-build
add a comment |
I'm trying to automate the deployment of a Ruby on Rails app to App Engine using Cloud Build.
My app.yaml
looked like this,
runtime: ruby
env: flex
entrypoint: bundle exec rails server
But I'm getting this error,
Step #1: ERROR: (gcloud.app.deploy) There is a cloudbuild.yaml in the current directory, and the runtime field in /workspace/app.yaml is currently set to [runtime: ruby]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [ruby] runtime, please remove the cloudbuild.yaml from this directory.
Then I tried to change the runtime to custom
and add a Dockerfile as custom runtime needs a Dockerfile.
But now I'm getting an error saying,
ERROR: (gcloud.app.deploy) A custom runtime must have exactly one of [Dockerfile] and [cloudbuild.yaml] in the source directory; [/home/milindu/Projects/ElePath-Ruby] contains both
Then I removed Dockerfile also. But now getting into this weird situation. You can see the 'Step #1:' is growing into several like stuck in a recursion.
ruby-on-rails google-app-engine google-cloud-platform google-cloud-build
add a comment |
I'm trying to automate the deployment of a Ruby on Rails app to App Engine using Cloud Build.
My app.yaml
looked like this,
runtime: ruby
env: flex
entrypoint: bundle exec rails server
But I'm getting this error,
Step #1: ERROR: (gcloud.app.deploy) There is a cloudbuild.yaml in the current directory, and the runtime field in /workspace/app.yaml is currently set to [runtime: ruby]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [ruby] runtime, please remove the cloudbuild.yaml from this directory.
Then I tried to change the runtime to custom
and add a Dockerfile as custom runtime needs a Dockerfile.
But now I'm getting an error saying,
ERROR: (gcloud.app.deploy) A custom runtime must have exactly one of [Dockerfile] and [cloudbuild.yaml] in the source directory; [/home/milindu/Projects/ElePath-Ruby] contains both
Then I removed Dockerfile also. But now getting into this weird situation. You can see the 'Step #1:' is growing into several like stuck in a recursion.
ruby-on-rails google-app-engine google-cloud-platform google-cloud-build
I'm trying to automate the deployment of a Ruby on Rails app to App Engine using Cloud Build.
My app.yaml
looked like this,
runtime: ruby
env: flex
entrypoint: bundle exec rails server
But I'm getting this error,
Step #1: ERROR: (gcloud.app.deploy) There is a cloudbuild.yaml in the current directory, and the runtime field in /workspace/app.yaml is currently set to [runtime: ruby]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [ruby] runtime, please remove the cloudbuild.yaml from this directory.
Then I tried to change the runtime to custom
and add a Dockerfile as custom runtime needs a Dockerfile.
But now I'm getting an error saying,
ERROR: (gcloud.app.deploy) A custom runtime must have exactly one of [Dockerfile] and [cloudbuild.yaml] in the source directory; [/home/milindu/Projects/ElePath-Ruby] contains both
Then I removed Dockerfile also. But now getting into this weird situation. You can see the 'Step #1:' is growing into several like stuck in a recursion.
ruby-on-rails google-app-engine google-cloud-platform google-cloud-build
ruby-on-rails google-app-engine google-cloud-platform google-cloud-build
asked Nov 21 '18 at 14:03
Milindu Sanoj KumarageMilindu Sanoj Kumarage
1,47522039
1,47522039
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Cloudbuild.yaml should work with App Engine Flexible without the need to use a custom runtime. As detailed in the first error message you received, you cannot have an app.yaml and the cloudbuild.yaml in the same directory if you are deploying in a non-custom runtime, to remedy the situation, follow these steps:
Move your app.yaml and other ruby files into a subdirectory (use your
original app.yaml, no need to use custom runtime)Under your cloudbuild.yaml steps, modify the argument for app deploy
by adding a third one specifying your app.yaml's path.
Below is an example:
==================FROM:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: '1600s'
===================TO:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]']
timeout: '1600s'
Thanks @David, I tried this and it worked. Now the problem is, this is an open source project and I can't move all the codes into a subdirectory just for Cloud Build. Is there a workaround you can think of? Is there a way to keep justapp.yaml
in a subdir and do it or any other trick?
– Milindu Sanoj Kumarage
Nov 24 '18 at 6:41
I do not have a workaround for you at this time. However, this might be possible by using custom run times and a Docker file but I understand this might not be ideal. If you believe this is something critical for you, you can create a feature request on Issue Tracker by giving some context and providing your use case.
– David
Nov 28 '18 at 19:31
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413816%2fdeploy-ruby-on-rails-app-to-app-engine-using-cloud-build%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Cloudbuild.yaml should work with App Engine Flexible without the need to use a custom runtime. As detailed in the first error message you received, you cannot have an app.yaml and the cloudbuild.yaml in the same directory if you are deploying in a non-custom runtime, to remedy the situation, follow these steps:
Move your app.yaml and other ruby files into a subdirectory (use your
original app.yaml, no need to use custom runtime)Under your cloudbuild.yaml steps, modify the argument for app deploy
by adding a third one specifying your app.yaml's path.
Below is an example:
==================FROM:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: '1600s'
===================TO:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]']
timeout: '1600s'
Thanks @David, I tried this and it worked. Now the problem is, this is an open source project and I can't move all the codes into a subdirectory just for Cloud Build. Is there a workaround you can think of? Is there a way to keep justapp.yaml
in a subdir and do it or any other trick?
– Milindu Sanoj Kumarage
Nov 24 '18 at 6:41
I do not have a workaround for you at this time. However, this might be possible by using custom run times and a Docker file but I understand this might not be ideal. If you believe this is something critical for you, you can create a feature request on Issue Tracker by giving some context and providing your use case.
– David
Nov 28 '18 at 19:31
add a comment |
Cloudbuild.yaml should work with App Engine Flexible without the need to use a custom runtime. As detailed in the first error message you received, you cannot have an app.yaml and the cloudbuild.yaml in the same directory if you are deploying in a non-custom runtime, to remedy the situation, follow these steps:
Move your app.yaml and other ruby files into a subdirectory (use your
original app.yaml, no need to use custom runtime)Under your cloudbuild.yaml steps, modify the argument for app deploy
by adding a third one specifying your app.yaml's path.
Below is an example:
==================FROM:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: '1600s'
===================TO:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]']
timeout: '1600s'
Thanks @David, I tried this and it worked. Now the problem is, this is an open source project and I can't move all the codes into a subdirectory just for Cloud Build. Is there a workaround you can think of? Is there a way to keep justapp.yaml
in a subdir and do it or any other trick?
– Milindu Sanoj Kumarage
Nov 24 '18 at 6:41
I do not have a workaround for you at this time. However, this might be possible by using custom run times and a Docker file but I understand this might not be ideal. If you believe this is something critical for you, you can create a feature request on Issue Tracker by giving some context and providing your use case.
– David
Nov 28 '18 at 19:31
add a comment |
Cloudbuild.yaml should work with App Engine Flexible without the need to use a custom runtime. As detailed in the first error message you received, you cannot have an app.yaml and the cloudbuild.yaml in the same directory if you are deploying in a non-custom runtime, to remedy the situation, follow these steps:
Move your app.yaml and other ruby files into a subdirectory (use your
original app.yaml, no need to use custom runtime)Under your cloudbuild.yaml steps, modify the argument for app deploy
by adding a third one specifying your app.yaml's path.
Below is an example:
==================FROM:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: '1600s'
===================TO:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]']
timeout: '1600s'
Cloudbuild.yaml should work with App Engine Flexible without the need to use a custom runtime. As detailed in the first error message you received, you cannot have an app.yaml and the cloudbuild.yaml in the same directory if you are deploying in a non-custom runtime, to remedy the situation, follow these steps:
Move your app.yaml and other ruby files into a subdirectory (use your
original app.yaml, no need to use custom runtime)Under your cloudbuild.yaml steps, modify the argument for app deploy
by adding a third one specifying your app.yaml's path.
Below is an example:
==================FROM:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: '1600s'
===================TO:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]']
timeout: '1600s'
answered Nov 21 '18 at 16:07
DavidDavid
160112
160112
Thanks @David, I tried this and it worked. Now the problem is, this is an open source project and I can't move all the codes into a subdirectory just for Cloud Build. Is there a workaround you can think of? Is there a way to keep justapp.yaml
in a subdir and do it or any other trick?
– Milindu Sanoj Kumarage
Nov 24 '18 at 6:41
I do not have a workaround for you at this time. However, this might be possible by using custom run times and a Docker file but I understand this might not be ideal. If you believe this is something critical for you, you can create a feature request on Issue Tracker by giving some context and providing your use case.
– David
Nov 28 '18 at 19:31
add a comment |
Thanks @David, I tried this and it worked. Now the problem is, this is an open source project and I can't move all the codes into a subdirectory just for Cloud Build. Is there a workaround you can think of? Is there a way to keep justapp.yaml
in a subdir and do it or any other trick?
– Milindu Sanoj Kumarage
Nov 24 '18 at 6:41
I do not have a workaround for you at this time. However, this might be possible by using custom run times and a Docker file but I understand this might not be ideal. If you believe this is something critical for you, you can create a feature request on Issue Tracker by giving some context and providing your use case.
– David
Nov 28 '18 at 19:31
Thanks @David, I tried this and it worked. Now the problem is, this is an open source project and I can't move all the codes into a subdirectory just for Cloud Build. Is there a workaround you can think of? Is there a way to keep just
app.yaml
in a subdir and do it or any other trick?– Milindu Sanoj Kumarage
Nov 24 '18 at 6:41
Thanks @David, I tried this and it worked. Now the problem is, this is an open source project and I can't move all the codes into a subdirectory just for Cloud Build. Is there a workaround you can think of? Is there a way to keep just
app.yaml
in a subdir and do it or any other trick?– Milindu Sanoj Kumarage
Nov 24 '18 at 6:41
I do not have a workaround for you at this time. However, this might be possible by using custom run times and a Docker file but I understand this might not be ideal. If you believe this is something critical for you, you can create a feature request on Issue Tracker by giving some context and providing your use case.
– David
Nov 28 '18 at 19:31
I do not have a workaround for you at this time. However, this might be possible by using custom run times and a Docker file but I understand this might not be ideal. If you believe this is something critical for you, you can create a feature request on Issue Tracker by giving some context and providing your use case.
– David
Nov 28 '18 at 19:31
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413816%2fdeploy-ruby-on-rails-app-to-app-engine-using-cloud-build%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown