Publishes the existing application from Work to Stream specified, -Filter setting is used for the Stream specification. If -Force key is included, rewrites already published application. Since version 1.16 supports published application copying/moving between Streams.
Syntax:
QOps-Publish -Filter [-RemoveArtefacts] [-Force] [-Sort] [-Profile] [-Verbose]
Parameters meaning:
-Filter overrides parameters for selecting applications to process with QOps, allows filtering by following:
- Id (specifies source application Id)
- Name (specifies destination Application Name)
- Stream (specifies destination Stream)
- Owner (sets the Owner of the destination application)
-RemoveArtefacts indicates that Application in the source stream should be removed. Since version 1.15 if key is omitted, QOps will keep the source application.
-Force defines that already published application will be rewritten
-Sort sets the order in which the applications listed in -Filter are published, ex.: -Sort "Name=Desc". The value is a field and a direction, Asc or Desc. Fields: Name, Id, Stream (or Space), Owner. Without -Sort they are published by name in ascending order.
-Profile overrides default User Profile with the specified one
-Verbose enables extended command line output
Example:
QOps-Publish -Filter "Id=6c6f8c63-944f-47df-aff6-e1862dccef88,Name=Application1,Stream=Develop"
Publishes the existing application from Work to Space specified, -Filter setting is used for the Space specification. If -Force key is included, rewrites already published application. Since version 1.16 supports published application copying/moving between Spaces.
Syntax:
QOps-Publish -Filter [-RemoveArtefacts] [-Force] [-Reload] [-Sort] [-Profile] [-Verbose]
Parameters meaning:
-Filter is required, and it carries the target. Publish reads the application, the name to publish under and the target space from the filter itself, all three:
- Id (specifies source application Id, the one QOps recorded in App.local for that folder)
- Name (specifies destination Application Name)
- Space (specifies destination Space)
- Owner (sets the Owner of the destination application)
A filter missing any of the three is refused and the command says which field is empty. Run without -Filter, the command says what it needs and shows the shape to pass. It does not use the filter saved in the repository's .qopsconfig, and it does not take the target from the application's properties file: QOps-Release is the command that does that.
-RemoveArtefacts removes the application QOps published from, once its content is in the published one. Without it, that copy stays in Qlik. This includes an update in place on a shared space: without the switch the application you published from stays in your personal space; with it, it is removed. QOps turns this on by itself when the application being published from was itself published.
-Force updates an application the target space already holds under the name being published, from the one you publish. On a managed space and on a shared space alike, it keeps its Id.
-Sort sets the order in which the applications listed in -Filter are published, ex.: -Sort "Name=Desc". The value is a field and a direction, Asc or Desc. Fields: Name, Id, Stream (or Space), Owner. Without -Sort they are published by name in ascending order.
-Reload reloads the application in the target space, which on a managed space is the copy in the space, not the one you published from.
-Profile overrides default User Profile with the specified one
-Verbose enables extended command line output
-WaitAndRewrite waits up to 10 minutes for another run's write lock to leave the app instead of stopping, then writes the app anyway and says so in the log. See QOps-Build.
-IgnoreWriteLease writes the app even when another run's write lock is in it, without waiting. Use it only when you are sure no other run is writing the app, for example when a stopped run left its lock and you cannot wait until it is old enough to be removed (see "When another QOps run is writing the same app" on QOps-Build). The log says the run went ahead past the other lock. If another run is in fact still writing, both runs can fail, for example with Invalid handle, and the app can be left partly updated. Your run places its own lock as usual.
Publishing into a shared or managed space
On Qlik Cloud, the first time you publish an app into a managed space, QOps creates a new published app there with its own Id, and that is the one people open. Publishing the same app name into that space again with -Force updates the app that is already there instead of adding a second one. It keeps its Id, so links, bookmarks and automations pointing at it keep working. Without -Force, QOps refuses and leaves the space untouched. The same holds for a shared space: an app already there under that name is updated and keeps its Id.
Publishing to a shared space depends on whether the space already holds an application under the name being published:
- The first time, when it does not, the application you publish from is moved into the space and keeps its own Id. It leaves your personal space in the process, which is why the next build starts a fresh application there.
- Every time after that, with -Force, the application already in the space is updated in place: QOps reads the application you publish from and writes its content into the one in the space. The application in the space keeps its Id, so links, bookmarks and automations pointing at it keep working. The application you publish from stays in your personal space, where your next build finds it again.
An update in place carries the application's content, not its data. Reload it afterwards, or add -Reload to the same command.
Where a space already holds several applications of one name, a publish replaces one of them and says how many it left; the rest are yours to delete.
Which application to publish after the first publish to a shared space
After the first publish to a shared space, the Id in your -Filter is no longer the application you are building: that application moved into the space, and the next build wrote a fresh one, recording its Id in App.local. Take the Id from App.local and publish that; the application in the space is then updated in place from it and keeps its own Id:
QOps-Publish -Filter "Id=<the Id in App.local>,Name=<app name>,Space=<space name>" -Force
QOps stops rather than letting this pass. When the application the filter names is already in the target space and your personal space holds another of that name, the run fails and the message names both Ids: the one you pointed at and the one your last build wrote to. Where your personal space holds no application of that name, the publish is simply repeating itself and still succeeds, so a pipeline that re-publishes does not start failing.
QOps-Release does not have this problem: it builds and publishes in one run.
When another QOps run is writing the same app
This protection applies to Qlik Cloud. On Qlik Sense client-managed, runs on the same app are not yet kept apart.
When the application already exists in the shared space, Publish updates it in place with a build, so it places the same write lock as QOps-Build: if another QOps run is writing that application, the publish stops at once without changing the application. Use -WaitAndRewrite to wait up to 10 minutes for the other run to finish and then write the application, or -IgnoreWriteLease to write without waiting when you are sure the lock was left behind by mistake. Other Publish runs do not place it.
Example:
QOps-Publish -Filter "Id=6c6f8c63-944f-47df-aff6-e1862dccef88,Name=Application1,Space=Develop"
QOps-Publish -Filter "Id=6c6f8c63-944f-47df-aff6-e1862dccef88,Name=Application1,Space=Sales" -Force -Reload
This command is not available in QlikView mode
-Mode explicitly overrides the platform mode. Values: QlikSense, QlikSaaS, QlikView. When not specified, QOps auto-detects from configuration.
QOps-Publish has no -Placeholders parameter. The reload that -Reload runs after publishing uses the load script that is in the published application, and the placeholders in that script were filled in when the application was built. To set their values, pass -Placeholders to QOps-Build or QOps-Release.
-ServiceUrl is not used by QOps-Publish. A run that passes it stops before publishing anything and says so. To reload QlikView documents through the Qlik Management Console, use QOps-Reload -ServiceUrl.
-VerboseLog enables full verbose output including complete API response dumps and debug information, with passwords, keys and tokens masked. By default, QOps now produces concise output summaries.