remove references to Git being optional

This commit is contained in:
Audrey Jensen 2023-08-09 19:35:42 +00:00
parent b9488400df
commit 368b3e609e

View File

@ -9,8 +9,7 @@ This site combines links & services from the previous intranet site with portals
Based on Symfony 6.3.3, a php framework for developing web applications. Based on Symfony 6.3.3, a php framework for developing web applications.
It is cross-platform compatible, and can be run on Windows or Linux servers. It is cross-platform compatible, and can be run on Windows or Linux servers.
# Install # Install
## Server Setup ## (Optional, Recommended) Configuring Git
### (Optional, Recommended) Configuring Git
The recommended way to manage the app is through version-control software, such as Git. Git is recommended as it greatly simplifies continuous integration/development and provides a robust system for managing application versions. The recommended way to manage the app is through version-control software, such as Git. Git is recommended as it greatly simplifies continuous integration/development and provides a robust system for managing application versions.
This section will detail how to set up Git SCM for Windows. This section will detail how to set up Git SCM for Windows.
@ -32,83 +31,16 @@ Each branch in the tree organizes groups of changes to the origin. The lea
### Install Git ### Install Git
[Download Git SCM for Windows](https://gitforwindows.org/)<br> [Download Git SCM for Windows](https://gitforwindows.org/)<br>
Run the installer. Default settings are acceptable. Run the installer. Default settings are acceptable.
### Install OpenSSH Server
SSH will be used by Git for communications, as the git:// protocol does not support authentication and we are not using a webserver for http.
1. On Windows 11, open Settings -> Apps -> Optional Features
2. Select View features at the top of the window
3. Locate and install “OpenSSH Server”
Once this is finished, well need to manually start the OpenSSH service.
1. Open the Windows Services manager using your favorite method.
2. Locate OpenSSH SSH Server and manually start it.
a. If you want to use keypair authentication, also start OpenSSH Authentication Agent
3. Right-click each service you need and enter Properties. Set Startup type to Automatic (Delayed)
4. Click Apply and close both windows.
Finally, well need to test our connection.
1. On another machine, open a terminal and use the following command
`ssh [user]@jv@[hostname/IP]`
2. When prompted about a fingerprint, type Yes
3. Enter your password. Character entry will not be echoed. Hit Enter/Return
If the SSH server is running correctly, you should now in a terminal connected to the remote host.
### Configure OpenSSH Server
By default, OpenSSH will connect to a cmd.exe instance. For Git over SSH to work correctly well need to change this to the Bash install provided by Git.
1. Open a PowerShell terminal to the remote host. You may use an SSH connection for this. If you do, your first command should be `powershell`
2. Type the following one-line command:
`New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\Program Files/Git/bin/bash.exe" -PropertyType String -Force`
3. Close all SSH connections to the server. You may need to restart the OpenSSH Server service on the remote host.
New SSH connections will now use Bash. If you need to access PowerShell in the future, simply use the `powershell` command in Bash.
### Initialize a Bare Repository
A bare repository is a Git repo created without a working tree. Put simply, its a repository thats not intended to be modified by anything other than Git. Any changes to the files within cannot be made here.
A new repository will be created on the server, which will be what we point our app host & development machines to. This should NOT be the same location/repository as the actual app host and should ideally not even be on the same machine.
1. Open a terminal (bash, cmd, or powershell are all acceptable) in the location you want to keep the repo and run
`git init --bare Symfony.git`
You should now see a new folder named Symfony.git here. The .git naming convention is common for bare repositories. Move into the directory and type `git status` to confirm the operation completed successfully.
### Push to Git
The app code is already configured as a Git repository, so theres no need to initialize a new one. We just need to push this code to our new upstream repository.
1. On the machine where the code is present (likely the development machine at this point) open a terminal to the working directory (where all the project files are. This will be the same directory containing composer.json)
2. Use the following command to make sure were on master, the main branch.
```bash
git checkout master -force
git restore
```
- If there are pending unstaged changes, these will be discarded.
3. Use the command below to add the new bare repository as a remote with the name Intranet:
```bash
git remote add Intranet ssh://[user]@jv@[hostname/IP]:/[absolute_path_to_bare_repo]
```
4. Finally, use this command to push master to the remote:
```bash
git push --set-upstream Intranet master
```
If everything went well, the bare repo should now contain the application files.
Git can now be used to track changes to the code and synchronize them between repositories. When ready to update the app with these new changes, all youll have to do is pull them and restart the web server.
See the Git sub-section in Deployment to learn how to clone this repository for development or hosting.
## Deployment ## Deployment
### Simple ### Requirements:
Deployment can simply be copying all of the website applications files over to the server.
Theres no absolute rule on where these files should be placed, so long as theyre in their own directory and the folder structure remains unchanged.
For simplicity, its recommended to place this folder on the root of the disk. For example, `C:/Symfony`
### Git (Recommended)
If youve set up a Git repository, you can clone directly from that. The advantages of deploying this way is that future changes will be simplified and reverting them will be made easier.
#### Requirements:
- Git must be installed on the host system. [See Server Setup Install Git](#install-git) for instructions on installing. - Git must be installed on the host system. [See Server Setup Install Git](#install-git) for instructions on installing.
#### Deployment ### Deployment
1. Open a terminal to the root of the C drive, or wherever the production code will reside. 1. Open a terminal to the root of the C drive, or wherever the production code will reside.
2. Use this following command to clone the upstream repository: 2. Use this following command to clone the upstream repository:
a. Hosted on remote system
```bash ```bash
git clone ssh://[user]@jv[hostname/IP]://[aboslute_path_including_Symfony.git] git clone ssh://[user]@jv[hostname/IP]://[aboslute_path_including_Symfony.git]
``` ```
b. Hosted locally (or on NAS) in another directory:
```bash
Git clone file:///[absolute_path_including_Symfony.git]
```
3. Enter your password when prompted, and the repository should be cloned into /Symfony 3. Enter your password when prompted, and the repository should be cloned into /Symfony
4. The tickets database is included in the clone, but attachments are not. The default and sales folders will need to be copied into Symfony/public/TicketAttachments manually. Failure to do so will result in broken attachments. 4. The tickets database is included in the clone, but attachments are not. The default and sales folders will need to be copied into Symfony/public/TicketAttachments manually. Failure to do so will result in broken attachments.
5. In the project root find the file .env.prod and make a copy of it. Rename the copy to .env 5. In the project root find the file .env.prod and make a copy of it. Rename the copy to .env
@ -189,16 +121,16 @@ Merging branches can get messy and complicated quickly to new Git users, so it w
# Content Management # Content Management
Changing page contents is mostly handled within special configuration files. Changes made to these files are reflected immediately upon saving. Changing page contents is mostly handled within special configuration files. Changes made to these files are reflected immediately upon saving.
If youve chosen to deploy using Git, its important to know that changes made to production files may be overwritten during the next pull if theyre not committed. See the section [Committing Changes to Git](##committing-changes-to-git) for advice on persisting these. If youve chosen to deploy using Git, its important to know that changes made to production files may be overwritten during the next pull if theyre not committed. See the section [Committing Changes to Git](##committing-changes-to-git) for advice on persisting these.
Portal
Content on the main page is generated from the `portalLinks.yaml` file in the `%project_dir%/config` folder. ## Main page
Portal Content on the main page is generated from the `portalLinks.yaml` file in the `%project_dir%/config` folder.
The file follows the structure in which the data will be rendered on the webpage. Links are separated into objects (cards on the webpage.) Cards and links render in the order theyre given in the YAML file. The file follows the structure in which the data will be rendered on the webpage. Links are separated into objects (cards on the webpage.) Cards and links render in the order theyre given in the YAML file.
## Creating Cards ### Creating Cards
Create a new line in `portalLinks.yaml` and indent it with 2 spaces. Type the UNIQUE title of the card and append a colon at the end. Save the file. An empty card will now be rendered when the page is loaded Create a new line in `portalLinks.yaml` and indent it with 2 spaces. Type the UNIQUE title of the card and append a colon at the end. Save the file. An empty card will now be rendered when the page is loaded
## Creating Links ### Creating Links
1. Create a new line under the card you want the link to be contained in. 1. Create a new line under the card you want the link to be contained in.
2. Indent the new line with 5 spaces. Add a hyphen (dash) followed by another space. 2. Indent the new line with 5 spaces. Add a hyphen (dash) followed by another space.
3. Paste this YAML onto the new line: 3. Paste this YAML onto the new line: