@candlerip/shared-devops 0.0.33 → 0.0.42

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.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ set -e
3
+
4
+ cdk deploy --require-approval never
@@ -1,5 +1,7 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env sh
2
+
3
+ DOCKERFILE=${2:-"Dockerfile"}
2
4
 
3
5
  echo "$DOCKER_ACCESS_TOKEN" | docker login -u $DOCKER_USERNAME --password-stdin
4
- docker build -t reveszimre/$1 --build-arg NODE_ENV=production .
6
+ docker build -f $DOCKERFILE -t reveszimre/$1 .
5
7
  docker push reveszimre/$1
@@ -1,29 +1,18 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env sh
2
2
  set -e
3
3
 
4
- ARRAY=(${1//,/ })
5
-
6
- NAMES_ARRAY[0]="${ARRAY[@]:0:10}"
7
- NAMES_ARRAY[1]="${ARRAY[@]:10:20}"
8
- NAMES_ARRAY[2]="${ARRAY[@]:20:30}"
4
+ PARAM_NAMES=(${1//,/ })
9
5
 
10
6
  ENVS=()
11
- for NAMES in "${NAMES_ARRAY[@]}"
12
- do
13
- if [ -n "$NAMES" ]; then
14
- PARAMS=$(aws ssm get-parameters --names $NAMES --output text --query "Parameters[*].{Name:Name,Value:Value}" --with-decryption | sed -E 's/\s+/=/g')
15
- PARAMS1="${PARAMS[@]//_DEVELOPMENT/}"
16
- PARAMS2="${PARAMS1[@]//_PRODUCTION/}"
17
- PARAMS3="${PARAMS2[@]//AMAZONWEBSERVICES/AWS}"
18
- ENVS+=("$PARAMS3")
19
- fi
20
- done
7
+ for ((i=0; i<${#PARAM_NAMES[@]}; i+=10)); do
8
+ chunk=("${PARAM_NAMES[@]:i:10}")
9
+
10
+ PARAMS=$(aws ssm get-parameters --names "${chunk[@]}" --output text --query "Parameters[*].{Name:Name,Value:Value}" --with-decryption | sed -E 's/\s+/=/g')
21
11
 
22
- if [[ $2 ]]
23
- then
24
- FILENAME=".env.$2"
25
- else
26
- FILENAME=".env"
27
- fi
12
+ PARAMS1="${PARAMS[@]//_DEVELOPMENT/}"
13
+ PARAMS2="${PARAMS1[@]//_PRODUCTION/}"
14
+ PARAMS3="${PARAMS2[@]//AMAZONWEBSERVICES/AWS}"
15
+ ENVS+=("$PARAMS3")
16
+ done
28
17
 
29
- printf "%s\n" "${ENVS[@]}" > $FILENAME
18
+ printf "%s\n" "${ENVS[@]}" > $2
@@ -7,7 +7,7 @@ export default (projectConfig) =>
7
7
  js.configs.recommended,
8
8
  ...ts.configs.recommended,
9
9
  {
10
- ignores: [".next", "dist", "temp"],
10
+ ignores: [".next", "cdk.out", "dist", "temp"],
11
11
  },
12
12
  {
13
13
  languageOptions: {
@@ -22,5 +22,5 @@ export default (projectConfig) =>
22
22
  "no-console": [2, { allow: ["error", "info"] }],
23
23
  },
24
24
  },
25
- ...(projectConfig ?? [])
25
+ ...(projectConfig ?? []),
26
26
  );
package/eslint/eslint.sh CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/bash
1
+ #!/usr/bin/env sh
2
2
  set -e
3
3
 
4
4
  npx eslint .
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env sh
2
+ set -e
3
+
4
+ npm config set //registry.npmjs.org/:_authToken $NPM_ACCESS_TOKEN
5
+
6
+ npm publish $1 --access public
package/package.json CHANGED
@@ -1,17 +1,14 @@
1
1
  {
2
2
  "name": "@candlerip/shared-devops",
3
- "version": "0.0.33",
4
- "type": "module",
3
+ "version": "0.0.42",
5
4
  "bin": {
6
- "crsd-create-env-file": "./environment/create-env-file.sh",
7
- "crsd-build-publish-to-docker-hub": "./docker/build-publish-to-docker-hub.sh",
8
- "crsd-eslint": "./eslint/eslint.sh",
9
- "crsd-prettier": "./prettier/prettier.sh",
10
- "crsd-publish-to-npm": "./npm/publish-to-npm.sh",
11
- "crsd-tsc-build": "./typescript/tsc-build.sh",
12
- "crsd-tsc-watch": "./typescript/tsc-watch.sh"
13
- },
14
- "scripts": {
15
- "publish-gitlab-image": "sh ./gitlab/publish-gitlab-image.sh"
5
+ "crs-cdk-deploy": "devops/cdk/cdk-deploy.sh",
6
+ "crs-create-env-file": "devops/environment/create-env-file.sh",
7
+ "crs-publish-to-docker-hub": "./devops/docker/publish-to-docker-hub.sh",
8
+ "crs-eslint": "devops/eslint/eslint.sh",
9
+ "crs-publish-to-npm-registry": "devops/npm/publish-to-npm-registry.sh",
10
+ "crs-prettier": "devops/prettier/prettier.sh",
11
+ "crs-tsc-build": "devops/typescript/tsc-build.sh",
12
+ "crs-tsc-watch": "devops/typescript/tsc-watch.sh"
16
13
  }
17
14
  }
@@ -3,5 +3,5 @@ export default {
3
3
  printWidth: 150,
4
4
  singleQuote: true,
5
5
  tabWidth: 2,
6
- trailingComma: 'all',
6
+ trailingComma: "all",
7
7
  };
@@ -1,4 +1,4 @@
1
- #!/usr/bin/bash
1
+ #!/usr/bin/env sh
2
2
  set -e
3
3
 
4
4
  npx prettier . --write
@@ -1,4 +1,4 @@
1
- #!/bin/sh
1
+ #!/usr/bin/env sh
2
2
  set -e
3
3
 
4
4
  rm -rf dist
@@ -1,4 +1,4 @@
1
- #!/bin/sh
1
+ #!/usr/bin/env sh
2
2
  set -e
3
3
 
4
4
  rm -rf dist
@@ -4,6 +4,8 @@
4
4
  "esModuleInterop": true,
5
5
  "module": "ES2022",
6
6
  "moduleResolution": "bundler",
7
+ "outDir": "${configDir}/dist",
8
+ "rootDir": "${configDir}/src",
7
9
  "skipLibCheck": true,
8
10
  "strict": true,
9
11
  "target": "ES2022"
@@ -12,4 +14,4 @@
12
14
  "verbose": false,
13
15
  "resolveFullPaths": true
14
16
  }
15
- }
17
+ }
@@ -1,5 +0,0 @@
1
- FROM registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
2
- WORKDIR /usr/src/app
3
-
4
- RUN apt-get update
5
- RUN apt-get install git npm -y
@@ -1,5 +0,0 @@
1
- FROM docker:20.10.16
2
- WORKDIR /usr/src/app
3
-
4
- RUN apk update
5
- RUN apk add bash git npm
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- CONTAINER_NAME=reveszimre/gitlab-$1
4
-
5
- docker build -f $(dirname "$0")/Dockerfile.$1 -t $CONTAINER_NAME .
6
- docker push $CONTAINER_NAME
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- npm config set //registry.npmjs.org/:_authToken ${NPM_ACCESS_TOKEN}
5
-
6
- npm publish $1 --access=public