nuxi-docker 0.0.6 → 0.0.10

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.
@@ -1,13 +1,22 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
1
 
4
2
  name: Node.js Package
5
3
 
6
4
  on:
7
- release:
8
- types: [created]
5
+ push:
6
+ tags:
7
+ - "v*"
9
8
 
10
9
  jobs:
10
+ tagged-release:
11
+ permissions: write-all
12
+ runs-on: "ubuntu-latest"
13
+
14
+ steps:
15
+ - uses: "marvinpinto/action-automatic-releases@latest"
16
+ with:
17
+ repo_token: "${{ secrets.GITHUB_TOKEN }}"
18
+ prerelease: false
19
+
11
20
  build:
12
21
  runs-on: ubuntu-latest
13
22
  steps:
@@ -17,7 +26,7 @@ jobs:
17
26
  node-version: 16
18
27
 
19
28
  publish-npm:
20
- needs: build
29
+ needs: [tagged-release, build]
21
30
  runs-on: ubuntu-latest
22
31
  steps:
23
32
  - uses: actions/checkout@v3
package/bin/index.mjs CHANGED
@@ -162,7 +162,7 @@ if (process.argv[2] === "init") {
162
162
 
163
163
  try {
164
164
  execSync(
165
- `${env_variables.join(" ")} ${BASE_ARGS.join(" ")} run nuxt-app-init`,
165
+ `${env_variables.join(" ")} ${BASE_ARGS.join(" ")} run --rm --build nuxt-app-init`,
166
166
  { stdio: "inherit" }
167
167
  );
168
168
  } catch (err) {
package/docker/Dockerfile CHANGED
@@ -3,11 +3,11 @@ FROM node:20-bullseye-slim
3
3
  ARG DOCKER_USER_UID
4
4
  ARG DOCKER_USER_GID
5
5
 
6
- COPY change_gid.sh /usr/local/bin/
6
+ COPY free_gid.sh /usr/local/bin/
7
7
 
8
- # If the GID is in use, reassign it with a terrifying script
9
- RUN chmod +x /usr/local/bin/change_gid.sh \
10
- && /usr/local/bin/change_gid.sh "$DOCKER_USER_GID"
8
+ # If the GID is in use, free it up with a script
9
+ RUN chmod +x /usr/local/bin/free_gid.sh \
10
+ && /usr/local/bin/free_gid.sh "$DOCKER_USER_GID"
11
11
 
12
12
  RUN groupmod -g $DOCKER_USER_GID node \
13
13
  && usermod -u $DOCKER_USER_UID -g $DOCKER_USER_GID node
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+
3
+ DOCKER_USER_GID="$1"
4
+ EXISTING_GROUP=$(getent group "$DOCKER_USER_GID")
5
+
6
+ if [ -n "$EXISTING_GROUP" ] && [ "$(echo "$EXISTING_GROUP" | cut -d: -f1)" != "node" ]; then
7
+ NEW_GID=1000
8
+ while getent group "$NEW_GID" >/dev/null; do
9
+ ((NEW_GID++))
10
+ done
11
+
12
+ groupmod -g "$NEW_GID" "$(echo "$EXISTING_GROUP" | cut -d: -f1)"
13
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxi-docker",
3
- "version": "0.0.6",
3
+ "version": "0.0.10",
4
4
  "description": "A preconfigured docker environment and cli tool for managing Nuxt.js projects",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,9 +0,0 @@
1
- #!/bin/bash
2
-
3
- DOCKER_USER_GID="$1"
4
- EXISTING_GROUP=$(getent group "$DOCKER_USER_GID")
5
-
6
- if [ -n "$EXISTING_GROUP" ]; then
7
- NEW_GID=$(getent group | cut -d: -f3 | grep -E "^1[0-9]{3}$" | sort -n | tail -n 1 | awk '{ print $1+1 }')
8
- groupmod -g "$NEW_GID" "$(echo "$EXISTING_GROUP" | cut -d: -f1)"
9
- fi