Amplify Publish Silently For Headless Deployments
Allow non-interactive communication using AWS CLI. I want to run the amplify publish command using the AWS CodeBuild And in buildspec.yaml I have defined amplify publish which generates the following results
[Container] 2018/10/17 11:32:17 Running command amplify publish
(node:50) ExperimentalWarning: The fs.promises API is experimental
| Category | Resource name | Operation | Provider plugin |
| -------- | --------------- | --------- | ----------------- |
| Auth | cognito15ca543b | No Change | awscloudformation |
| Hosting | S3AndCloudFront | No Change | awscloudformation |
tput: No value for $TERM and no -T specified
[36m?
[39m
[1mA
r
e
y
o
u
s
u
r
e
y
o
u
w
a
n
t
t
o
c
o
n
t
i
n
u
e
?
[22m
[2m(
Y
/
n
)
[22m[1D[86C
[Container] 2018/10/17 11:32:19 Phase complete: BUILD Success: true
[Container] 2018/10/17 11:32:19 Phase context status code: Message:
[Container] 2018/10/17 11:32:19 Entering phase POST_BUILD
Describe the solution you'd like Allow us to run the publish command by accepting all scenarios. E.g
amplify publish -qy
Where q Represent for Non-interactive or Quiet mode.
y Means set all answers to Yes by default.
@mabdullah353 We're currently actively working at this point towards making the commands headless.
I use printf 'yes\n' | amplify publish but amplify/.config file refer full directory paths, so I trying using https://aws-amplify.github.io/docs/cli/multienv?sdk=js to publish changes using codebuild but with no success :/
@msam6444 @framled We released headless command support for amplify init/push/publish with the multenv release -> https://aws-amplify.github.io/docs/cli/multienv?sdk=js For examples, please take a look at https://github.com/aws-amplify/amplify-cli/tree/multienv/packages/amplify-cli/sample-headless-scripts
Please feel free to re-open the issue if you've further questions.
That is really cool. Do you support other commands? i.e. amplify add auth or amplify add analytics.
Will there be proper documentation on this? Other than just the sample scripts (they're super helpful but would like a bit more documentation explaining what options are available and what they're for etc.)
My use case is:
? Do you want to generate code for your newly created GraphQL API Yes
? Choose the code generation language target flow
? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.js
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions No
? Enter the file name for the generated code src/API.js
so YES to code gen but NO to generate all possible query/mutation etc.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.