Commit 63f0fae2 authored by TheLD's avatar TheLD
Browse files

fix ci

parent 2f8083af
Pipeline #1386 passed with stages
in 11 minutes and 28 seconds
*
!/bundle
\ No newline at end of file
......@@ -2,7 +2,7 @@ node_modules/
.bundle
*.tar.gz
yarn-error.log
package-lock.json
#package-lock.json
.typescript-cache
.idea
npm-debug.log
......
stages:
- compile
- image
- deploy
include:
- project: docker/ci-templates
file: /typical-meteor-loadout.yml
meteor-build:
image:
name: homebase.adornis.de:5000/adornis-runtime:latest
entrypoint:
- su
- coder
stage: compile
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
- nvm install 12.16.1
- nvm use 12.16.1
- npm i
- meteor add-platform android || echo "Mobile platform already present"
- meteor build ./ --server-only --architecture os.linux.x86_64 --directory
artifacts:
paths:
- bundle/
expire_in: 1 days
build-dev:
image: docker:latest
stage: image
variables:
IMAGE: '$REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA'
before_script:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" $REGISTRY
script:
- docker build --pull -t "$IMAGE" .
- docker tag "$IMAGE" "$REGISTRY_IMAGE:latest"
- docker push "$IMAGE"
- docker push "$REGISTRY_IMAGE:latest"
- docker rmi "$IMAGE"
- docker rmi "$REGISTRY_IMAGE:latest"
- apk add curl
- 'curl -d ''{ "content": "Image ''"$IMAGE"'' has been pushed to the registry." }'' -H "Content-Type: application/json" -X POST https://discordapp.com/api/webhooks/608331442308775950/jSryOokyvp7YGHLebkEBJb13CvS-b6VbeySKC8-_f_JKkd1DkaziH_j4gvaJ0fuI4-xv'
dependencies:
- meteor-build
deploy-ccb-customer:
image: docker:latest
stage: deploy
variables:
IMAGE: '$REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA'
DEPLOY_NAME: ccb-customer-production
DEPLOY_VOLUME: ccb-customer-production
before_script:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD" $REGISTRY
script:
- docker pull "$IMAGE"
- 'if docker volume inspect "$DEPLOY_VOLUME" -f ''{{.Name}}''; then echo "Volume $DEPLOY_VOLUME exists."; else docker volume create "$DEPLOY_VOLUME"; fi'
- 'if docker container inspect "$DEPLOY_NAME" -f ''{{.Name}}''; then docker stop "$DEPLOY_NAME"; docker rm "$DEPLOY_NAME"; else echo "Container $DEPLOY_NAME does not exist, skipping deletion."; fi'
- 'docker create --name "$DEPLOY_NAME" --network ingress -v "$DEPLOY_VOLUME":/datadir --env-file deploy/env-ccb-customer.list "$IMAGE"'
- docker network connect production-mongo "$DEPLOY_NAME"
- docker start "$DEPLOY_NAME"
- apk add curl
- 'curl -d ''{ "content": "Image ''"$IMAGE"'' deployed to adornis-root." }'' -H "Content-Type: application/json" -X POST https://discordapp.com/api/webhooks/608331442308775950/jSryOokyvp7YGHLebkEBJb13CvS-b6VbeySKC8-_f_JKkd1DkaziH_j4gvaJ0fuI4-xv'
dependencies: []
when: manual
variables:
NODE_VERSION: '12.16.1'
DEPLOY_NAME: coronalegalchatbot-production
DEPLOY_VOLUME: coronalegalchatbot-production
TARGET: adornis-root
ENV_FILE: deploy/env.list
DOCKER_NETWORK: ingress
SECONDARY_DOCKER_NETWORK: production-mongo
FROM node:12.16.1
ARG NODE_VERSION
FROM node:${NODE_VERSION}
ENV PORT=3000
ENV MONGO_URL="mongodb://mongo:27017/coronachatbot"
ENV DATADIR="/datadir"
COPY bundle /bundle
# RUN apt-get update && apt-get install -y --no-install-recommends wget && rm -rf /var/lib/apt/lists/*
USER node
COPY --chown=node:node bundle /bundle
WORKDIR /bundle/programs/server
RUN npm i
WORKDIR /bundle
EXPOSE 3000
VOLUME [ "/datadir" ]
USER root
ENTRYPOINT [ "node", "main.js" ]
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment