@ossy/deployment-tools 0.0.1 → 0.0.4

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/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # deployment-tools
2
2
 
3
- Collection of scripts and tools to aid deployment of containers and static files
3
+ Command line toolkit to aid deployment of containers and static files
4
4
 
5
5
  ## Getting started
6
6
 
7
- Make sure Docker and Caddy is up and running
7
+ Make sure NodeJs and npm is installed and Docker and Caddy is up and running
8
8
  ```
9
9
  npx @ossy-se/deployment-tools start
10
10
  npx @ossy-se/deployment-tools deploy --ossyfile ./ossy.js
package/dist/index.js CHANGED
@@ -28584,7 +28584,7 @@ class DockerClient {
28584
28584
 
28585
28585
  constructor() {
28586
28586
  this.networkName = 'deployment-tools'
28587
- ;(0,external_child_process_namespaceObject.exec)(`docker network create ${this.networkName}`)
28587
+ ;(0,external_child_process_namespaceObject.exec)(`sudo docker network create ${this.networkName}`)
28588
28588
  }
28589
28589
 
28590
28590
  stopContainer({ image }) {
@@ -28735,9 +28735,6 @@ class ContainerManagerServer {
28735
28735
 
28736
28736
 
28737
28737
 
28738
- const username = 'oskarssylwan'
28739
- const authentication = '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'
28740
-
28741
28738
  class ContainerManagerCommands {
28742
28739
 
28743
28740
  static deploy(
@@ -28797,7 +28794,10 @@ class ContainerManagerCommands {
28797
28794
  }
28798
28795
  }
28799
28796
 
28797
+ //eslint-disable-next-line max-params
28800
28798
  deploy(
28799
+ username,
28800
+ authentication,
28801
28801
  targetEnvironment = 'local-dev',
28802
28802
  pathToDeploymentPlatforms,
28803
28803
  pathToOssyFile
@@ -28876,8 +28876,7 @@ After=network.target
28876
28876
  [Service]
28877
28877
  Environment=DEPLOYMENT_TOOLS_PORT=3000
28878
28878
  User=root
28879
- WorkingDirectory=/%h/deployment-tools
28880
- ExecStart=/usr/bin/node /%h/deployment-tools/index.js start-container-manager
28879
+ ExecStart=npx @ossy/deployment-tools start-container-manager
28881
28880
  Restart=on-failure
28882
28881
 
28883
28882
  [Install]
@@ -28908,6 +28907,12 @@ const deployHandler = () => {
28908
28907
  console.log('Running deploy command')
28909
28908
 
28910
28909
  const args = arg({
28910
+ '--username': String,
28911
+ '-u': '--username',
28912
+
28913
+ '--authentication': String,
28914
+ '--p': '--authentication',
28915
+
28911
28916
  '--target-env': String,
28912
28917
  '-t': '--target-env',
28913
28918
 
@@ -28921,6 +28926,8 @@ const deployHandler = () => {
28921
28926
  console.log('args', args)
28922
28927
 
28923
28928
  ContainerManagerCommands.deploy(
28929
+ args['--username'],
28930
+ args['--authentication'],
28924
28931
  args['--target-env'],
28925
28932
  args['--platforms'],
28926
28933
  args['--ossyfile']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/deployment-tools",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "description": "Collection of scripts and tools to aid deployment of containers and static files",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -2,9 +2,6 @@ import { resolve } from 'path'
2
2
  import { readFileSync } from 'fs'
3
3
  import fetch from 'node-fetch'
4
4
 
5
- const username = 'oskarssylwan'
6
- const authentication = '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'
7
-
8
5
  export class ContainerManagerCommands {
9
6
 
10
7
  static deploy(
@@ -64,7 +61,10 @@ export class ContainerManagerCommands {
64
61
  }
65
62
  }
66
63
 
64
+ //eslint-disable-next-line max-params
67
65
  deploy(
66
+ username,
67
+ authentication,
68
68
  targetEnvironment = 'local-dev',
69
69
  pathToDeploymentPlatforms,
70
70
  pathToOssyFile
@@ -11,7 +11,7 @@ class DockerClient {
11
11
 
12
12
  constructor() {
13
13
  this.networkName = 'deployment-tools'
14
- exec(`docker network create ${this.networkName}`)
14
+ exec(`sudo docker network create ${this.networkName}`)
15
15
  }
16
16
 
17
17
  stopContainer({ image }) {
package/src/index.js CHANGED
@@ -28,8 +28,7 @@ After=network.target
28
28
  [Service]
29
29
  Environment=DEPLOYMENT_TOOLS_PORT=3000
30
30
  User=root
31
- WorkingDirectory=/%h/deployment-tools
32
- ExecStart=/usr/bin/node /%h/deployment-tools/index.js start-container-manager
31
+ ExecStart=npx @ossy/deployment-tools start-container-manager
33
32
  Restart=on-failure
34
33
 
35
34
  [Install]
@@ -60,6 +59,12 @@ const deployHandler = () => {
60
59
  console.log('Running deploy command')
61
60
 
62
61
  const args = arg({
62
+ '--username': String,
63
+ '-u': '--username',
64
+
65
+ '--authentication': String,
66
+ '--p': '--authentication',
67
+
63
68
  '--target-env': String,
64
69
  '-t': '--target-env',
65
70
 
@@ -73,6 +78,8 @@ const deployHandler = () => {
73
78
  console.log('args', args)
74
79
 
75
80
  ContainerManagerCommands.deploy(
81
+ args['--username'],
82
+ args['--authentication'],
76
83
  args['--target-env'],
77
84
  args['--platforms'],
78
85
  args['--ossyfile']