reworked writing env
This commit is contained in:
parent
c8e3b09588
commit
df2860b658
12
Makefile
12
Makefile
@ -2,7 +2,7 @@ PY?=/usr/bin/python3
|
|||||||
PELICAN?=pelican
|
PELICAN?=pelican
|
||||||
PELICANOPTS=
|
PELICANOPTS=
|
||||||
|
|
||||||
BASEDIR=$(CURDIR)
|
BASEDIR=/blog
|
||||||
INPUTDIR=$(BASEDIR)/content
|
INPUTDIR=$(BASEDIR)/content
|
||||||
OUTPUTDIR=$(BASEDIR)/output
|
OUTPUTDIR=$(BASEDIR)/output
|
||||||
CONFFILE=$(BASEDIR)/pelicanconf.py
|
CONFFILE=$(BASEDIR)/pelicanconf.py
|
||||||
@ -33,6 +33,8 @@ ifeq ($(DEBUG), 1)
|
|||||||
PELICANOPTS += -D
|
PELICANOPTS += -D
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
DOCKER_COMPOSE_CMD=docker-compose run --rm blog
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo 'Makefile for a pelican Web site '
|
@echo 'Makefile for a pelican Web site '
|
||||||
@echo ' '
|
@echo ' '
|
||||||
@ -91,7 +93,7 @@ stopserver:
|
|||||||
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
|
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
|
$(DOCKER_COMPOSE_CMD) $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
|
||||||
|
|
||||||
ssh_upload: publish
|
ssh_upload: publish
|
||||||
scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
|
scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
|
||||||
@ -103,10 +105,10 @@ dropbox_upload: publish
|
|||||||
cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
|
cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
|
||||||
|
|
||||||
ftp_upload: publish
|
ftp_upload: publish
|
||||||
lftp ftp://$(FTP_USER):$(FTP_PASS)@$(FTP_HOST) -e "set ssl:verify-certificate no; mirror -R --ignore-time --no-perms --parallel=4 -e --use-cache -v $(OUTPUTDIR) $(FTP_TARGET_DIR); quit"
|
$(DOCKER_COMPOSE_CMD) lftp ftp://$(FTP_USER):$(FTP_PASS)@$(FTP_HOST) -e "set ssl:verify-certificate no; mirror -R --ignore-time --no-perms --parallel=4 -e --use-cache -v $(OUTPUTDIR) $(FTP_TARGET_DIR); quit"
|
||||||
|
|
||||||
ftp_upload_clean: publish
|
ftp_upload_clean: publish
|
||||||
lftp ftp://$(FTP_USER):$(FTP_PASS)@$(FTP_HOST) -e "set ssl:verify-certificate no; mirror -R --no-perms --parallel=4 -e -v $(OUTPUTDIR) $(FTP_TARGET_DIR); quit"
|
$(DOCKER_COMPOSE_CMD) lftp ftp://$(FTP_USER):$(FTP_PASS)@$(FTP_HOST) -e "set ssl:verify-certificate no; mirror -R --no-perms --parallel=4 -e -v $(OUTPUTDIR) $(FTP_TARGET_DIR); quit"
|
||||||
|
|
||||||
s3_upload: publish
|
s3_upload: publish
|
||||||
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type
|
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type
|
||||||
@ -119,7 +121,7 @@ github: publish
|
|||||||
git push origin $(GITHUB_PAGES_BRANCH)
|
git push origin $(GITHUB_PAGES_BRANCH)
|
||||||
|
|
||||||
newpost:
|
newpost:
|
||||||
$(PY) $(BASEDIR)/newpost.py
|
$(DOCKER_COMPOSE_CMD) $(PY) $(BASEDIR)/newpost.py
|
||||||
|
|
||||||
writingenv:
|
writingenv:
|
||||||
docker-compose run --rm --service-ports blog /opt/xonsh/bin/xonsh
|
docker-compose run --rm --service-ports blog /opt/xonsh/bin/xonsh
|
||||||
|
@ -37,11 +37,8 @@ USER blog
|
|||||||
|
|
||||||
# provision
|
# provision
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& git clone https://github.com/xsteadfastx/batcave.git ~/.batcave \
|
|
||||||
&& touch ~/.profile \
|
|
||||||
&& ansible-playbook -i ~/.batcave/hosts ~/.batcave/shell.yml -c local --extra-vars="host=127.0.0.1" \
|
|
||||||
&& ansible-playbook -c local /home/blog/playbooks/writing_env.yml
|
&& ansible-playbook -c local /home/blog/playbooks/writing_env.yml
|
||||||
|
|
||||||
WORKDIR /blog
|
WORKDIR /blog
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
@ -73,14 +73,3 @@
|
|||||||
mode=0644
|
mode=0644
|
||||||
backup=yes
|
backup=yes
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
- name: export variables
|
|
||||||
lineinfile:
|
|
||||||
dest=~/.xonshrc
|
|
||||||
line='{{ item }}'
|
|
||||||
with_items:
|
|
||||||
- $PYTHONIOENCODING = 'UTF-8'
|
|
||||||
- $SSL_CERT_FILE = '/etc/ssl/certs/ca-certificates.crt'
|
|
||||||
|
|
||||||
- name: no git colors
|
|
||||||
command: git config --global color.ui false
|
|
||||||
|
Loading…
Reference in New Issue
Block a user