Skip to content

Commit c71cff5

Browse files
committed
node22 and create docker image
1 parent 0730646 commit c71cff5

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
**/**
1+
**/**
2+
!dist/*
3+
!readme.md

Dockerfile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
ARG NODE_VERSION=""
2-
FROM node:${NODE_VERSION:-8.2.1-alpine}
3-
4-
ENV GTT_VERSION=$GTT_VERSION
5-
ENV EDITOR vi
1+
FROM node:22.16.0-alpine3.21
62

7-
8-
RUN apk update && \
9-
apk add git && \
10-
addgroup -S gtt && adduser -S gtt -G gtt && \
11-
yarn global add --prefix /usr/local "gitlab-time-tracker${GTT_VERSION}"
3+
RUN addgroup -S gtt && adduser -S gtt -G gtt
124
USER gtt
135
WORKDIR /home/gtt
14-
6+
COPY dist/gtt.cjs /home/gtt/gtt.cjs
157
VOLUME ["/home/gtt"]
16-
ENTRYPOINT ["gtt"]
8+
ENTRYPOINT ["node", "gtt.cjs"]
179
CMD ["--help"]

documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## requirements
2424

25-
* [node.js](https://nodejs.org/en/download) version >= 20
25+
* [node.js](https://nodejs.org/en/download) version >= 22
2626
* [npm](https://github.com/npm/npm) or [yarn](https://yarnpkg.com/en/docs/install)
2727

2828
## installation

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitlab-time-tracker",
3-
"version": "1.8.0",
3+
"version": "1.8.0-snapshot",
44
"type": "module",
55
"description": "A command line interface for GitLabs time tracking feature.",
66
"bugs": {
@@ -12,23 +12,25 @@
1212
},
1313
"main": "src/gtt.js",
1414
"scripts": {
15+
"prebuild": "echo \"let version = '${npm_package_version}'; export default version;\" > src/version.js",
1516
"test": "NODE_ENV=test mocha 'spec/**/*.spec.js'",
1617
"esbuild": "esbuild 'src/gtt.js' --format=cjs --target=node20 --platform=node --bundle --outfile=dist/gtt.cjs --inject:./src/polyfill/import-meta-url.js --define:import.meta.url=import_meta_url",
1718
"pkg": "pkg dist/gtt.cjs -o out/gtt -c package.json",
18-
"build": "npm run-script test && npm run-script esbuild && npm run-script pkg"
19+
"docker": "docker build . -t gtt:${npm_package_version} -t gtt:latest",
20+
"buildAll": "npm run-script prebuild && npm run-script test && npm run-script esbuild && npm run-script pkg && npm run-script docker"
1921
},
2022
"bin": {
2123
"gtt": "dist/gtt.cjs"
2224
},
2325
"engines": {
24-
"node": ">=20"
26+
"node": ">=22"
2527
},
2628
"pkg": {
2729
"scripts": "dist/gtt.cjs",
2830
"targets": [
29-
"node20-linux-x64",
30-
"node20-macos-x64",
31-
"node20-win-x64"
31+
"node22-linux-x64",
32+
"node22-macos-x64",
33+
"node22-win-x64"
3234
]
3335
},
3436
"author": "kriskbx",

src/gtt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
let version = "1.8.0";
3+
import version from './version.js';
44

55
import { program } from 'commander';
66

src/version.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let version = '1.8.0-snapshot'; export default version;

0 commit comments

Comments
 (0)