# Deploy updates to XINA

Developers must deploy DraMS specific updates to the [DraMS XINA instance](https://drams.xina.io/) to ensure proper operation. These updates serve two main purposes:
* Update XINA's DraMS mnemonic definitions
* Update the tooling required to extract data from the archives

The updates come from following Git repo dependencies:
* [dramsgse](https://sed-gitlab.gsfc.nasa.gov/drams/dramsgse)
  * `apps/linux/struct_extract` - Extracts and converts the telemetry data from the packet archives
  * `tmdef/` - Telemetry definitions used by `struct_extract` to decode and convert the telemetry data. The telemetry definition files are also converted to XINA's [Mnemonic Definition](https://wiki.xina.io/books/structured-data-standards/page/struct-definitions-reference#bkmrk-mnemonic-definitions) format then imported.
* [699util](https://sed-gitlab.gsfc.nasa.gov/699/699util)
  * Mining scripts that extract additional data from the raw packet archives such as markers and message logs.
 
These repositories are not directly cloned on XINA. Instead, snapshots of the repositories are updated to AWS S3. Each repo has a "upload_s3.sh" script that can be used to upload the repo to the proper location. Usage requires confguring your `aws ssm` credentials.

The following scenarios require new versions to be uploaded to S3 and then deployed to drams.xina.io. Deploymeny to drams.xina.io are performed using the AWS SSM deploy script.

* Changes to the DraMS Telemetry Definitions (i.e. `DRAMS_TM_Database.txt` or any patch files)
* Changes to `struct_extract`. This may include:
  * DraMS decoder changes - DraMS decoders are implemented as static plugins, so changes require a new version of `struct_extract` to be released and deployed.
  * General `struct_extract` changes
  * `gselib` changes (or related) that affect all data processing
  * Changes to `dramslib` (or other related code) that impacts how DraMS data is extracted, converted, or processed
* 699util:
  * `c699util` - this C++ SWIG library is used by the [699util Python tools](https://sed-gitlab.gsfc.nasa.gov/699/699util) which is used to perform mission specific mining
 
##### Steps:
1. In Ubuntu VM: Build `gsw-cpp` master.
2. Build appimage of `struct_extract`.
```
./scripts/makestructextract.sh
```
3. Add `struct_extract` to `dramsgse` repo.
4. source labcode/699util/devenv.sh
5. In gsw-cpp: 
```
cd c699util
./copy_into_699util.py
```
6. Perform same process on Mac.
7. Tag version of 699util.
8. upload_s3.sh
9. In dramsgse, upload_s3.sh.
10. Generate XINA Mnem Defs from dramsgse/tmdef tmdbs.
11. Import into XINA.
12. Deploy changes to drams.xina.io using DeployStructGse.