-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
version: 2.1 | ||
workflows: | ||
build_test_deploy: | ||
jobs: | ||
- build_test | ||
- deploy: | ||
requires: | ||
- build_test | ||
orbs: | ||
docker: circleci/[email protected] | ||
jobs: | ||
build_test: | ||
docker: | ||
- image: circleci/python:3.7 | ||
- image: circleci/python:3.9 | ||
steps: | ||
- checkout | ||
- run: | ||
|
@@ -19,21 +14,32 @@ jobs: | |
- run: | ||
name: Run Tests | ||
command: ~/.local/bin/pytest | ||
deploy: | ||
build_push_docker_image: | ||
docker: | ||
- image: circleci/python:3.7 | ||
- image: circleci/python:3.9 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: false | ||
- run: | ||
name: Build and push Docker image | ||
command: | | ||
name: Build app binary | ||
command: | | ||
pip install --user --no-cache-dir -r requirements.txt | ||
~/.local/bin/pyinstaller -F hello_world.py | ||
echo 'export TAG=0.1.${CIRCLE_BUILD_NUM}' >> $BASH_ENV | ||
echo 'export IMAGE_NAME=python-cicd-workshop' >> $BASH_ENV | ||
source $BASH_ENV | ||
docker build -t $DOCKER_LOGIN/$IMAGE_NAME -t $DOCKER_LOGIN/$IMAGE_NAME:$TAG . | ||
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin | ||
docker push $DOCKER_LOGIN/$IMAGE_NAME | ||
- setup_remote_docker | ||
- docker/check | ||
- docker/build: | ||
image: $DOCKER_LOGIN/$CIRCLE_PROJECT_REPONAME | ||
extra_build_args: "-t $DOCKER_LOGIN/$CIRCLE_PROJECT_REPONAME" | ||
tag: 0.1.<< pipeline.number >> | ||
- docker/push: | ||
image: $DOCKER_LOGIN/$CIRCLE_PROJECT_REPONAME | ||
tag: "latest" | ||
- docker/push: | ||
image: $DOCKER_LOGIN/$CIRCLE_PROJECT_REPONAME | ||
tag: "0.1.<< pipeline.number >>" | ||
workflows: | ||
test_build_deploy: | ||
jobs: | ||
- build_test | ||
- build_push_docker_image: | ||
requires: | ||
- build_test |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.7 | ||
FROM python:3.9 | ||
|
||
RUN mkdir /opt/hello_world/ | ||
WORKDIR /opt/hello_world/ | ||
|
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
# Introduction to CI/CD Workshop | ||
|
||
This repo hosts the codebase and tutorial for an Introductory CI/CD Workshop. The workshop is designed to demonstrate and explain how to implement a CI/CD pipeline into a codebase. | ||
|
||
## Tutorial | ||
|
||
The tutorial can be found in the `tutorial/` directory of this repo. The [icd_101_guide.md](tutorial/cicd_101_guide.md) file hosts the tutorial content for the hands on portion of this tutorial. |
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