Skip to content

Commit

Permalink
update sceptre-circleci docker image (#1230)
Browse files Browse the repository at this point in the history
Make CI use the latest circle-ci docker image updated to alpine v3.16
with python v3.10 and pyenv pre-installed.
  • Loading branch information
zaro0508 committed Jun 10, 2022
1 parent 0e376b4 commit f994eb7
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ executors:
aliases:
- &docs-job
docker:
- image: cloudreach/sceptre-circleci:0.8.0
- image: cloudreach/sceptre-circleci:1.0.0
environment:
REPOSITORY_PATH: '/home/circleci/docs'
DEPLOYMENT_GIT_SSH: 'git@github.com:Sceptre/sceptre.github.io.git'
Expand All @@ -25,28 +25,24 @@ aliases:
command: |
chmod +x .circleci/add-known-hosts.sh
./.circleci/add-known-hosts.sh
. ./venv/bin/activate
pyenv global venv
chmod +x .circleci/github-pages.sh
./.circleci/github-pages.sh
jobs:
build:
docker:
- image: cloudreach/sceptre-circleci:0.8.0
- image: cloudreach/sceptre-circleci:1.0.0
steps:
- checkout
- run:
name: 'Creating Virtualenv'
command: virtualenv venv
- restore_cache:
key:
sceptre-{{ .Environment.CACHE_VERSION }}-requirements-{{ arch }}-{{
checksum "requirements/prod.txt" }}-{{ checksum
"requirements/dev.txt" }}
command: |
pyenv virtualenv 3.9.4 venv
- run:
name: 'Installing Requirements'
command: |
. ./venv/bin/activate
pyenv global venv
pip install -r requirements/prod.txt
pip install -r requirements/dev.txt
- save_cache:
Expand All @@ -55,32 +51,32 @@ jobs:
checksum "requirements/prod.txt" }}-{{ checksum
"requirements/dev.txt" }}
paths:
- venv
- .pyenv/versions/3.9.4/envs/venv
- run:
name: 'Installing Sceptre'
command: |
. ./venv/bin/activate
pyenv global venv
pip install .
- persist_to_workspace:
root: /home/circleci
paths:
- project
- .

lint-and-unit-tests:
docker:
- image: cloudreach/sceptre-circleci:0.8.0
- image: cloudreach/sceptre-circleci:1.0.0
steps:
- attach_workspace:
at: /home/circleci
- restore_cache:
key:
sceptre-{{ .Environment.CACHE_VERSION }}-tox-requirements-{{ arch
}}-{{ checksum "requirements/prod.txt" }}-{{ checksum
"requirements/dev.txt" }} -{{ checksum "tox.ini" }}
sceptre-{{ .Environment.CACHE_VERSION }}-requirements-{{ arch }}-{{
checksum "requirements/prod.txt" }}-{{ checksum
"requirements/dev.txt" }}
- run:
name: 'Linting'
command: |
. ./venv/bin/activate
pyenv global venv
make lint
- run:
Expand All @@ -95,7 +91,7 @@ jobs:
- persist_to_workspace:
root: /home/circleci
paths:
- project
- .

- save_cache:
key:
Expand All @@ -108,16 +104,21 @@ jobs:
integration-tests:
parallelism: 2
docker:
- image: cloudreach/sceptre-circleci:0.8.0
- image: cloudreach/sceptre-circleci:1.0.0
environment:
AWS_DEFAULT_REGION: eu-west-1
steps:
- attach_workspace:
at: /home/circleci
- restore_cache:
key:
sceptre-{{ .Environment.CACHE_VERSION }}-requirements-{{ arch }}-{{
checksum "requirements/prod.txt" }}-{{ checksum
"requirements/dev.txt" }}
- run:
name: 'Integration Testing'
command: |
. ./venv/bin/activate
pyenv global venv
mkdir -p ~/.aws
echo -e "[default]\nregion=eu-west-1\nsource_profile=default\nrole_arn=arn:aws:iam::743644221192:role/sceptre-integration-test-ServiceRole-1SHK9LY0T6P3F" > ~/.aws/config
echo -e "[default]\nregion=eu-west-1\naws_access_key_id=$CI_SERVICE_AWS_ACCESS_KEY_ID\naws_secret_access_key=$CI_SERVICE_AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials
Expand Down Expand Up @@ -154,19 +155,19 @@ jobs:

deploy-pypi:
docker:
- image: cloudreach/sceptre-circleci:0.8.0
- image: cloudreach/sceptre-circleci:1.0.0
steps:
- attach_workspace:
at: /home/circleci
- run:
name: 'Create Distributions'
command: |
. ./venv/bin/activate
pyenv global venv
make dist
- run:
name: 'Upload Distributions'
command: |
. ./venv/bin/activate
pyenv global venv
twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/*
deploy-latest-dockerhub:
Expand Down

0 comments on commit f994eb7

Please sign in to comment.