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.

Operation flow
Procedures
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.
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:
-
Select
> SERVICES > Storage.
-
On the Storage page, select Team A for the workspace.
-
On the Storage page for Team A, select New Directory.
-
In the New Directory dialog, enter Dev in Name, and then select Add.
-
Use the same procedure to create the Production directory.
This section describes how to create a Dev profile to register development resources.
Create a Dev profile using the following procedure:
-
Select
> SYSTEM > Profiles.
-
On the Profiles page, select Add.
-
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.
-
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.
-
Select
> HULFT INTEGRATE > Connections.
-
On the Connections page, select Add New.
-
From the Type list, select PostgreSQL 12 connection, and then select Next.
-
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)
-
In step Settings, set the fields related to the connection, and then select Next.
-
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) .
-
In step Summary, confirm that the settings are correct, and then select Finish.
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:
-
Select
> HULFT INTEGRATE > Variables.
-
On the Variables page, select Add New.
-
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)
-
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.
-
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) .
-
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.
-
Select
> HULFT INTEGRATE > Projects.
-
On the Projects page, select Create Project.
-
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
-
In step Summary, confirm that the settings are correct, and then select Finish.
-
Set the Edit CSV_PostgreSQL dialog as follows.
Field name
Setting (example)
Profile
Dev
Integrate service
Select an Integrate service.
Project version
1
-
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.
-
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.
-
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.
-
Link the component icons as follows:
(5) Test the project and the script with test data for development
-
Run the script with the same procedure as Execute the script of Create a script that processes a CSV file.
-
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.
-
Select
> JOBS > Schedule Jobs.
-
On the Schedule Jobs page, select Add.
-
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)
-
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)
-
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
-
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.
-
In step Service to run scripts, specify the HULFT Integrate service of the script execution environment, and then select Next.
-
In step Summary, confirm that the settings are correct, and then select Finish.
-
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.
-
-
Confirm that the CSV file has been created in the development directory using the following procedure:
-
Select
> SERVICES > Storage.
-
On the Storage page, select Team A for the workspace.
-
On the Storage page for Team A, select the Dev directory.
-
Check that output.csv is created in the Dev directory.
This completes the procedure for executing scripts using a profile for development.
(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.
-
Select
> HULFT INTEGRATE > Connections.
-
On the Connections page, select the action menu of the PostgreSQL 12 connection.
-
Select Information.
-
On the Connections > PostgreSQL 12 connections page, select Add settings.
-
In step Settings, set the fields related to the connection, and then select Next.
-
In step Profiles, select Production profile, and then select Next.
-
In step Summary, confirm that the settings are correct, and then select Finish.
-
Go back to the Connections > PostgreSQL 12 connection page and check whether the connection settings for the Production profile are in the profile list.
-
Select
> HULFT INTEGRATE > Variables.
-
Select Information from the action menu for Storage path on the Variables page.
-
On the Variables > Storage path page, select Add settings.
-
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
-
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) .
-
In step Summary, confirm that the settings are correct, and then select Finish.
(4) Deploy the project and the script to the production environment
-
To switch to the profile of the production environment, open the Designer using the following procedure.
-
Select
> HULFT INTEGRATE > Projects.
-
On the Projects page, select Open project for the CSV_PostgreSQL project.
-
In the Edit CSV_PostgreSQL dialog, specify Production in Profile.
-
Select Launch Designer.
-
Run the script with the same procedure as Execute the script of Create a script that processes a CSV file.
-
-
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.
-
Select
> JOBS > Schedule Jobs.
-
On the Schedule Jobs page, select Add.
-
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)
-
Hereafter, use the same procedure as the one in step 4 of When executing with jobs for Developers.
-
-
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.
Confirm that the CSV file has been created in the production directory using the following procedure:
-
Select
> SERVICES > Storage.
-
On the Storage page, select Team A for the workspace.
-
On the Storage page for Team A, select the Production directory.
-
Check that output.csv is created in the Production directory.
This completes the procedure for executing scripts using profiles for the production environment.