Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Iguana X makes it easy to create reusable template components which can be part of a git collection.

What if you need to modify the source template? This is one way to do it:

 STEP 1: Change a template component’s repository
  • From the dashboard, click + Component and select Custom, then click Add

  • Once the component appears on the dashboard, double click it to bring up its information.

  • In the Connected To section, click on Customize

  • Select Remove Upstream in the drop down list and click Confirm. The Connected To section should change to the following:

  • You now have two options:

    • Edit Script allows you to make code changes and run the component with those changes

    • Set Up allows you to set up a git repository for this component so that any changes made can be tracked

  • For now, click on Set Up to configure a repository for the component. You should see this window appear, with the Owner field being populated with the details of your Bitbucket account. If this is empty, follow this guide: Setting up Bitbucket Access

  • In the Repository field, pick a name for the repository such as my_first_component then click Confirm Change. This will create a new repository for you if a repository with that name doesn’t already exist.

  • The window will close itself, and take you back to the component card. The Connected To section will be updated with the new repository information.

 STEP 2: Commit some code changes and push them to the remote repository

Now that there is a git repository tracking this component, changes made locally can be committed and saved to the cloud.

  • Click on Edit Script to open the Translator

  • Now change the code to the following which just changes the component’s border on the dashboard to red

    function main()
    	component.setBorder{color="red"}
    end
    main()
  • Once you have made some changes, click on the Commit Changes button in the Translator toolbar, its the one that looks like a plus surrounded by a circle

  • In the window that appears you can see the changes that were made. Enter a message that summarizes the changes, then click Commit

  • You will be sent back to the Translator screen. Notice that there are a few changes:

    • The Push Changes button in the Translator toolbar which looks an arrow pointing to a cloud has a blue dot. This means a local change is ready to be pushed to the cloud repository.

    • A new section has appeared at the bottom. This is the Git Terminal. This is where you will see information appear when Git commands like pulling, committing and pushing are done.

    • Users familiar with how Git works can use this terminal to perform Git operations.

  • Click on the Push Changes button. If Git was able to successfully send your changes to the remote repository, you will see this:

  • Now your changes are on the remote repository, they are ready to be imported in to any other Iguana instances you have

  • Exit Translator by hitting the X in the top right

 STEP 3: See the local code change in effect

The code change from the previous step was committed to the remote repository, but the component is not yet using the new code. The component must updated to use the new commit.

  • In the component card, use the Using Commit dropdown and change the commit the component is running on to the commit you made.

  • Now close the card and run the component. You should see it get a red outline

 STEP 4: Clone in your component on a different Iguana and update the code

Since the changes made have been pushed to the cloud, this component can now be cloned into any other Iguana.

Note: To try out this step you need to have a different Iguana instance ready with Bitbucket access configured. See: Setting up Bitbucket Access

  • Open the component that was created. From the component card, copy the Connected To field

  • In a different Iguana instance, from the dashboard click + From Url. Give the component a name, and paste in the url from before then click Add

  • Once the component is created, click Edit Script to go to Translator

    • You may have to click and expand the Implementation section

  • See that the code changes made in the previous step have been brought across

  • Change to the code to the following, then commit and push the change.

    function main()
    	component.setBorder{color="green"}
    end
    main()
  • Back on your other Iguana instance, update the component to run from this new commit. It can take a minute or two for the new commits to show up.

    • Use the Using Commit dropdown and select the commit you just made

  • Now run the component and verify that the border turns green

  • Click on Edit Script to go to the Translator. To see the code changes, we have to pull in the changes from the remote repository.

    • Do this by clicking on the Pull Changes button which looks like a cloud with an arrow pointing away from it.

    • Notice that it has a blue dot, indicating that there are changes available to be pulled in. Click it and see that the code updates.

 STEP 5: Add the component to a collection

The process above outlined what it takes to create a component with some code that can be easily brought over to any number of Iguana instances. To make this process even easier, you can group components you make into a collection.

  • From the component card, click on Add to Collection, in the window that appears set the dropdown to Create New Collection and click Select

  • Create a name for the collection, then click Create & Add. Wait for this to finish, and then in the window that appears click Select.

  • In the Edit collection screen that appears, create a name for your collection and click Save

  • Once it is done, you will see this. Click Dismiss.

  • Now go back to the dashboard and click + Component. You should see your component appear in the list of components available

    • Depending on the name you gave it, you may have to scroll through the list

  • This collection has been added to the current Iguana instance. To see this, go to the settings screen and click on Git Collection. Your newly created collection will appear in the repositories list.

    • To use this collection in a different Iguana instance, first copy the url

    • Then in the other instance go to settings, click Git Collection and click Edit in the top right

    • Then click Add Collection and paste in the copied url and click Save

  • Now go back top the dashboard and click + Component and you will see your component appear

  • [This feature has some issues in 10.1.70]

  • No labels