Commit 899ed83f authored by The Heavy's avatar The Heavy 🚂
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+5 −0
Original line number Diff line number Diff line
__pycache__
*.pyc
/.idea/
*.log
zuliprc

.gitlab-ci.yml

0 → 100644
+41 −0
Original line number Diff line number Diff line
image: docker
services:
  - docker:dind

stages:
  - build
  - release

variables:
  DOCKER_HOST: tcp://docker:2375
  DOCKER_TLS_CERTDIR: ""
  IMAGE_TAG_UNIQUE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
  IMAGE_TAG_BRANCH: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:latest

before_script:
  - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY

build:
  stage: build
  tags:
    - docker build
  image: docker
  services:
    - docker:dind
  script:
    - docker build --pull -t $IMAGE_TAG_UNIQUE -f Dockerfile $CI_PROJECT_DIR
    - docker push $IMAGE_TAG_UNIQUE
    - docker tag $IMAGE_TAG_UNIQUE $IMAGE_TAG_BRANCH
    - docker push $IMAGE_TAG_BRANCH

release:
  stage: release
  tags:
    - docker build
  script:
    - docker pull $IMAGE_TAG_UNIQUE
    - docker tag $IMAGE_TAG_UNIQUE $IMAGE_TAG_LATEST
    - docker push $IMAGE_TAG_LATEST
  only:
    - master

Dockerfile

0 → 100644
+7 −0
Original line number Diff line number Diff line
FROM registry.downbox.co.uk/zulipbots/zulipbotbase

WORKDIR /app

COPY *.py *.conf ./

CMD ["/bin/bash","-c","source /app/bin/activate && zulip-run-bot giphy.py --config-file /config/zuliprc --bot-config-file /config/giphy.conf"]

__init__.py

0 → 100644
+0 −0

Empty file added.

docker-compose.yml

0 → 100644
+8 −0
Original line number Diff line number Diff line
---
version: "2.1"
services:
  giphybot:
    image: registry.downbox.co.uk/zulipbots/giphybot
    volumes:
      - '/opt/docker/giphybot/config:/config'
    restart: "always"