What are the Slack Archives?

Itโ€™s a history of our time together in the Slack Community! Thereโ€™s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you wonโ€™t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Is there a way in spryker to configure label expressions for the jenkins jobs? (so the jenkins can b

UK5DS29L2
UK5DS29L2 Posts: 546 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

Is there a way in spryker to configure label expressions for the jenkins jobs? (so the jenkins can be scaled using master-agent)

Comments

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    You mean something like this?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    intersting.. how to?

  • UK5DS29L2
    UK5DS29L2 Posts: 546 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    well I already have the nodes, but I'd rather have label expressions done in a non-manual way so we can push them to different environments

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    ah ok so one jenkins for every env?

  • UK5DS29L2
    UK5DS29L2 Posts: 546 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    No, I want to assign order and stock related tasks to their own agents

  • UK5DS29L2
    UK5DS29L2 Posts: 546 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    so they are prioritized over the others

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    sorry, I have no clue. Maybe there is a jenkins plugin available

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 ๐Ÿช - Explorer
    edited May 2020

    You can take a look on the scheduler component , there is a generator for each jenkins job definition you could extend to your needs (Spryker\Zed\SchedulerJenkins\Business\TemplateGenerator\XmlJenkinsJobTemplateGenerator).
    We did so to assign all spryker jenkins jobs the same label.
    But having a little logic for different labels, maybe comming from jobs.php shouldnโ€™t be that hard to implement

        /**
         * @param \Generated\Shared\Transfer\SchedulerJobTransfer $jobTransfer
         *
         * @return \Generated\Shared\Transfer\SchedulerJobTransfer
         */
        protected function extendSchedulerJobTransferWithJenkinsAgentLabel(SchedulerJobTransfer $jobTransfer): SchedulerJobTransfer
        {
            $jobPayload = $jobTransfer->getPayload();
    
            if (array_key_exists(static::KEY_JENKINS_AGENT_LABEL, $jobPayload) && is_string($jobPayload[static::KEY_JENKINS_AGENT_LABEL])) {
                return $jobTransfer;
            }
    
            $jobPayload[static::KEY_JENKINS_AGENT_LABEL] = $this->schedulerJenkinsConfig->getJenkinsAgentLabel();
    
            return $jobTransfer->setPayload($jobPayload);
        }