chore(gitlab-ci): ...

This commit is contained in:
Gregor Kleen 2021-09-17 21:51:49 +02:00
parent 80625f5ef7
commit 74490ce7ac
2 changed files with 18 additions and 17 deletions

View File

@ -21,7 +21,7 @@ node dependencies:
stage: frontend:build stage: frontend:build
script: script:
- nix -L build -o result .#uniworxNodeDependencies - nix -L build -o result .#uniworxNodeDependencies
- nix-store --export $(nix-store -qR result) > node-dependencies.nar - nix-store --export $(nix-store -qR result) | xz > node-dependencies.nar.xz
before_script: &nix-before before_script: &nix-before
- mkdir -p /etc/nix - mkdir -p /etc/nix
- install -m 0644 .gitlab-ci/nix-bootstrap.conf /etc/nix/nix.conf - install -m 0644 .gitlab-ci/nix-bootstrap.conf /etc/nix/nix.conf
@ -36,7 +36,7 @@ node dependencies:
- install -v -T -m 0644 "${FONTAWESOME_NPM_AUTH_FILE}" /etc/fontawesome-token - install -v -T -m 0644 "${FONTAWESOME_NPM_AUTH_FILE}" /etc/fontawesome-token
artifacts: artifacts:
paths: paths:
- node-dependencies.nar - node-dependencies.nar.xz
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
expire_in: "1 day" expire_in: "1 day"
retry: 2 retry: 2
@ -45,16 +45,16 @@ node dependencies:
well known: well known:
stage: frontend:build stage: frontend:build
script: script:
- nix-store --import <node-dependencies.nar - xzcat node-dependencies.nar.xz | nix-store --import
- nix -L build -o result .#uniworxWellKnown - nix -L build -o result .#uniworxWellKnown
- nix-store --export $(nix-store -qR result) > well-known.nar - nix-store --export $(nix-store -qR result) | xz > well-known.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
- job: node dependencies - job: node dependencies
artifacts: true artifacts: true
artifacts: artifacts:
paths: paths:
- well-known.nar - well-known.nar.xz
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
expire_in: "1 day" expire_in: "1 day"
retry: 2 retry: 2
@ -63,10 +63,10 @@ well known:
frontend: frontend:
stage: frontend:build stage: frontend:build
script: script:
- nix-store --import <node-dependencies.nar - xzcat node-dependencies.nar.xz | nix-store --import
- nix-store --import <well-known.nar - xzcat well-known.nar.xz | nix-store --import
- nix -L build -o result .#uniworxFrontend - nix -L build -o result .#uniworxFrontend
- nix-store --export $(nix-store -qR result) > frontend.nar - nix-store --export $(nix-store -qR result) | xz > frontend.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
- job: node dependencies - job: node dependencies
@ -75,7 +75,7 @@ frontend:
artifacts: true artifacts: true
artifacts: artifacts:
paths: paths:
- frontend.nar - frontend.nar.xz
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
expire_in: "1 day" expire_in: "1 day"
retry: 2 retry: 2
@ -84,18 +84,17 @@ frontend:
backend: backend:
stage: backend:build stage: backend:build
script: script:
- nix-store --import <frontend.nar - xzcat frontend.nar.xz | nix-store --import
- nix -L build -o result .#uniworxBackend - nix -L build -o result .#uniworxBackend
- cp -pr --reflink=auto -L result/bin . - cp -pr --reflink=auto -L result/bin .
- nix-store --export $(nix-store -qR result) > backend.nar - nix-store --export $(nix-store -qR result) | xz > backend.nar.xz
before_script: *nix-before before_script: *nix-before
needs: needs:
- job: frontend - job: frontend
artifacts: true artifacts: true
artifacts: artifacts:
paths: paths:
- bin/ - backend.nar.xz
- backend.nar
name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}" name: "${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}"
expire_in: "1 day" expire_in: "1 day"
retry: 2 retry: 2
@ -104,7 +103,7 @@ backend:
demo docker: demo docker:
stage: docker:build stage: docker:build
script: script:
- nix-store --import <backend.nar - xzcat backend.nar.xz | nix-store --import
- nix -L build -o result .#uniworxDemoDocker - nix -L build -o result .#uniworxDemoDocker
- cp -pr --reflink=auto -L result uniworx-demo.tar.gz - cp -pr --reflink=auto -L result uniworx-demo.tar.gz
before_script: *nix-before before_script: *nix-before
@ -122,7 +121,7 @@ demo docker:
docker: docker:
stage: docker:build stage: docker:build
script: script:
- nix-store --import <backend.nar - xzcat backend.nar.xz | nix-store --import
- nix -L build -o result .#uniworxDocker - nix -L build -o result .#uniworxDocker
- cp -pr --reflink=auto -L result uniworx.tar.gz - cp -pr --reflink=auto -L result uniworx.tar.gz
before_script: *nix-before before_script: *nix-before

View File

@ -131,8 +131,10 @@ in
tag = fromImage.imageTag; tag = fromImage.imageTag;
fromImage = prev.docker-nixpkgs.nix-unstable; fromImage = prev.docker-nixpkgs.nix-unstable;
contents = [ contents = with final; [
final.bash final.coreutils final.minio-client bash coreutils
minio-client
xz
]; ];
}; };
} // mapAttrs (_name: mkUniworxDocker) { } // mapAttrs (_name: mkUniworxDocker) {