Add ci/cd
This commit is contained in:
parent
eb29352b07
commit
8bcf3812a5
4 changed files with 40 additions and 0 deletions
34
.gitlab-ci.yml
Normal file
34
.gitlab-ci.yml
Normal file
|
|
@ -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
|
||||
4
Makefile
Normal file
4
Makefile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
.PHONY: art
|
||||
|
||||
art:
|
||||
python3 main.py
|
||||
1
main.py
1
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()
|
||||
|
|
|
|||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
Wand==0.6.5
|
||||
Loading…
Add table
Reference in a new issue