Switch profiles between the development environment and production environment

Profiles are mechanisms for switching resource settings when you run scripts.

By configuring profiles in the resources, you can switch destinations such as databases and switch the storage to output data to without editing scripts.

This section describes how you can perform development while using profiles to switch between the development environment and production environment.

Description

Switch between the following profiles to use each of the resources used by users.

  • Dev profile

    This profile is used by developers in the development environment.

  • Production profile

    This profile is used by Ops engineers in the production environment.

 

Procedures

Preparation

(1) Create a workspace

This tutorial uses the Team A workspace as the workspace for developers and Ops engineers to work in.

If the Team A workspace hasn't been created, refer to Create a workspace to work together to create a workspace.

Permission for developer and Ops engineer users is Editor.

= Remarks =

Users whose workspace Permission is Editor can change the users and groups that are registered to a workspace.

Users whose Permission is Viewer can use the workspace, but they can’t change the users or groups.

(2) Create directories in the storage

This tutorial describes how to prepare a development directory to output the CSV data for development to and a production directory to output the CSV data for production to.

In the storage for "Team A", create the directories with the following procedure:

  1. Select > SERVICES > Storage.

  2. On the Storage page, select Team A for the workspace.

  3. On the Storage page for Team A, select New Directory.

  4. In the New Directory dialog, enter Dev in Name, and then select Add.

  5. Use the same procedure to create the Production directory.

 

Developer

(1) Create a Dev profile

This section describes how to create a Dev profile to register development resources.

Create a Dev profile using the following procedure:

  1. Select > SYSTEM > Profiles.

  2. On the Profiles page, select Add.

  3. In step General, set the fields related to the profile as shown below, and then select Next.

    Field name

    Setting (example)

    Name

    Dev

    Description

    (Optional)

    Users

    Add a user or group that is responsible for the development.

    Specify Editor for Permission.

    Groups

    = Remarks =

    Users whose Permission is Editor can change the resources that are registered in the profile.

    Users whose Permission is Viewer can use the resources registered in the profile, but they can’t change the resources.

  4. In step Summary, confirm that the settings are correct, and then select Finish.

    = Remarks =

    The user specified in Users or Groups can use the created profile.

    Therefore, the Dev profile can be used by development members only.

(2) Create a connection for development

This section describes how connection settings are configured assuming a PostgreSQL database is used for development.

In the following procedure, perform a connection setting to PostgreSQL.

  1. Select > HULFT INTEGRATE > Connections.

  2. On the Connections page, select Add New.

  3. From the Type list, select PostgreSQL 12 connection, and then select Next.

  4. In step General, set the fields related to the connection as shown below, and then select Next.

    Field name

    Setting (example)

    Name

    PostgreSQL 12 connection

    Workspace

    Team A

    Description

    (Optional)

  5. In step Settings, set the fields related to the connection, and then select Next.

  6. In step Profiles, select the Dev profile, and then select Next.

    = Remarks =

    In this step, the connection for development is registered to the Dev profile created in (1) .

  7. In step Summary, confirm that the settings are correct, and then select Finish.

(3) Create a variable

This section describes how to configure the variable settings in order to switch between the directory to put development data in and the directory to put production data in.

Create a variable using the following procedure:

  1. Select > HULFT INTEGRATE > Variables.

  2. On the Variables page, select Add New.

  3. In step General, set the fields related to the connection as shown below, and then select Next.

    Field name

    Setting (example)

    Name

    Storage path

    Workspace

    Team A

    Description

    (Optional)

  4. Set the storage path for the development directory as the value for the variable.

    In step Settings, set the fields as shown below, and then select Next.

    Field name

    Setting (example)

    Value

    /Team A/Dev (*1)

    *1

    :

    This displays the /Workspace name/Directory name.

  5. In step Profiles, select the Dev profile, and then select Next.

    = Remarks =

    In this step, the variable that is set with the path to the development directory is registered to the Dev profile created in (1) .

  6. In step Summary, confirm that the settings are correct, and then select Finish.

(4) Create a project and script

In the following procedure, create a project and script.

  1. Select > HULFT INTEGRATE > Projects.

  2. On the Projects page, select Create Project.

  3. In step General on the Projects > Add New page, set the fields related to the project as shown below, and then select Next.

    Field name

    Setting (example)

    Name

    CSV_PostgreSQL

    Workspace

    Team A

    Description

    (Optional)

    Create Script

    Select the checkbox.

    Script Name

    CSV_Postgre_script

  4. In step Summary, confirm that the settings are correct, and then select Finish.

  5. Set the Edit CSV_PostgreSQL dialog as follows.

    Field name

    Setting (example)

    Profile

    Dev

    Integrate service

    Select an Integrate service.

    Project version

    1

  6. Select Launch Designer.

    = Remarks =

    If you want to change the profile after you launch Designer, perform the following procedure.

    In the Tools menu > Option > Profile of Designer, select the profile from the dropdown list.

  7. From the tool palette in Designer, drag Database > PostgreSQL > Read Table onto the script canvas.

    Configure the required settings for the Read Table operation as shown below.

    Field name

    Setting (example)

    Destination

    PostgreSQL 12 connection

    Table name

    Specify the table name to read data from.

  8. From the tool palette in Designer, drag File > CSV > Write CSV File onto the script canvas.

    Configure the required settings for the Write CSV File operation as shown below.

    Field name

    Setting (example)

    File

    %{Storage path}/output.csv

    = Remarks =

    %{Storage path} means that the Storage path of the variable created in (3) is used.

    You can either enter it directly or select the variable from which is displayed after you select the text box.

  9. Link the component icons as follows:

(5) Test the project and the script with test data for development

  • When executing in Designer

    Run the script with the same procedure as Execute the script of Create a script that processes a CSV file.

  • When executing with jobs

    Configure the settings assuming that you are creating a scheduled job to execute a script.

    With the following procedure, create a scheduled job for development.

    1. Select > JOBS > Schedule Jobs.

    2. On the Schedule Jobs page, select Add.

    3. In step General on the Schedule Jobs > Add New page, set the fields related to the scheduled job as shown below, and then select Next.

      Field name

      Setting (example)

      Name

      Scheduled job for development

      Workspace

      Team A

      Profile

      Dev

      Description

      (Optional)

    4. In step Recurrence, set the fields as shown below, and then select Next.

      Field name

      Setting (example)

      Recurrence

      Hour

      Interval time

      1

      Start time

      Specify 10 minutes after the current time.

      End time

      Specify 30 minutes after the current time.

      Start date

      Specify today's date.

      End date

      Specify today's date.

      Time zone

      (UTC-08:00) Pacific Time (US & Canada)

    5. In step Holidays, set the fields as shown below, and then select Next.

      Field name

      Setting (example)

      Calendars

      Organization Calendar created in Prepare an organization calendar

      Holiday Option

      Do not execute on a holiday

    6. In step Project, set the fields as shown below, and then select Next.

      Field name

      Setting (example)

      Project

      CSV_PostgreSQL

      Version

      Specify the latest version.

      Script

      CSV_PostgreSQL_script

      Script version

      Set the dependency relationship of scripts.

    7. In step Service to run scripts, specify the HULFT Integrate service of the script execution environment, and then select Next.

    8. In step Summary, confirm that the settings are correct, and then select Finish.

    9. Check whether the script is executed at the execution time of the scheduled job.

      Check the execution results of the script in > JOB EVENTS > Schedule Jobs.

      = Remarks =
      • You must associate profiles with all jobs, not just scheduled jobs.

      • For REST API jobs, endpoints for development are different from the ones for production.

        Create an endpoint for development when you create a REST API job.

(6) Check the CSV file

Confirm that the CSV file has been created in the development directory using the following procedure:

  1. Select > SERVICES > Storage.

  2. On the Storage page, select Team A for the workspace.

  3. On the Storage page for Team A, select the Dev directory.

  4. Check that output.csv is created in the Dev directory.

This completes the procedure for executing scripts using a profile for development.

 

Ops engineer

(1) Create a Production profile

This section describes how to create a Production profile to register production resources.

Using the same procedure as (1) of Developer, enter Production in Name of the profile to create it.

(2) Create a connection for production

This section describes how connection settings are configured assuming a PostgreSQL database is used for production.

In the following procedure, perform a connection setting to PostgreSQL.

  1. Select > HULFT INTEGRATE > Connections.

  2. On the Connections page, select the action menu of the PostgreSQL 12 connection.

  3. Select Information.

  4. On the Connections > PostgreSQL 12 connections page, select Add settings.

  5. In step Settings, set the fields related to the connection, and then select Next.

  6. In step Profiles, select Production profile, and then select Next.

  7. In step Summary, confirm that the settings are correct, and then select Finish.

  8. Go back to the Connections > PostgreSQL 12 connection page and check whether the connection settings for the Production profile are in the profile list.

(3) Create a variable

  1. Select > HULFT INTEGRATE > Variables.

  2. Select Information from the action menu for Storage path on the Variables page.

  3. On the Variables > Storage path page, select Add settings.

  4. Set the storage path for the production directory.

    In step Settings, set the fields as shown below, and then select Next.

    Field name

    Setting (example)

    Value

    /Team A/Production

  5. In step Profiles, select the Production profile, and then select Next.

    = Remarks =

    In this step, the variable that is set with the path to the production directory is registered to the Production profile created in (1) .

  6. In step Summary, confirm that the settings are correct, and then select Finish.

(4) Deploy the project and the script to the production environment

  • When executing in Designer

    To switch to the profile of the production environment, open the Designer using the following procedure.

    1. Select > HULFT INTEGRATE > Projects.

    2. On the Projects page, select Open project for the CSV_PostgreSQL project.

    3. In the Edit CSV_PostgreSQL dialog, specify Production in Profile.

    4. Select Launch Designer.

    5. Run the script with the same procedure as Execute the script of Create a script that processes a CSV file.

  • When executing with jobs

    Configure the settings for the production environment assuming that you are creating a scheduled job to execute a script.

    With the following procedure, create a scheduled job for the production environment.

    1. Select > JOBS > Schedule Jobs.

    2. On the Schedule Jobs page, select Add.

    3. In step General on the Schedule Jobs > Add New page, set the fields related to the scheduled job as shown below, and then select Next.

      Field name

      Setting (example)

      Name

      Scheduled job for the production environment

      Workspace

      Team A

      Profile

      Production

      Description

      (Optional)

    4. Hereafter, use the same procedure as the one in step 4 of When executing with jobs for Developers.

= Remarks =
  • You must associate profiles with all jobs, not just scheduled jobs.

  • For REST API jobs, endpoints for development are different from the ones for production.

    Ops engineers don't need to change endpoints, when they update scripts in production.

(5) Check the CSV file

Confirm that the CSV file has been created in the production directory using the following procedure:

  1. Select > SERVICES > Storage.

  2. On the Storage page, select Team A for the workspace.

  3. On the Storage page for Team A, select the Production directory.

  4. Check that output.csv is created in the Production directory.

This completes the procedure for executing scripts using profiles for the production environment.