Commit 48b6e955 authored by Grant's avatar Grant
Browse files

fix docker image versioning

parent aea42937
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,5 +29,5 @@ build image:
  before_script:
    - echo $CI_REGISTRY_PASSWORD | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
  script:
    - docker build --tag $CI_REGISTRY_IMAGE .
    - docker build --tag $CI_REGISTRY_IMAGE --build-arg VERSION=$(git rev-parse HEAD) .
    - docker push $CI_REGISTRY_IMAGE
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ ENV NODE_ENV=production
# RUN bun test
RUN bunx prisma generate
RUN bun run dev:api-ts
ARG VERSION
RUN bun run build

# copy production dependencies and source code into final image
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
  },
  "scripts": {
    "dev": "bun run --define process.env.VERSION=\"'$(git rev-parse HEAD)'\" --hot src/index.ts",
    "build": "bun build src/index.ts --outdir ./dist --target=bun --sourcemap=inline --minify --packages=external --define process.env.VERSION=\"'$(git rev-parse HEAD)'\"",
    "build": "bun build src/index.ts --outdir ./dist --target=bun --sourcemap=inline --minify --packages=external --define process.env.VERSION=\"'$(if [ -v VERSION ]; then echo \"$VERSION\"; else git rev-parse HEAD; fi)'\"",
    "bundle:api-doc": "redocly bundle openapi/spec.yml -o openapi/openapi.yaml && sed -i '1s/^/# AUTOGENERATED FILE\\n# Run bun run bundle:api-doc\\n/' openapi/openapi.yaml",
    "build:api-doc": "redocly build-docs openapi/spec.yml -o public/index.html --title \"Fediverse Events API\"",
    "dev:api-doc": "redocly preview-docs openapi/spec.yml",