Cloud manager: Different FrontEnd parameters for Stage and Prod? | Community
Skip to main content
Level 6
December 16, 2020
Solved

Cloud manager: Different FrontEnd parameters for Stage and Prod?

  • December 16, 2020
  • 1 reply
  • 1345 views

hi folks,

I'm moving to Cloud Manager. I know how to have different OSGI config files for stage, prod and dev.

But my ui.frontend Javascript also has different parameters for dev, stage and prod.

I can make put different npm build commands in the package.json.

However, in the POM file, I need to be able to use Profiles to have different commands for Prod and Stage.

However, I don't seem to be able to do that. Is there another way around this? There are some environment variables like PIPELINE_ID etc. Are there ones that will distinguish between Prod and Stage.?

How do people normally do it.

thanks

Fiona

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by satishchitikena

you can pass custom variables to pipe line using API call to pipeline.

https://experienceleague.adobe.com/docs/experience-manager-cloud-manager/using/getting-started/create-application-project/build-environment-details.html?lang=en#environment-variables

 

Ideally there should not be any 2 different build process for stage and prod . For dispatcher you might need to maintain apache system variables unique to environments. But the dispatcher code needs to be same on stage and production.

 

 

1 reply

satishchitikenaAccepted solution
December 16, 2020

you can pass custom variables to pipe line using API call to pipeline.

https://experienceleague.adobe.com/docs/experience-manager-cloud-manager/using/getting-started/create-application-project/build-environment-details.html?lang=en#environment-variables

 

Ideally there should not be any 2 different build process for stage and prod . For dispatcher you might need to maintain apache system variables unique to environments. But the dispatcher code needs to be same on stage and production.

 

 

Level 6
December 17, 2020

Thanks!

I was hoping not to have to use the API, just the UI at the start.

 

Just to get it clear in my head

In my POM file, for the frontend-maven-plugin, 

 

<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>npm run stag or prod</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run <VARIABLE HERE!!!> </arguments>
</configuration>
</execution>
</executions>
</plugin>

Then somehow I can ensure that the <VARIABLE> is "stag" in the Staging part of the pipeline and "prod" in the Production part ?

 

thanks in advance!!