mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
improvements
This commit is contained in:
+4
-12
@@ -6,14 +6,7 @@ version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
# specify the version you desire here
|
||||
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
|
||||
- image: kennethreitz/bake
|
||||
|
||||
# Specify service dependencies here if necessary
|
||||
# CircleCI maintains a library of pre-built images
|
||||
# documented at https://circleci.com/docs/2.0/circleci-images/
|
||||
# - image: circleci/postgres:9.4
|
||||
- image: kennethreitz/bake:ci
|
||||
|
||||
working_directory: /app
|
||||
|
||||
@@ -23,7 +16,6 @@ jobs:
|
||||
# docker_layer_caching: true
|
||||
- run:
|
||||
name: $ bake ci
|
||||
command: bake ci
|
||||
|
||||
- store_test_results:
|
||||
path: reports
|
||||
command: |
|
||||
pipenv install --dev --system --deploy
|
||||
cd tests && bats *.bats
|
||||
|
||||
@@ -3,45 +3,40 @@
|
||||
USERNAME=${USERNAME:-kennethreitz}
|
||||
|
||||
//: //system //python
|
||||
red "System is setup for local development."
|
||||
//system:
|
||||
lazy_brew pipenv
|
||||
lazy_brew pipenv bats
|
||||
//python: @skip:key=Pipfile.lock //system
|
||||
pipenv install --dev
|
||||
test: //build
|
||||
docker-compose run --entrypoint bash bake -c 'set -ex && pipenv install --dev --system --deploy && cd tests && bats *.bats'
|
||||
release: test //warn @confirm:secure release//pypi docker/release
|
||||
|
||||
test: docker/build
|
||||
docker-compose run --entrypoint bash bake -c 'set -ex && pip3 install pytest && pytest'
|
||||
release: test release//warn @confirm:secure release//pypi docker/release
|
||||
bash: docker//bash
|
||||
|
||||
release//warn:
|
||||
//warn:
|
||||
echo
|
||||
echo "$(red 'Warning'): you are about to release a new version of $(red 'bake' --fg green)."
|
||||
echo
|
||||
echo 'Please do this simple math problem to prove this is not accidental.'
|
||||
echo
|
||||
docker/build:
|
||||
build:
|
||||
# Build the images.
|
||||
set -ex && docker-compose build
|
||||
|
||||
docker//bash: @interactive docker/build
|
||||
docker/bash: @interactive build
|
||||
docker-compose run --entrypoint bash bake
|
||||
|
||||
docker//build/full:
|
||||
# Build the images.
|
||||
set -ex && docker-compose build --no-cache
|
||||
|
||||
release//pypi: @interactive //python
|
||||
pipenv run python setup.py upload
|
||||
|
||||
docker/release: docker/build release//docker/github release//docker/dockerhub
|
||||
docker/release: build //docker/github //docker/dockerhub
|
||||
|
||||
release//docker/github: docker/build
|
||||
//docker/github: build
|
||||
set -ux
|
||||
|
||||
declare -a IMAGES=('bake:core' 'bake:latest' 'red')
|
||||
declare -a IMAGES=('red', 'bake:core' 'bake:latest' 'bake:ci')
|
||||
|
||||
for IMAGE in "${IMAGES[@]}"; do
|
||||
bake_step "Building $IMAGE..."
|
||||
bake_step "Pushing $IMAGE..."
|
||||
|
||||
REMOTE_IMAGE="$REGISTRY/$USERNAME/bake/$IMAGE"
|
||||
|
||||
@@ -52,15 +47,9 @@ release//docker/github: docker/build
|
||||
docker push "$REMOTE_IMAGE"
|
||||
done
|
||||
|
||||
release//docker/dockerhub: docker/build
|
||||
//docker/dockerhub: build
|
||||
docker-compose push
|
||||
|
||||
//ci: //ci/setup
|
||||
set -ex && mkdir -p reports/pytest && pytest --junitxml=reports/pytest/report.xml
|
||||
|
||||
//ci/setup: @skip:key=Pipfile.lock
|
||||
pipenv install --dev --deploy --system
|
||||
|
||||
random/python/ip:
|
||||
#!/usr/bin/env python
|
||||
import requests
|
||||
@@ -75,7 +64,7 @@ cli:
|
||||
echo "$(echo $(red test --fg yellow) $(red test --bold) $(red test --fg cyan) | bake_indent)"
|
||||
echo
|
||||
|
||||
//kr:
|
||||
fun/kr:
|
||||
sparkescakesparkles="✨ 🍰 ✨" | pbcopy
|
||||
echo "$sparkescakesparkles" | pbcopy
|
||||
echo 'KR Copied!' | red --fg cyan
|
||||
|
||||
@@ -34,3 +34,11 @@ services:
|
||||
dockerfile: ./docker/red.Dockerfile
|
||||
depends_on:
|
||||
- core
|
||||
|
||||
ci:
|
||||
image: kennethreitz/bake:ci
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/ci.Dockerfile
|
||||
depends_on:
|
||||
- core
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
FROM kennethreitz/bake:core
|
||||
|
||||
# -- Install CI deps.
|
||||
RUN set -ex && \
|
||||
apt-get update -qq && \
|
||||
apt-get upgrade -y -qq && \
|
||||
apt-get install expect npm -y -qq >/dev/null && \
|
||||
apt-get clean -y -qq && \
|
||||
apt-get autoclean -y -qq
|
||||
|
||||
# -- Install bats.
|
||||
RUN set -ex && npm install -g bats > /dev/null
|
||||
|
||||
# -- Install latest Bake.
|
||||
RUN set -ex && \
|
||||
pip3 install bake-cli --upgrade --quiet > /dev/null
|
||||
|
||||
# -- Really slim down that image.
|
||||
RUN set -ex && \
|
||||
rm -fr /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT [ "bash" ]
|
||||
@@ -13,7 +13,7 @@ RUN set -ex && \
|
||||
RUN set -ex && \
|
||||
apt-get update -qq && \
|
||||
apt-get upgrade -y -qq && \
|
||||
apt-get install curl python3 python3-distutils -y -qq >/dev/null && \
|
||||
apt-get install curl python3 git python3-distutils -y -qq >/dev/null && \
|
||||
apt-get clean -y -qq && \
|
||||
apt-get autoclean -y -qq
|
||||
|
||||
|
||||
Reference in New Issue
Block a user