-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Peng Xiao <[email protected]>
- Loading branch information
1 parent
80696ea
commit 136a7f4
Showing
78 changed files
with
2,386 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#/bin/sh | ||
|
||
# install some tools | ||
sudo yum install -y git vim gcc glibc-static telnet bridge-utils net-tools | ||
|
||
# install docker | ||
curl -fsSL get.docker.com -o get-docker.sh | ||
sh get-docker.sh | ||
|
||
# start docker service | ||
sudo systemctl start docker | ||
|
||
rm -rf get-docker.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# this same shows how we can extend/change an existing official image from Docker Hub | ||
|
||
FROM nginx:latest | ||
# highly recommend you always pin versions for anything beyond dev/learn | ||
|
||
WORKDIR /usr/share/nginx/html | ||
# change working directory to root of nginx webhost | ||
# using WORKDIR is prefered to using 'RUN cd /some/path' | ||
|
||
COPY index.html index.html | ||
|
||
# I don't have to specify EXPOSE or CMD because they're in my FROM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<title>hello</title> | ||
|
||
</head> | ||
|
||
<body> | ||
<h1>Hello Docker! </h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM python:2.7-alpine | ||
LABEL maintainer="Peng Xiao<[email protected]>" | ||
RUN pip install flask Flask-Script | ||
COPY . /app/ | ||
WORKDIR /app | ||
EXPOSE 5000 | ||
ENTRYPOINT [ "python", "manage.py" ] | ||
CMD [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from flask import Flask | ||
app = Flask(__name__) | ||
@app.route('/') | ||
def hello(): | ||
return "hello dockeddr" | ||
|
||
from flask_script import Manager | ||
|
||
manager = Manager(app) | ||
|
||
if __name__ == '__main__': | ||
manager.run() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[run] | ||
source = skeleton | ||
omit = | ||
skeleton/tests/* | ||
*/__init__.py | ||
|
||
[report] | ||
exclude_lines = | ||
def __repr__ | ||
def __str__ | ||
def parse_args | ||
pragma: no cover | ||
raise NotImplementedError | ||
if __name__ == .__main__.: | ||
|
||
ignore_errors = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
*.sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
variables: | ||
GIT_SSL_NO_VERIFY: "1" | ||
|
||
stages: | ||
- test | ||
- build | ||
- deploy | ||
|
||
pep8: | ||
stage: test | ||
image: python:2.7 | ||
script: | ||
- pip install tox | ||
- tox -e pep8 | ||
tags: | ||
- python27 | ||
|
||
unittest-py27: | ||
stage: test | ||
image: python:2.7 | ||
script: | ||
- pip install tox | ||
- tox -e py27 | ||
tags: | ||
- python27 | ||
|
||
unittest-py34: | ||
stage: test | ||
image: python:3.4 | ||
script: | ||
- pip install tox | ||
- tox -e py34 | ||
tags: | ||
- python34 | ||
|
||
sphnix: | ||
stage: test | ||
image: python:2.7 | ||
script: | ||
- pip install tox | ||
- tox -e docs | ||
tags: | ||
- python27 | ||
|
||
build: | ||
stage: build | ||
tags: | ||
- shell | ||
script: | ||
- docker build -t skeleton . | ||
only: | ||
- master | ||
|
||
deploy: | ||
stage: deploy | ||
tags: | ||
- shell | ||
script: | ||
- scripts/deploy.sh | ||
- export | ||
only: | ||
- master |
28 changes: 28 additions & 0 deletions
28
chapter4/labs/labs/flask-skeleton/.gitlab/issue_templates/Bug.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
### Summary | ||
|
||
(Summarize the bug encountered concisely) | ||
|
||
### Steps to reproduce | ||
|
||
(How one can reproduce the issue - this is very important) | ||
|
||
### Expected behavior | ||
|
||
(What you should see instead) | ||
|
||
### Actual behaviour | ||
|
||
(What actually happens) | ||
|
||
### Relevant logs and/or screenshots | ||
|
||
(Paste any relevant logs - please use code blocks (```) to format console output, | ||
logs, and code as it's very hard to read otherwise.) | ||
|
||
|
||
### Possible fixes | ||
|
||
(If you can, link to the line of code that might be responsible for the problem) | ||
|
||
|
||
/label ~"Bug" |
7 changes: 7 additions & 0 deletions
7
chapter4/labs/labs/flask-skeleton/.gitlab/issue_templates/Feature.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### Feature Description | ||
|
||
|
||
### Implementation | ||
|
||
|
||
/label ~"Feature" |
15 changes: 15 additions & 0 deletions
15
chapter4/labs/labs/flask-skeleton/.gitlab/merge_request_templates/default.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
**1. Explain what do you want to merge** | ||
|
||
- | ||
- | ||
|
||
**2. Does this MR meet the acceptance criteria?** | ||
|
||
- [ ] I have read [Contribution guidelines](https://as-gitlab.cisco.com/demo/skeleton/blob/master/CONTRIBUTING.md) | ||
- [ ] I have run the command `tox` locally and get successful results. | ||
- [ ] Branch has no merge conflicts with master (if you do - rebase it please) | ||
|
||
**3. What are the relevant issue numbers?** | ||
|
||
|
||
Thanks for your MR, you're awesome! :+1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Hacking Guide | ||
|
||
## Code style | ||
|
||
Step 1: Read http://www.python.org/dev/peps/pep-0008/ | ||
|
||
Step 2: Read http://www.python.org/dev/peps/pep-0008/ again | ||
|
||
Step 3: Read on | ||
|
||
## Running Tests | ||
|
||
Run tox | ||
|
||
``` | ||
$ cd skeleton | ||
$ tox | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM python:2.7 | ||
LABEL maintainer="Peng Xiao<[email protected]>" | ||
|
||
COPY . /skeleton | ||
WORKDIR /skeleton | ||
RUN pip install -r requirements.txt | ||
EXPOSE 5000 | ||
ENTRYPOINT ["scripts/dev.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2016 Michael Herman | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.