This is a nice answer to your question from Ben.
See more Publish datasource without Desktop?
You can use the Tableau SDK if you like coding, then use tabcmd to publish. You could also use Alteryx as Chris mentioned, but again, there is a cost associated. You could also do some extreme XML parsing and fabrication to accomplish this, or probably use some modified Interworks tool to do so, or you could even pay a consultant to do these, but again, these are hacky ways to accomplish a 2-click solution in Tableau Desktop. The time you have someone waste doing this will cost more than the price of a Desktop license. At a certain point the effort to save money isn't worth what it will cost in time and materials.
Please mark the answer as CORRECT & HELPFUL if it really helps you
Use the tabcmd to publish workbook to server.
tabcmd publish "analysis.twbx" -n "Sales_Analysis" --db-username "jsmith" --db-password "secret-password"
tabcmd publish "analysis_sfdc.hyper" -n "Sales Analysis"
--oauth-username "user-name" --save-oauth
If the file is not in the same directory as tabcmd, include the full path to the file.
tabcmd publish "\\computer\volume\Tableau Workbooks\analysis.twbx" -n "Sales_Analysis" --db-username "jsmith" --db-password "secret-password"
tabcmd publish "\\computer\volume\Tableau Workbooks\analysis_sfdc.hyper" -n "Sales Analysis" --oauth-username "username" --save-oauth
Thanks. it works..One more question is how do i pass parameters to it without hardcoding everything in the tabcmd.
example. end user will provide the test url and prod url. and our tabcmd should use dynamically replace the variables to do the deployment