got rid of vagrant. using docker itself for writingenv

This commit is contained in:
Marvin Steadfast 2017-03-13 10:19:01 +00:00
parent d5f686a4be
commit bff1571b4e
11 changed files with 58 additions and 63 deletions

2
.gitignore vendored
View File

@ -46,8 +46,6 @@ nosetests.xml
# OWN STUFF
.ftp_pass.txt
.vagrant/*
pelican-plugins
.DS_Store
node_modules
*.retry

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "pelican-plugins"]
path = pelican-plugins
url = git@github.com:xsteadfastx/pelican-plugins.git

View File

@ -53,6 +53,7 @@ help:
@echo ' make cf_upload upload the web site via Cloud Files'
@echo ' make github upload the web site via gh-pages '
@echo ' make newpost create new post '
@echo ' make writingenv start writing environment '
@echo ' '
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html'
@echo ' '
@ -116,4 +117,7 @@ github: publish
newpost:
$(PY) $(BASEDIR)/newpost.py
.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github
writingenv:
docker-compose run --rm blog /bin/zsh
.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github newpost writingenv

View File

@ -1593,8 +1593,10 @@ span#checkpoint_status,span#autosave_status{font-size:small}
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sa { color: #BA2121 } /* Literal.String.Affix */
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
@ -1605,9 +1607,11 @@ span#checkpoint_status,span#autosave_status{font-size:small}
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0000FF } /* Name.Function.Magic */
.highlight .vc { color: #19177C } /* Name.Variable.Class */
.highlight .vg { color: #19177C } /* Name.Variable.Global */
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
.highlight .vm { color: #19177C } /* Name.Variable.Magic */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
</style>

15
docker-compose.yml Normal file
View File

@ -0,0 +1,15 @@
version: '3'
services:
blog:
build:
context: writing_env/
container_name: blog
environment:
- BLOG_UID=1000
- BLOG_GID=1000
volumes:
- $PWD:/blog
- $HOME/.ssh:/home/blog/.ssh
stdin_open: true
tty: true
command: /bin/true

1
pelican-plugins Submodule

@ -0,0 +1 @@
Subproject commit 6dbc6833bcb6e53f4af04e46848c860bf467e77e

View File

@ -1,29 +0,0 @@
FROM alpine:3.5
ENV SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt
RUN apk add --update \
bash \
openssh \
python \
sudo \
&& rm -rf /var/cache/apk/*
# create ssh keys
RUN ssh-keygen -A
# add vagrant user
RUN adduser -h /home/vagrant -s /bin/sh -D vagrant
# configure SSH access
RUN mkdir -p /home/vagrant/.ssh \
&& echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > /home/vagrant/.ssh/authorized_keys \
&& chown -R vagrant: /home/vagrant/.ssh \
&& echo -n 'vagrant:vagrant' | chpasswd
# enable passwordless sudo for the "vagrant" user
RUN echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant \
&& chmod 0440 /etc/sudoers.d/vagrant
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-o", "UseDNS=no", "-o", "UsePAM=no"]

View File

@ -1,6 +0,0 @@
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no
autostart=true

28
writing_env/Dockerfile Normal file
View File

@ -0,0 +1,28 @@
FROM alpine:3.5
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
ENV BLOG_UID=1000 BLOG_GID=1000
ADD root /
RUN set -ex \
&& apk add --no-cache \
ansible \
bash \
g++ \
openssh \
python \
sudo \
&& addgroup -g $BLOG_GID blog \
&& adduser -h /home/blog -D -s /bin/sh -G blog blog \
&& echo 'blog ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/blog \
&& chmod 0440 /etc/sudoers.d/blog \
&& chown -R $BLOG_UID:$BLOG_GID /home/blog
USER blog
RUN set -ex \
&& ansible-playbook -c local /home/blog/playbooks/writing_env.yml \
&& /bin/zsh -c "source /home/blog/.zshrc && antigen update"
ENTRYPOINT ["/usr/local/bin/entrypoint"]

View File

@ -1,6 +1,6 @@
# vim:ft=ansible
---
- hosts: all
- hosts: localhost
tasks:
@ -15,7 +15,7 @@
- ca-certificates
- coreutils
- curl
- g++
#- g++
- gcc
- git
- grep
@ -60,12 +60,6 @@
src=flickr2markdown
dest=~/.flickr2markdown
- name: clone pelican-plugins
git:
repo=git@github.com:xsteadfastx/pelican-plugins.git
dest=/vagrant/pelican-plugins
accept_hostkey=yes
- name: install js packages
npm:
name={{ item }}
@ -114,20 +108,3 @@
- name: no git colors
command: git config --global color.ui false
- name: remove some deps
apk:
name={{ item }}
state=absent
with_items:
- gcc
- g++
- musl-dev
- python3-dev
become: yes
- name: remove ansible
file:
path=~/ansible
state=absent