Deploy new version of Apps Script using Google Apps Script java API
up vote
1
down vote
favorite
I am using the Google App Script java API to deploy the code. I am performing the following steps:
1. Update the latest code
Content content = new Content();
content.setFiles(files);
Content updatedContent = scriptService.projects().updateContent(scriptId, content).execute();
2. Create a new version
Version version = new Version();
version.setDescription("test create version");
Version createdVersion = scriptService.projects().versions().create(scriptId, version).execute();
3. Deploy the latest version
DeploymentConfig deploymentConfig = new DeploymentConfig();
deploymentConfig.setDescription("test deployment");
deploymentConfig.setVersionNumber(createdVersion.getVersionNumber());
deploymentConfig.setManifestFileName("appsscript");
Deployment deploymentCreated = scriptService.projects().deployments().create(scriptId, deploymentConfig).execute();
When I log into script.google.com I am able to view the latest version that I created. It shows the status as deployed. In the script editor, I am able to view the latest code as well. Now, when I invoke the apps script the requests are still handled by the older version. Could somebody let me know if there is something wrong with the way I am using the API?
|
show 2 more comments
up vote
1
down vote
favorite
I am using the Google App Script java API to deploy the code. I am performing the following steps:
1. Update the latest code
Content content = new Content();
content.setFiles(files);
Content updatedContent = scriptService.projects().updateContent(scriptId, content).execute();
2. Create a new version
Version version = new Version();
version.setDescription("test create version");
Version createdVersion = scriptService.projects().versions().create(scriptId, version).execute();
3. Deploy the latest version
DeploymentConfig deploymentConfig = new DeploymentConfig();
deploymentConfig.setDescription("test deployment");
deploymentConfig.setVersionNumber(createdVersion.getVersionNumber());
deploymentConfig.setManifestFileName("appsscript");
Deployment deploymentCreated = scriptService.projects().deployments().create(scriptId, deploymentConfig).execute();
When I log into script.google.com I am able to view the latest version that I created. It shows the status as deployed. In the script editor, I am able to view the latest code as well. Now, when I invoke the apps script the requests are still handled by the older version. Could somebody let me know if there is something wrong with the way I am using the API?
Is this a Java or PHP command-line application?
– Sandy Good
Nov 20 at 13:53
This is a java based application
– Mithun
Nov 20 at 14:16
1
Add Java to the tags and add that it's Apps Script API using Java. And maybe link to the Java quick start. https://developers.google.com/apps-script/api/quickstart/java The code is affecting Apps Script files, but none of the code is actually Apps Script code. It's Java and API code.
– Sandy Good
Nov 20 at 14:50
The screen: "Publish API executable" - Does it show that the deployed version is the latest version?
– TheMaster
Nov 20 at 20:22
Yes, theVersionsdrop-down shows the latest version. But, in the "Publish API executable" screen the newest version is not pre-selected in the drop-down.
– Mithun
Nov 21 at 7:36
|
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am using the Google App Script java API to deploy the code. I am performing the following steps:
1. Update the latest code
Content content = new Content();
content.setFiles(files);
Content updatedContent = scriptService.projects().updateContent(scriptId, content).execute();
2. Create a new version
Version version = new Version();
version.setDescription("test create version");
Version createdVersion = scriptService.projects().versions().create(scriptId, version).execute();
3. Deploy the latest version
DeploymentConfig deploymentConfig = new DeploymentConfig();
deploymentConfig.setDescription("test deployment");
deploymentConfig.setVersionNumber(createdVersion.getVersionNumber());
deploymentConfig.setManifestFileName("appsscript");
Deployment deploymentCreated = scriptService.projects().deployments().create(scriptId, deploymentConfig).execute();
When I log into script.google.com I am able to view the latest version that I created. It shows the status as deployed. In the script editor, I am able to view the latest code as well. Now, when I invoke the apps script the requests are still handled by the older version. Could somebody let me know if there is something wrong with the way I am using the API?
I am using the Google App Script java API to deploy the code. I am performing the following steps:
1. Update the latest code
Content content = new Content();
content.setFiles(files);
Content updatedContent = scriptService.projects().updateContent(scriptId, content).execute();
2. Create a new version
Version version = new Version();
version.setDescription("test create version");
Version createdVersion = scriptService.projects().versions().create(scriptId, version).execute();
3. Deploy the latest version
DeploymentConfig deploymentConfig = new DeploymentConfig();
deploymentConfig.setDescription("test deployment");
deploymentConfig.setVersionNumber(createdVersion.getVersionNumber());
deploymentConfig.setManifestFileName("appsscript");
Deployment deploymentCreated = scriptService.projects().deployments().create(scriptId, deploymentConfig).execute();
When I log into script.google.com I am able to view the latest version that I created. It shows the status as deployed. In the script editor, I am able to view the latest code as well. Now, when I invoke the apps script the requests are still handled by the older version. Could somebody let me know if there is something wrong with the way I am using the API?
edited Nov 20 at 16:13
asked Nov 20 at 12:55
Mithun
4,78213053
4,78213053
Is this a Java or PHP command-line application?
– Sandy Good
Nov 20 at 13:53
This is a java based application
– Mithun
Nov 20 at 14:16
1
Add Java to the tags and add that it's Apps Script API using Java. And maybe link to the Java quick start. https://developers.google.com/apps-script/api/quickstart/java The code is affecting Apps Script files, but none of the code is actually Apps Script code. It's Java and API code.
– Sandy Good
Nov 20 at 14:50
The screen: "Publish API executable" - Does it show that the deployed version is the latest version?
– TheMaster
Nov 20 at 20:22
Yes, theVersionsdrop-down shows the latest version. But, in the "Publish API executable" screen the newest version is not pre-selected in the drop-down.
– Mithun
Nov 21 at 7:36
|
show 2 more comments
Is this a Java or PHP command-line application?
– Sandy Good
Nov 20 at 13:53
This is a java based application
– Mithun
Nov 20 at 14:16
1
Add Java to the tags and add that it's Apps Script API using Java. And maybe link to the Java quick start. https://developers.google.com/apps-script/api/quickstart/java The code is affecting Apps Script files, but none of the code is actually Apps Script code. It's Java and API code.
– Sandy Good
Nov 20 at 14:50
The screen: "Publish API executable" - Does it show that the deployed version is the latest version?
– TheMaster
Nov 20 at 20:22
Yes, theVersionsdrop-down shows the latest version. But, in the "Publish API executable" screen the newest version is not pre-selected in the drop-down.
– Mithun
Nov 21 at 7:36
Is this a Java or PHP command-line application?
– Sandy Good
Nov 20 at 13:53
Is this a Java or PHP command-line application?
– Sandy Good
Nov 20 at 13:53
This is a java based application
– Mithun
Nov 20 at 14:16
This is a java based application
– Mithun
Nov 20 at 14:16
1
1
Add Java to the tags and add that it's Apps Script API using Java. And maybe link to the Java quick start. https://developers.google.com/apps-script/api/quickstart/java The code is affecting Apps Script files, but none of the code is actually Apps Script code. It's Java and API code.
– Sandy Good
Nov 20 at 14:50
Add Java to the tags and add that it's Apps Script API using Java. And maybe link to the Java quick start. https://developers.google.com/apps-script/api/quickstart/java The code is affecting Apps Script files, but none of the code is actually Apps Script code. It's Java and API code.
– Sandy Good
Nov 20 at 14:50
The screen: "Publish API executable" - Does it show that the deployed version is the latest version?
– TheMaster
Nov 20 at 20:22
The screen: "Publish API executable" - Does it show that the deployed version is the latest version?
– TheMaster
Nov 20 at 20:22
Yes, the
Versions drop-down shows the latest version. But, in the "Publish API executable" screen the newest version is not pre-selected in the drop-down.– Mithun
Nov 21 at 7:36
Yes, the
Versions drop-down shows the latest version. But, in the "Publish API executable" screen the newest version is not pre-selected in the drop-down.– Mithun
Nov 21 at 7:36
|
show 2 more comments
active
oldest
votes
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',
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%2f53393482%2fdeploy-new-version-of-apps-script-using-google-apps-script-java-api%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53393482%2fdeploy-new-version-of-apps-script-using-google-apps-script-java-api%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
Is this a Java or PHP command-line application?
– Sandy Good
Nov 20 at 13:53
This is a java based application
– Mithun
Nov 20 at 14:16
1
Add Java to the tags and add that it's Apps Script API using Java. And maybe link to the Java quick start. https://developers.google.com/apps-script/api/quickstart/java The code is affecting Apps Script files, but none of the code is actually Apps Script code. It's Java and API code.
– Sandy Good
Nov 20 at 14:50
The screen: "Publish API executable" - Does it show that the deployed version is the latest version?
– TheMaster
Nov 20 at 20:22
Yes, the
Versionsdrop-down shows the latest version. But, in the "Publish API executable" screen the newest version is not pre-selected in the drop-down.– Mithun
Nov 21 at 7:36