@toa.io/operations 0.20.0-dev.10 → 0.20.0-dev.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/operations",
3
- "version": "0.20.0-dev.10",
3
+ "version": "0.20.0-dev.12",
4
4
  "description": "Toa Deployment",
5
5
  "homepage": "https://toa.io",
6
6
  "author": {
@@ -26,10 +26,10 @@
26
26
  "test": "echo \"Error: run tests from root\" && exit 1"
27
27
  },
28
28
  "dependencies": {
29
- "@toa.io/filesystem": "0.20.0-dev.10",
30
- "@toa.io/generic": "0.20.0-dev.10",
31
- "@toa.io/yaml": "0.20.0-dev.10",
29
+ "@toa.io/filesystem": "0.20.0-dev.12",
30
+ "@toa.io/generic": "0.20.0-dev.12",
31
+ "@toa.io/yaml": "0.20.0-dev.12",
32
32
  "execa": "5.1.1"
33
33
  },
34
- "gitHead": "cd3ffb1ae1af014f13a62ef9fc8ada58d8688e4a"
34
+ "gitHead": "2b41c30d83b0435a3f3b2dfd27ccbc6a950c36e5"
35
35
  }
package/readme.md CHANGED
@@ -11,8 +11,8 @@
11
11
 
12
12
  registry:
13
13
  build:
14
- arguments: [NPM_TOKEN]
15
- run: echo //npm.pkg.github.com/:_authToken=${NPM_TOKEN} > .npmrc
14
+ arguments: [GITHUB_TOKEN]
15
+ run: npm config set //npm.pkg.github.com/:_authToken ${GITHUB_TOKEN}
16
16
  ```
17
17
 
18
18
  `arguments` is a list of environemt varialbes to be passed to `docker build`.
@@ -28,3 +28,15 @@ registry:
28
28
  echo test > .test
29
29
  rm .test
30
30
  ```
31
+
32
+ #### Registry Credentials
33
+
34
+ When using private container registry,
35
+ a secret containing required credentials can be specified using `registry.credentials` option.
36
+
37
+ ```yaml
38
+ # context.toa.yaml
39
+
40
+ registry:
41
+ credentials: docker-credentials-secret-name
42
+ ```
@@ -14,6 +14,7 @@ const describe = (context, compositions, dependency) => {
14
14
  const components = get.components(compositions)
15
15
  const dependencies = get.dependencies(references)
16
16
  const variables = get.variables(context, dependency.variables)
17
+ const credentials = context.registry.credentials
17
18
 
18
19
  return {
19
20
  compositions,
@@ -21,6 +22,7 @@ const describe = (context, compositions, dependency) => {
21
22
  services,
22
23
  proxies,
23
24
  variables,
25
+ credentials,
24
26
  ...dependencies
25
27
  }
26
28
  }
@@ -34,5 +34,9 @@ spec:
34
34
  {{- include "env.var" . | indent 12 }}
35
35
  {{- end }}
36
36
  {{- end }}
37
+ {{- if $.Values.credentials }}
38
+ imagePullSecrets:
39
+ - name: {{ $.Values.credentials }}
40
+ {{- end }}
37
41
  ---
38
42
  {{- end }}
@@ -45,3 +45,4 @@ proxies:
45
45
  - name: storage-proxy
46
46
  target: host.docker.internal
47
47
  environment: development
48
+ credentials: docker-credentials
@@ -3,8 +3,8 @@ FROM node:18.16.0-alpine3.17
3
3
  {{build.arguments}}
4
4
 
5
5
  ENV NODE_ENV=production
6
- RUN if [ {{runtime.registry}} != undefined ]; then npm set registry {{runtime.registry}}; fi
7
- RUN if [ {{runtime.proxy}} != undefined ]; then npm set proxy {{runtime.proxy}}; fi
6
+ RUN if [ "{{runtime.registry}}" != "" ]; then npm set registry {{runtime.registry}}; fi
7
+ RUN if [ "{{runtime.proxy}}" != "" ]; then npm set proxy {{runtime.proxy}}; fi
8
8
  RUN npm i -g @toa.io/runtime@{{runtime.version}} --omit=dev
9
9
 
10
10
  WORKDIR /composition
@@ -1,8 +1,8 @@
1
1
  FROM node:18.16.0-alpine3.17
2
2
 
3
3
  ENV NODE_ENV=production
4
- RUN if [ {{runtime.registry}} != undefined ]; then npm set registry {{runtime.registry}}; fi
5
- RUN if [ {{runtime.proxy}} != undefined ]; then npm set proxy {{runtime.proxy}}; fi
4
+ RUN if [ "{{runtime.registry}}" != "" ]; then npm set registry {{runtime.registry}}; fi
5
+ RUN if [ "{{runtime.proxy}}" != "" ]; then npm set proxy {{runtime.proxy}}; fi
6
6
  RUN npm i -g @toa.io/runtime@{{runtime.version}} --omit=dev
7
7
 
8
8
  WORKDIR /service