dcp-worker 3.2.30 → 3.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -10,6 +10,7 @@ default:
10
10
 
11
11
  stages:
12
12
  - build
13
+ - deploy
13
14
 
14
15
  tidelift:
15
16
  stage: build
@@ -30,3 +31,28 @@ tidelift:
30
31
  - ./tidelift alignment save --wait
31
32
  allow_failure: true
32
33
  cache: []
34
+
35
+ publish_docs:
36
+ rules:
37
+ - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
38
+ changes:
39
+ paths:
40
+ - catalog-info.yaml
41
+ - docs/
42
+ # Symlinked into `docs/`, but changes are only detected for by the
43
+ # source file.`
44
+ - README.md
45
+ variables:
46
+ AWS_ACCESS_KEY_ID: $BACKSTAGE_ACCESS_KEY
47
+ AWS_SECRET_ACCESS_KEY: $BACKSTAGE_ACCESS_SECRET
48
+ AWS_DEFAULT_REGION: 'us-east-1'
49
+ AWS_REGION: 'us-east-1'
50
+ TECHDOCS_S3_BUCKET_NAME: 'backstage.distributive.network'
51
+ ENTITY_NAMESPACE: 'default'
52
+ stage: deploy
53
+ needs: []
54
+ image: registry.gitlab.com/distributed-compute-protocol/docker/dcp-ci:2023-09-13
55
+ script:
56
+ - npm clean-install
57
+ - python3 -m pip install mkdocs mkdocs-techdocs-core==1.* mkdocs-same-dir
58
+ - bin/publish-docs.sh
@@ -0,0 +1,74 @@
1
+ #! /usr/bin/env bash
2
+ #
3
+ # @file publish-docs.sh
4
+ # @athor Brandon Christie <brandon@distributive.network>
5
+ # @date Aug 2023
6
+ #
7
+ # @description Publishes the docs for each component
8
+ # to backstage.
9
+
10
+ set -euo pipefail
11
+
12
+ cd "$(dirname "$0")/.."
13
+
14
+ ROOT_DIR=$PWD
15
+
16
+ echo "TechDocs Bucket Name: $TECHDOCS_S3_BUCKET_NAME"
17
+ echo "Namespace: $ENTITY_NAMESPACE"
18
+
19
+ ENTITY_KIND=$(yq ".kind" < catalog-info.yaml)
20
+ echo "Kind: $ENTITY_KIND"
21
+
22
+ ENTITY_NAME=$(yq ".metadata.name" < catalog-info.yaml)
23
+ echo "Name: $ENTITY_NAME"
24
+
25
+ TECHDOCS_REF=$(yq ".metadata.annotations.\"backstage.io/techdocs-ref\"" < catalog-info.yaml)
26
+ echo "TechDocs Ref: $TECHDOCS_REF"
27
+
28
+ # An example of the the techdocs-ref in the YAML file:
29
+ # dir:./docs/dcp
30
+ #
31
+ # The Regex below will isolate the directory path giving the
32
+ # result 'docs/dcp' for the given example.
33
+ if [[ "$TECHDOCS_REF" =~ dir:\.(.*) ]]; then
34
+ RELATIVE_DOCS_DIR="${BASH_REMATCH[1]%%[[:space:]]*}"
35
+ DOCS_DIR="$ROOT_DIR/$RELATIVE_DOCS_DIR"
36
+ fi
37
+
38
+ # The techdocs-cli commands must be called in the directory where the
39
+ # mkdocs.yml file is present.
40
+ cd "$DOCS_DIR"
41
+
42
+ # MkDocs requires an index.md or README.md file, if one does not exist it will
43
+ # be generated automatically.
44
+ if ! [ -f index.md ] && ! [ -f README.md ]; then
45
+ if [ -z "$CI" ]; then
46
+ AUTHOR="$(git config user.name) <$(git config user.email)>"
47
+ else
48
+ AUTHOR="$CI_COMMIT_AUTHOR"
49
+ fi
50
+
51
+ echo "README.md or index.md was not found and will be automatically generated."
52
+ cat >> index.md <<EOF
53
+ <!--
54
+ @author $AUTHOR
55
+ @date $(date)
56
+ @machine $HOSTNAME
57
+ @rev $(git rev-parse HEAD)
58
+ -->
59
+ > **Warning**: MkDocs requires a top level index.md or README.md (case sensitive)
60
+ This index.md file has been generated automatically to ensure MkDocs works correctly
61
+ EOF
62
+ fi
63
+
64
+ npx techdocs-cli generate --no-docker --verbose
65
+
66
+ npx techdocs-cli publish \
67
+ --publisher-type awsS3 \
68
+ --storage-name "$TECHDOCS_S3_BUCKET_NAME" \
69
+ --entity "$ENTITY_NAMESPACE"/"$ENTITY_KIND"/"$ENTITY_NAME" \
70
+ --directory "$ROOT_DIR"/site
71
+
72
+ rm -r "$ROOT_DIR"/site
73
+
74
+ echo "View generated component: https://backstage.overwatch.distributive.network/docs/default/component/$ENTITY_NAME"
@@ -0,0 +1,21 @@
1
+ # @file catalog-info.yml
2
+ # @author Brandon Christie <brandon@distributive.network>
3
+ # @date Mar 2023
4
+ #
5
+ # @description Lists all of the components and the paths to all
6
+ # the documentation that will be published to backstage.
7
+
8
+ apiVersion: backstage.io/v1alpha1
9
+ kind: Component
10
+ metadata:
11
+ name: dcp-worker
12
+ description: Documentation for the dcp-worker.
13
+ tags:
14
+ - documentation
15
+ annotations:
16
+ gitlab.com/project-id: '18110002'
17
+ backstage.io/techdocs-ref: dir:./docs
18
+ spec:
19
+ type: website
20
+ lifecycle: production
21
+ owner: core
@@ -0,0 +1,16 @@
1
+ # @file mkdocs.yml
2
+ # @author Brandon Christie <brandon@distributive.network>
3
+ # @date Aug 2023
4
+ #
5
+ # @description Determines how the component of name: 'dcp-worker'
6
+ # is formatted on backstage.
7
+
8
+ site_name: dcp-worker
9
+ repo_url: https://gitlab.com/Distributed-Compute-Protocol/dcp-worker
10
+ edit_uri: edit/develop/docs
11
+ docs_dir: .
12
+ nav:
13
+ - README.md
14
+ plugins:
15
+ - techdocs-core
16
+ - same-dir
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcp-worker",
3
- "version": "3.2.30",
3
+ "version": "3.2.32",
4
4
  "description": "JavaScript portion of DCP Workers for Node.js",
5
5
  "main": "bin/dcp-worker",
6
6
  "keywords": [
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git+ssh://git@gitlab.com/Distributed-Compute-Protocol/dcp-worker.git"
15
+ "url": "git@github.com:Distributed-Compute-Labs/dcp-worker.git"
16
16
  },
17
17
  "license": "MIT",
18
18
  "author": "Kings Distributed Systems",
@@ -37,7 +37,7 @@
37
37
  "blessed": "^0.1.81",
38
38
  "blessed-contrib": "^4.11.0",
39
39
  "chalk": "^4.1.0",
40
- "dcp-client": "4.3.0-5",
40
+ "dcp-client": "4.3.2",
41
41
  "semver": "^7.3.8",
42
42
  "syslog-client": "1.1.1"
43
43
  },
@@ -46,6 +46,7 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@kingsds/eslint-config": "^1.0.1",
49
+ "@techdocs/cli": "1.4.6",
49
50
  "eslint": ">=8"
50
51
  },
51
52
  "peerDependencies": {