Code Monkey home page Code Monkey logo

wso2-cicd-environment-injection-for-endpoints's Introduction

This is a demo of one way to dynamicaly inject environment specific endpoint urls into your WSO2 EI/MI code. This would be executed in the CI/CD process flow to migrate code from Dev -> Test -> UAT -> Prod.

Steps:

  1. Open WSO2 Integration Studio and create your endpoint using the wizard.
  2. Create a project (or clone this one) structured like this one.
  3. Copy in the endpoint.xml file and change the address to be dynamic IE: :some-name-to-substitue
  4. Create the conf files for your environments.
  5. Delete your studio project if you no longer need it.

Example mvn command: mvn clean install "-Denv=PROD"

Result: [INFO] Scanning for projects... [INFO] [INFO] ----------------< wso2.sampleHelloWorld:Demo-Endpoints >---------------- [INFO] Building Demo-Endpoints 1.0.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Demo-Endpoints --- [INFO] Deleting /Users/scottbechtel/dev/clients/support/CS0221318/EndpointInjectionDemo/Demo-Endpoints/target [INFO] [INFO] --- maven-resources-plugin:3.3.0:copy-resources (copy-resources-endpoints) @ Demo-Endpoints --- [INFO] Copying 1 resource [INFO] [INFO] --- maven-resources-plugin:3.3.0:copy-resources (copy-resources-local-entries) @ Demo-Endpoints --- ... [INFO] Installing /Users/scottbechtel/dev/clients/support/CS0221318/EndpointInjectionDemo/Demo-Endpoints/target/Demo-Endpoints-1.0.0-SNAPSHOT-TEST-bundle.zip to /Users/scottbechtel/.m2/repository/wso2/sampleHelloWorld/Demo-Endpoints/1.0.0-SNAPSHOT/Demo-Endpoints-1.0.0-SNAPSHOT-bundle.zip [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.414 s [INFO] Finished at: 2023-02-08T11:11:40-06:00 [INFO] ------------------------------------------------------------------------

Example Injected Result from prod.conf file: <?xml version="1.0" encoding="UTF-8"?> <endpoint name="DemoEP" xmlns="http://ws.apache.org/ns/synapse"\> <http uri-template="http://PROD.company.com"\> <suspendOnFailure> <initialDuration>-1</initialDuration> <progressionFactor>1.0</progressionFactor> </suspendOnFailure> <markForSuspension> <errorCodes>-1</errorCodes> <retriesBeforeSuspension>0</retriesBeforeSuspension> </markForSuspension> </http> </endpoint>

wso2-cicd-environment-injection-for-endpoints's People

Contributors

v-scottbechtel avatar bechtelcandoit avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.