UCL WIKI

UCL Logo
Page tree
Skip to end of metadata
Go to start of metadata

Workflow

  1. Transfer questionnaire information to CSV tables.
  2. Setup a Gitlab account.
  3. Upload CSV tables to database via pipeline.
  4. Correct the errors on CSV tables.
  5. Download the xml file and export it to archivist.

Setup a Gitlab account

  1. If you don’t have a Gitlab account, please register at https://gitlab.com/
  2. Once you sign in on Gitlab go to https://gitlab.com/jli755/archivist_insert
  3. Fork the repo on Gitlab.com. (Just click on the “Fork” in the right-hand corner of the window. - Please see the screen shot below)


       

    

      4. You now need credentials for Heroku and Archivist login (Please contact Hayley Mills to obtain the variables)

a. First make sure you are in the right part of the Gitlab (ie in your account – the url should be like https://gitlab.com/(your account name)/archivist_insert.



b. In Gitlab, go to Settings → CI/CD → Variables → Expand → Add Variable to add the variables.


                     

               

                          


                           

           (Make sure you tick both boxes  - 1. Protect variable and 2. Mask variable.)



Upload tables to database via pipeline


  1. Tables - You can use "csv" or "tsv" table formats, but not a mixture of them. (If you are using the "tsv" tables please see step 2 below) 

1. Copy your tables into "archivist_table"

a. Open the “archivist_tables” folder in Gitlab

b. Click “upload file” to copy the files to the folder (you have to upload individual files, therefore repeat the process for to upload all of your files.

c. To stop running the pipeline automatically, you need to add info about when you add or update on of these files.  Otherwise, it will automatically run the pipeline.  You should only run the pipeline when all files have been added; so in order to stop it running when you are not ready add [skip ci] to the comment.




                  

2. tsv tables instead of csv tables

  1. Need to change the delimiter in the db_temp.sql file
  2. May need to specify the encoding of the file (Please see below)
\COPY temp_sequence FROM 'archivist_tables/sequence.tsv' DELIMITER E'\t' CSV HEADER encoding 'windows-1251';



2. If it passes, great.  If not, look at the output cross mark to see what went wrong. Click on cross marks (1&2) on stages column (Please see the screen shot below)


                                      

                                          

Correct the errors on csv files

  1. If the csv files have formatting problem, it will not pass stage 1 (run_tests). Make sure all the table formats are compliance with the correct format. See Create metadata tables for uploading

                                       

2. Having extra spaces on the uploaded table create issues. Just delete the extra spaces and run the pipeline again to fix this error.


                              

Download the xml file and export it to archivist

  1. If it passes, the XML file is available as an "artifact" (a zip files containing the generated XML)  and this is available for 10 days.  The xml can be viewed temporarily from temp archivist and will need to be loaded into archivist via import, if you have permissions to do so then add to archivist, if not, please ask Hayley Mills to import.







  • No labels