I have a java application that run with Apache tomcat 9. this app need an oracle database connection pool. this is my context in server.xml file.
<Context path="/app-develop" docBase="/some/path" >
<Resource name="jdbc/RasaDS"
auth="Container"
type="oracle.jdbc.pool.OracleDataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
url="jdbc:oracle:thin:@IP:1521:SID"
user="schema_name"
password="schema_pass"
connectionCachingEnabled="true"
connectionCacheName="myapp_test_connection_pool"/>
<Resource
auth="Container"
name="mail/Session"
type="javax.mail.Session"
mail.smtp.host="IP"
mail.smtp.password="smtp_pass"
mail.smtp.port="smtp_port"
mail.smtp.socketFactory.port="smtp_port"
mail.smtp.user="user@a.com"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
mail.smtp.socketFactory.fallback="false"
mail.transport.protocol="smtp"
mail.smtp.auth="true"
mail.smtp.starttls.enable="true"
mail.debug="true"/>
<Resource name="url/config"
factory="com.pars.common.util.GeneralBeanFactory"
auth="Container"
type="java.net.URL"
url="file:///Path/to/xml/config"/>
</Context>
As you see app needs a config file too. I'm new at Jenkins and CI/CD. I ran CI part using a pipeline. But deploy stage not working. my deploy stage in pipeline:
stage('deploy to test') {
steps {
deploy adapters: [tomcat9(credentialsId: 'tomcat-deployer', path: '', url: 'https://tomcat_url/app-develop/')], contextPath: 'file_name.war', war: '**/*.war'
}
}
- The Jenkins plugin use webapps directory by default, but I need to use custom directory path in context.
- in "contextPath" Jenkins plugin just accept war/ear file, but in deploy I need to unzip war file to config index files. any suggestion?
I use "Deploy to container" plugin. I also have this application in Container. For application directory in docker-compose file I use a volume.