Commit 67ed9f84 authored by Racct's avatar Racct
Browse files

feat: gitlab ci (hopefully working)

parent 889bb656
Pipeline #1366 passed with stages
in 9 minutes and 13 seconds
stages:
- compile
- image
- deploy
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
FROM node:12.16.1
ENV PORT=3000
ENV MONGO_URL="mongodb://mongo:27017/coronachatbot"
ENV DATADIR="/datadir"
COPY bundle /bundle
WORKDIR /bundle/programs/server
RUN npm i
WORKDIR /bundle
EXPOSE 3000
VOLUME [ "/datadir" ]
ENTRYPOINT [ "node", "main.js" ]
MONGO_URL=mongodb://production_mongo:27017/coronachatbot
ROOT_URL=https://ccb.customer.adornis.de/
PORT=3000
DATADIR=/datadir
......@@ -143,6 +143,20 @@ export class CCBContentsAdmin extends AdornisDBView<Content> {
}
protected csvUploadButton() {
return html``;
return html`
<ccb-button
horizontal
centerjustified
centeraligned
class="${this.css({
cursor: 'pointer',
borderStyle: 'solid',
borderColor: 'green',
borderRadius: '24px',
})}"
href="https://t.me/coronalegalchatbot"
>Los gehts!</ccb-button
>
`;
}
}
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