diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b2a7aae --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,34 @@ +image: python:3 + +stages: + - generate + - deploy + +before_script: + - pip3 install -r requirements.txt + +generate: + stage: generate + script: + - make art + artifacts: + paths: + - output/ + only: + - master + +deploy: + stage: deploy + script: + - mkdir -p $HOME/.ssh + - chmod 700 $HOME/.ssh + - eval $(ssh-agent -s) + - echo "$GITLAB_DEPLOY" | tr -d '\r' > $HOME/.ssh/id_rsa + - chmod 700 $HOME/.ssh/id_rsa + - ssh-keyscan wozard-assets.vereto.net >> $HOME/.ssh/known_hosts + - chmod 644 $HOME/.ssh/known_hosts + - scp -r output/* + dependencies: + - generate + only: + - master \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..701fc2b --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: art + +art: + python3 main.py \ No newline at end of file diff --git a/main.py b/main.py index 7c9a4ea..5bdf9bf 100755 --- a/main.py +++ b/main.py @@ -68,6 +68,7 @@ def draw_mask(img, color): return img def save_img(img, color, symbol): + print('Created card {} {}'.format(color, symbol)) img.save(filename='output/card-{}-{}.png'.format(color, symbol)) main() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..fa404a0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Wand==0.6.5 \ No newline at end of file