Skip to content

Commit 5c4f04b

Browse files
author
Marc Rooding
authored
Merge pull request #2 from noinarisak/feature/makefile
Add enhancements
2 parents f6abd42 + 3cea1b8 commit 5c4f04b

File tree

3 files changed

+245
-4
lines changed

3 files changed

+245
-4
lines changed

.gitignore

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
2+
# Created by https://www.gitignore.io/api/git,vim,terraform,visualstudiocode,python
3+
# Edit at https://www.gitignore.io/?templates=git,vim,terraform,visualstudiocode,python
4+
5+
### Git ###
6+
# Created by git for backups. To disable backups in Git:
7+
# $ git config --global mergetool.keepBackup false
8+
*.orig
9+
10+
# Created by git when using merge tools for conflicts
11+
*.BACKUP.*
12+
*.BASE.*
13+
*.LOCAL.*
14+
*.REMOTE.*
15+
*_BACKUP_*.txt
16+
*_BASE_*.txt
17+
*_LOCAL_*.txt
18+
*_REMOTE_*.txt
19+
20+
### Python ###
21+
# Byte-compiled / optimized / DLL files
22+
__pycache__/
23+
*.py[cod]
24+
*$py.class
25+
26+
# C extensions
27+
*.so
28+
29+
# Distribution / packaging
30+
.Python
31+
build/
32+
develop-eggs/
33+
dist/
34+
downloads/
35+
eggs/
36+
.eggs/
37+
lib/
38+
lib64/
39+
parts/
40+
sdist/
41+
var/
42+
wheels/
43+
pip-wheel-metadata/
44+
share/python-wheels/
45+
*.egg-info/
46+
.installed.cfg
47+
*.egg
48+
MANIFEST
49+
50+
# PyInstaller
51+
# Usually these files are written by a python script from a template
52+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
53+
*.manifest
54+
*.spec
55+
56+
# Installer logs
57+
pip-log.txt
58+
pip-delete-this-directory.txt
59+
60+
# Unit test / coverage reports
61+
htmlcov/
62+
.tox/
63+
.nox/
64+
.coverage
65+
.coverage.*
66+
.cache
67+
nosetests.xml
68+
coverage.xml
69+
*.cover
70+
.hypothesis/
71+
.pytest_cache/
72+
73+
# Translations
74+
*.mo
75+
*.pot
76+
77+
# Django stuff:
78+
*.log
79+
local_settings.py
80+
db.sqlite3
81+
82+
# Flask stuff:
83+
instance/
84+
.webassets-cache
85+
86+
# Scrapy stuff:
87+
.scrapy
88+
89+
# Sphinx documentation
90+
docs/_build/
91+
92+
# PyBuilder
93+
target/
94+
95+
# Jupyter Notebook
96+
.ipynb_checkpoints
97+
98+
# IPython
99+
profile_default/
100+
ipython_config.py
101+
102+
# pyenv
103+
.python-version
104+
105+
# pipenv
106+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
107+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
108+
# having no cross-platform support, pipenv may install dependencies that don’t work, or not
109+
# install all needed dependencies.
110+
#Pipfile.lock
111+
112+
# celery beat schedule file
113+
celerybeat-schedule
114+
115+
# SageMath parsed files
116+
*.sage.py
117+
118+
# Environments
119+
.env
120+
.venv
121+
env/
122+
venv/
123+
ENV/
124+
env.bak/
125+
venv.bak/
126+
127+
# Spyder project settings
128+
.spyderproject
129+
.spyproject
130+
131+
# Rope project settings
132+
.ropeproject
133+
134+
# mkdocs documentation
135+
/site
136+
137+
# mypy
138+
.mypy_cache/
139+
.dmypy.json
140+
dmypy.json
141+
142+
# Pyre type checker
143+
.pyre/
144+
145+
### Terraform ###
146+
# Local .terraform directories
147+
**/.terraform/*
148+
149+
# .tfstate files
150+
*.tfstate
151+
*.tfstate.*
152+
153+
# Crash log files
154+
crash.log
155+
156+
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
157+
# .tfvars files are managed as part of configuration and so should be included in
158+
# version control.
159+
#
160+
# example.tfvars
161+
162+
# Ignore override files as they are usually used to override resources locally and so
163+
# are not checked in
164+
override.tf
165+
override.tf.json
166+
*_override.tf
167+
*_override.tf.json
168+
169+
# Include override files you do wish to add to version control using negated pattern
170+
# !example_override.tf
171+
172+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
173+
# example: *tfplan*
174+
175+
### Vim ###
176+
# Swap
177+
[._]*.s[a-v][a-z]
178+
[._]*.sw[a-p]
179+
[._]s[a-rt-v][a-z]
180+
[._]ss[a-gi-z]
181+
[._]sw[a-p]
182+
183+
# Session
184+
Session.vim
185+
186+
# Temporary
187+
.netrwhist
188+
*~
189+
# Auto-generated tag files
190+
tags
191+
# Persistent undo
192+
[._]*.un~
193+
194+
### VisualStudioCode ###
195+
.vscode/*
196+
!.vscode/settings.json
197+
!.vscode/tasks.json
198+
!.vscode/launch.json
199+
!.vscode/extensions.json
200+
201+
### VisualStudioCode Patch ###
202+
# Ignore all local history of files
203+
.history
204+
205+
# End of https://www.gitignore.io/api/git,vim,terraform,visualstudiocode,python

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
FROM python:3.7
1+
FROM python:3.7-slim-stretch
22

3-
RUN apt-get -y upgrade && \
4-
apt-get -y install git && \
5-
apt-get clean
3+
RUN set -ex \
4+
\
5+
&& apt-get -y upgrade \
6+
&& apt-get -y update \
7+
&& apt-get -y install git \
8+
&& apt-get clean
69

710
WORKDIR /version-update
811

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
# Date: 2019-05-14
3+
# Desc: Makefile used for working with Docker container.
4+
5+
.PHONY: help build run clean rebuild publish
6+
7+
CONTAINER_NAME=gitlab-semantic-versioning
8+
CONTAINER_VERSION=v1.0.0
9+
CONTAINER=${CONTAINER_NAME}:${CONTAINER_VERSION}
10+
include .env
11+
DOCKERHUB_USERNAME=noinarisak
12+
13+
help: ## This help. Inspired by http://bit.ly/2EKRAH4
14+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
15+
16+
.DEFAULT_GOAL := help
17+
18+
build: ## Build docker image.
19+
@docker build -t ${CONTAINER} .
20+
21+
run: build ## Run docker image.
22+
@docker run -it -v "$$(pwd)":/data ${CONTAINER} /bin/bash
23+
24+
clean: ## Clean docker images.
25+
-@docker rmi -f ${CONTAINER} &> /dev/null || true
26+
-@docker rmi -f ${DOCKERHUB_USERNAME}/${CONTAINER} &> /dev/null || true
27+
28+
rebuild: clean build ## Rebuild.
29+
30+
publish: clean build ## Publish.
31+
@docker login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD}
32+
@docker tag ${CONTAINER} ${DOCKERHUB_USERNAME}/${CONTAINER}
33+
@docker push ${DOCKERHUB_USERNAME}/${CONTAINER}

0 commit comments

Comments
 (0)