enonic / cli-enonic

GNU General Public License v3.0
41 stars 1 forks source link

Session problems with multiple remotes #185

Open diegopasten opened 4 years ago

diegopasten commented 4 years ago

I have two build jobs in Jenkins. Build-test and build-prod, these create a sandbox and then creates an XP app from the same git repo. I want to build and deploy directly from each job.

If I start with test it works fine, but then prod will fail as it seems to use the same session token. And its of course reverse If I delete all sandboxes and start with prod first instead of test.

I've also tried to include deletion of sandboxes in the job after build. But it still fails. If I go in the terminal and manually delete all sandboxes then again the first job I run will work perfectly fine, which is probably the weirdest problem here.

At the moment Jenkins does it this way.

export ENONIC_CLI_REMOTE_URL="http://company.com:4848"
export ENONIC_CLI_REMOTE_USER="jenkins-deploy-user"
export ENONIC_CLI_REMOTE_PASS="MYSECRET"
export SANDBOX_NAME=app_build_test

enonic sandbox create $SANDBOX_NAME --version 7.1.2
enonic project sandbox $SANDBOX_NAME
enonic project build
enonic sandbox delete -f $SANDBOX_NAME
enonic app install --file build/libs/*.jar

And at the end of the job I get this (when it fails)

BUILD SUCCESSFUL in 43s
6 actionable tasks: 1 executed, 5 up-to-date
+ enonic app install --file build/libs/company-app-0.0.1-SNAPSHOT.jar
Installing. Session is no longer valid.
Installing...415 Cannot consume content type
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Note that I use CLI as binary in the Jenkins instance, not as the ci-image supplied. This is because that image does not yet support YARN/NPM. My guess is that is solved automatically in a container system.

alansemenov commented 4 years ago

@pmi What's the status of this one?

pmi commented 3 years ago

This is probably obsolete now because of #268