Set up the Target system

Firstly, ensure the Target system is accessible from GitHub or whatever git central repository you are using. You will need 2 ports open e.g. 8081 and 8090. This is often easiest if you create your Target system in a Cloud environment like AWS or Microsoft Azure. Instead, you could use the LANSA Scalable License image which will be automatically licensed. You will need port 22 outgoing open to allow access to the git central repository.

1.  Install 64-bit git from here. It will automatically download 64-bit if you are on a 64-bit machine. Choose SSH security NOT Putty
If you don't do this, 32-bit git, when run through ASP.NET, attempts to get the SSH key from C:\Windows\SysWOW64\config\systemprofile\.ssh\id_rsa, which fails with insufficient permission.

2.  Install Git Extensions from here. Choose SSH security NOT Putty

3.  Choose the SSH Key for private repositories
For a public GitHub repository, this step is not required.

     The target system only requires read access to the central git repository. A key is only required if your central git repository is private.

a.  You may use a pre-existing SSH key that your organization uses for read access to private repositories. Do not use an SSH key which has modification permissions to any git repository anywhere. Make sure the name of the file is changed to id_rsa.

or

b.  You can generate the SSH Key
  Git is installed with a utility to generate SSH keys. You will find it in this directory:
%GIT_INSTALL_ROOT%\usr\bin\ssh-keygen.exe
For example, using the default install location:
"c:\program files\git\usr\bin\ssh-keygen.exe"

c.  Create the key in the default location with the default file name, so just click Enter for each prompt.
Two files will be created:
c:\users\<username>\.ssh\id_rsa and c:\users\<username>\.ssh\id_rsa.pub

4.  Configure GitHub with the public SSH Key.

a.  Edit the file containing the public SSH Key (for example c:\users\<username>\.ssh\id_rsa.pub) and copy the entire contents to the clipboard. To check that you have the correct file, the contents starts with 'ssh-rsa', 'ssh-ed25519', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'.

b.  Go to your GitHub repository Settings/Deploy Keys and click on Add Deploy Key:

c.  If you get the error "deploy key already in use" you will need to generate a new SSH Key (or use a GitHub team in a corporate account).

d.  Give the Deploy Key an appropriate title and paste the public key into the Key field:

5.  Create database   "SHOPPING" in SQL Server, or whatever database name you will be using. Use the same name as the Repository List identifier you are deploying.

6.  You copied the SHOPPING_...msi file to the target machine earlier. Now run it from the administrative command line like this:

$ cd \mytempdir

$ SHOPPING_v1.0.0_en-us.msi HTTPPORTNUMBER=8081

     Enter in the correct database server instance name, DSN name and database name, etc and install. Note that the currently logged on user must have sysadmin rights to the database server and db_owner rights to the database. If not, database access for LocalSystem will not be correctly set up. For the action to be taken, refer to 3.  GitDeployHub output indicates the deployment failed when installing the package in the 10.6.1 Deployment Errors in Troubleshooting.

7.  Add the LANSA License

8.  Check the web alias setting.
Open this file <root directory>\run\conf\lansaweb.conf and check the setting of web-alias

{ "web-alias": "shopping" }

 

9.  Test the website is configured correctly using this URL with the correct port: http://localhost:8081/shopping/lansaweb?about

10. Test the application works with a URL of this form. Note that the 'shopping' in the URL is the web alias, so specify the one you set in the previous step: http://localhost:8081/shopping/dem/xdtools.html?Page=HandTools.
Note: port may need to be changed

11. Stop the LANSA Listener, all web jobs, JSM Listener and stop IIS so that these executables can be overwritten by the next step - the git checkout. (if you do not do this step you will get an error doing the git checkout. This may be an 'unlink error' or 'delete error')

12. Clone the git repo into this directory using these steps (note that there will need to be at least 1 commit in the repository). At the git fetch step you may receive a prompt 'The authenticity of host github.com (192.1.1.1) can't be established…are you sure you want to continue connecting'. You need to answer 'yes':

$ cd c:\program files(x86)\lansa\shopping

$ git init

$ git remote add origin git@github.com:lansa/syd-lansa5-dem.git

$ git fetch

($ git branch other origin/other) only required if using non-default branch

$ git checkout -f master

 

13. Restart the listener, JSM Listener and IIS.

14. All the executable artefacts have been replaced with what the git repository contains. Re-test that the application still works with a URL of this form: http://localhost:8081/shopping/dem/xdtools.html?Page=HandTools. The application should be identical to the one you ran in the IDE