Creating a Support Pack: Difference between revisions

From Flashpoint Datahub
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
This guide covers how to submit a [[Platforms|platform]] to Flashpoint.
This guide covers how to submit a [[Platforms|platform]] to Flashpoint. See also: [[Support Pack Tutorial]].


== Setting up the Gitlab Repository ==
== Setting up the Gitlab Repository ==


Login to the Flashpoint Gitlab instance. https://gitlab.unstable.life/
Login to the Flashpoint Gitlab instance and create a public Blank Project under the [https://gitlab.unstable.life/flashpoint/components/support-packs flashpoint/components/support-packs] group.


Create a public Blank Project under the <code>flashpoint/components</code> group.
[[File:creating_support_pack_gitlab_1.png|800px]]
 
[[File:creating_support_pack_gitlab_1.png]]


Clone this new repository locally. Add a <code>.gitlab-ci.yml</code> file to the root of the folder, with the template file below. Replace the <code>COMPONENT_NAME</code>, <code>META_NAME</code> and <code>META_DESCRIPTION</code> variables as appropriate.
Clone this new repository locally. Add a <code>.gitlab-ci.yml</code> file to the root of the folder, with the template file below. Replace the <code>COMPONENT_NAME</code>, <code>META_NAME</code> and <code>META_DESCRIPTION</code> variables as appropriate.
Line 14: Line 12:


'''.gitlab-ci.yml'''
'''.gitlab-ci.yml'''
<code>
 
  variables:
  variables:
   COMPONENT_NAME: "supportpack-name"
   COMPONENT_NAME: "supportpack-name"
Line 51: Line 49:
     paths:
     paths:
       - artifact.zip
       - artifact.zip
</code>


Next we want to make sure all binary files are commited by Git LFS. To automate this we'll let Git keep track of which file extensions to use LFS to commit. There's an example <code>.gitattributes</code> below that you can use as a template. Be sure to add any extra file extensions as is appropriate for your support pack.
Next we want to make sure all binary files are commited by Git LFS. To automate this we'll let Git keep track of which file extensions to use LFS to commit. There's an example <code>.gitattributes</code> below that you can use as a template. Be sure to add any extra file extensions as is appropriate for your support pack.
Line 57: Line 54:
'''.gitattributes'''
'''.gitattributes'''


<code>
   *.dll filter=lfs diff=lfs merge=lfs -text
   *.dll filter=lfs diff=lfs merge=lfs -text
   *.ocx filter=lfs diff=lfs merge=lfs -text
   *.ocx filter=lfs diff=lfs merge=lfs -text
Line 65: Line 61:
   *.db filter=lfs diff=lfs merge=lfs -text
   *.db filter=lfs diff=lfs merge=lfs -text
   *.sqlite filter=lfs diff=lfs merge=lfs -text
   *.sqlite filter=lfs diff=lfs merge=lfs -text
</code>


=== Adding / Updating Files ===
=== Adding / Updating Files ===

Latest revision as of 13:39, 15 October 2023

This guide covers how to submit a platform to Flashpoint. See also: Support Pack Tutorial.

Setting up the Gitlab Repository

Login to the Flashpoint Gitlab instance and create a public Blank Project under the flashpoint/components/support-packs group.

Creating support pack gitlab 1.png

Clone this new repository locally. Add a .gitlab-ci.yml file to the root of the folder, with the template file below. Replace the COMPONENT_NAME, META_NAME and META_DESCRIPTION variables as appropriate.

Whenever you push this repository, Gitlab will automatically pack up any files (excluding files starting with . at the root) into a Flashpoint component, generate the metadata and upload it to the development server.

.gitlab-ci.yml

variables:
  COMPONENT_NAME: "supportpack-name"
  NEXUS_REPO: "components"
  META_NAME: "Component Name"
  META_DESCRIPTION: "Component Description"
include:
  - project: 'flashpoint/docker/nexus-deploy-action'
    ref: main
    file: '/docker-build.gitlab-ci.yml'
deploy:
  stage: build
  script: |
    COMP_FILE=${COMPONENT_NAME}.zip
    COMP_JSON=${COMPONENT_NAME}.json
    zip -r $COMP_FILE ./ -x "./.**"
    jq --null-input \
        --arg name     "$META_NAME" \
        --arg desc     "$META_DESCRIPTION" \
        --arg date     $(date +%s) \
        --arg download $(du -b $COMP_FILE | awk '{print $1}') \
        --arg install  $(7z l $COMP_FILE | tail -n 1 | awk '{print $3}') \
        --arg path     "FPSoftware" \
        --arg hash     $(crc32 $COMP_FILE) \
        '{ 
          "title": $name,
          "description": $desc,
          "date-modified": $date,
          "download-size": $download,
          "install-size": $install,
          "path": $path,
          "crc32": $hash 
        }' > $COMP_JSON
    zip artifact.zip $COMP_FILE $COMP_JSON
  artifacts:
    paths:
      - artifact.zip

Next we want to make sure all binary files are commited by Git LFS. To automate this we'll let Git keep track of which file extensions to use LFS to commit. There's an example .gitattributes below that you can use as a template. Be sure to add any extra file extensions as is appropriate for your support pack.

.gitattributes

 *.dll filter=lfs diff=lfs merge=lfs -text
 *.ocx filter=lfs diff=lfs merge=lfs -text
 *.mid filter=lfs diff=lfs merge=lfs -text
 *.pwc filter=lfs diff=lfs merge=lfs -text
 *.exe filter=lfs diff=lfs merge=lfs -text
 *.db filter=lfs diff=lfs merge=lfs -text
 *.sqlite filter=lfs diff=lfs merge=lfs -text

Adding / Updating Files

Add all the files your support pack includes. Do not include shared dependencies like Browser applications. For examples please see other component repositories on Gitlab.