Skip to content

Commit

Permalink
added requirements.txt and proper version tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
cl1ent committed Feb 10, 2019
1 parent 2da18f0 commit fa04b60
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
15 changes: 8 additions & 7 deletions .circleci/config.yml
Expand Up @@ -5,7 +5,6 @@ jobs:
machine: true
environment:
APP_NAME: aws
APP_VERSION: 1.16.39
steps:
- checkout
- run:
Expand All @@ -18,11 +17,11 @@ jobs:
- run:
name: Build image
command: |
docker build -t cgswong/${APP_NAME}:${APP_VERSION} .
docker build -t cgswong/${APP_NAME}:latest .
- run:
name: Test version
command: |
docker run cgswong/${APP_NAME}:${APP_VERSION} aws --version
docker run cgswong/${APP_NAME}:latest aws --version
- save_cache:
key: docker-cache-{{ .Environment.CIRCLE_SHA1 }}
paths:
Expand All @@ -31,15 +30,17 @@ jobs:
machine: true
environment:
APP_NAME: aws
APP_VERSION: 1.16.39
steps:
- checkout
- deploy:
command: |
docker build -t cgswong/${APP_NAME}:${APP_VERSION} .
docker build -t cgswong/${APP_NAME}:latest .
export AWSCLI_VERSION=$(docker run cswong/${APP_NAME}:latest aws --version | cut -d"/" -f2 | cut -d" " -f1)
docker build --cache-from cgswong/${APP_NAME}:latest -t cgswong/${APP_NAME}:${AWSCLI_VERSION} .
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
if [ "$CIRCLE_BRANCH" = "master" ]; then
docker push cgswong/${APP_NAME}:${APP_VERSION}
if [ "$CIRCLE_BRANCH" = "master" ]; then
docker push cgswong/${APP_NAME}:latest
docker push cgswong/${APP_NAME}:${AWSCLI_VERSION}
else
echo "Not on master branch, will not deploy to Docker Hub"
fi
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Expand Up @@ -13,6 +13,8 @@ ENV PAGER more

WORKDIR /tmp

ADD requirements.txt

RUN apk --no-cache add \
bash \
bash-completion \
Expand All @@ -27,12 +29,12 @@ RUN apk --no-cache add \
pip install --upgrade --no-cache-dir \
pip \
setuptools &&\
pip install --upgrade --no-cache-dir \
awscli \
pip install --no-cache-dir \
python-dateutil &&\
pip install -r requirements.txt --no-cache-dir &&\
ln -s /usr/bin/aws_bash_completer /etc/profile.d/aws_bash_completer.sh &&\
curl -sSL --output ${S3_TMP} https://github.com/s3tools/s3cmd/archive/master.zip &&\
curl -sSL --output ${RDS_TMP} https://s3.amazonaws.com/rds-downloads/RDSCli.zip &&\
curl -sSL --output ${RDS_TMP} https://s3.amazonaws.com/rds-downloads/RDSCli-${RDS_VERSION}.zip &&\
unzip -q ${S3_TMP} -d /tmp &&\
unzip -q ${RDS_TMP} -d /tmp &&\
mv ${S3_ZIP}/S3 ${S3_ZIP}/s3cmd /usr/bin/ &&\
Expand Down
1 change: 0 additions & 1 deletion release.md

This file was deleted.

1 change: 1 addition & 0 deletions requirements.txt
@@ -0,0 +1 @@
awscli==1.16.101

0 comments on commit fa04b60

Please sign in to comment.