Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Log into your Azure DevOps account and click Create project.
  2. Enter Parabank as the project name and click Advanced.
  3. Verify that Git is selected as the version control system and that Agile is selected as the Work item process.
    Image Modified
  4. Click Create.

...

Building the Parabank Project in Azure DevOps

  1. Choose Repo from the project sidebar and click Import.
    Image Modified
  2. Choose Git as the Source type and enter http://github.com/parasoft/parabank.git in the Clone URL.
  3. Click Import to finish cloning the Parabank code to your project. You will be redirected to the code editor view when the import is complete.
  4. Choose Pipeline> Builds from the project sidebar and click New Pipeline.
    Image Modified
  5. Choose Azure Repos Git and verify that the Parabank project, Parabank repository, and master branch are selected.
    Image Modified
  6. Click Continue and apply the Maven template. The Azure DevOps Maven template adds a Pipeline task, Get sources task, and an Agent job task. Image Modified
  7. Click the Maven pom.xml subtask under the Agent job task and change the value of the Goal(s) field to install.
  8. Disable the Publish to Azure Pipelines/TFS option under the JUnit Test Results section.
    Image Modified
  9. Click the Copy Files to subtask and change the value of the Source Folder $(Build.Repository.LocalPath)/target. You should also update the Display name for consistency.
  10. Change the value in the Contents field to */.war.
    Image Modified
  11. Choose Save & queue from the Save & queue drop-down menu.
  12. Choose Hosted from the Agent pool drop-down.
  13. (Optional) Add commit comments to document your process.
  14. Click Save & queue when ready.
  15. Click on the link in the confirmation bar to monitor the build, which will take five to 10 minutes to complete.

...

  1. Choose Browse Marketplace from the marketplace menu in Azure DevOps.
  2. Search for Parasoft Service Virtualization and click to install.
    Image Modified
  3. Return to the marketplace and repeat the process to install the Apache Tomcat Deployment artifact.

...

In this guide, we will use SSH to connect to the server. You can also click Connect on the VM home page in Azure and click the RDP tab to access a remote desktop configuration.
Image Modified

  1. Open a command prompt and connect to the VM:

    ssh <VM_USER_ID>@<VM_IP>

  2. Navigate to the /usr/local/tomcat/webapps/manager/META-INF directory

    cd /usr/local/tomcat/webapps/manager/META-INF

  3. You may not have permissions to the subdirectories under tomcat and may need to add read, write, execute access. You can change the permissions as you move through each subdirectory or recursively change the permissions.

    sudo chmod -R 777 webapps
     
  4. Edit the context.xml file with a command line editor.

    Vim context.xml

  5. Comment out the following element to enable remote access to the manager application:

    No Format
    <Context antiResourceLocking="false" privileged="true" >

...

  1. 
    <!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"

...

  1. 
    allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> - ->

...

  1. 
    </Context>

     

  2. Write the changes and close the file.

You will also need to enable the user and role for scripting access to the manager application.

Navigate to the /usr/local/tomcat/conf directory. You may need to change the permissions to enable access to the applicable subdirectories.

  1. Edit the tomcat-users.xml file with a command line editor

    Vim tomcat-users.xml
     
  2. Add the following user and role configuration to the <tomcat-users> element:

    No Format
    <role rolename="manager-script"/>

...

  1. 
    <role rolename="manager-gui"/>

...

  1. 
    <user username="tomcat" password="tomcat" roles="manager-script,manager-gui"/>


    The username and password must both be "tomcat".
     

  2. Write the changes and close the file.
  3. You will need to restart the tomcat server. Navigate to the usr/local/tomcat/bin directory. You may need to change the permissions to enable access to the applicable subdirectories.I added this section to try to prevent the error during the Tomcat deployment build step per these resources:
    https://www.digitalocean.com/community/questions/how-to-access-tomcat-8-admin-gui-from-different-host
    https://github.com/Microsoft/vsts-tomcat/blob/master/src/tasks/tomcatDeployment/README.md
    It didn't seem to help Anchor_GoBack_GoBack

...

Configuring Release Settings

...

  1. After installing the plugins, return to the Parabank project and click Project settings.
  2. Click Service connections in the Pipelines section and choose Parasoft CTP from the New service connection drop-down menu.
    Image Modified
  3. Configure the following settings when prompted:
    1. Connection name: Specify a name for the connection (e.g., ParasoftEM).
    2. Server URL: Enter the URL of your instance of CTP on Azure (see Opening CTP).
    3. Username/Password: The default username and password is admin/admin.
      Image Modified
  4. Click OK when finished. The connection will appear in your Service connections.

...

  1. Choose Pipelines> Builds from the sidebar and click on the build created in the Building the Parabank Project in Azure DevOps section.
  2. Click the Release button and choose Empty job when prompted.
    Image Modified
  3. (Optional) Rename the job and close the panel.
  4. Click the Tasks tab and click the add button (+) to add a task to the agent.
    Image Modified
  5. Click the Deploy tab and add the Deploy to Apache Tomcat Server and Parasoft Service Virtualization Deploy tasks.
    Image Modified
  6. Click on the Deploy to Apache Tomcat Server task and configure the following settings:
    1. Tomcat Server URL: <AZURE_VM_IP_ADDRESS>. Do not include the port number.
    2. Tomcat Manager Username: tomcat
    3. Password: tomcat
    4. WAR file: Browse for the location of the parabank.war file.
    5. Application Context: /
  7. Click on the Parasoft Service Virtualization Deploy task and configure the following settings:
  8. Parasoft CTP Endpoint: Choose the ParasoftEM service endpoint created in the Configuring Release Settings section.
    1. System: ParaBank (the name of the system deployed to CTP in the Creating a Virtual Machine in Azure section).
    2. Environment: Golden
    3. Instance: Negative
  9. Click Save.
  10. (Optional) By default, the configuration will be saved to the All Pipelines directory, but you can specify a subdirectory, as well as add a comment.
  11. Click OK.

...