Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6 from Caleydo/release-2.0.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
Anita Steiner authored Jan 21, 2020
2 parents 4717898 + 0fc743e commit f84434e
Show file tree
Hide file tree
Showing 8 changed files with 851 additions and 281 deletions.
72 changes: 55 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,46 @@ jobs:
build:
working_directory: ~/phovea
docker:
- image: caleydo/phovea_circle_python:1.0
- image: docker:17.05.0-ce-git
- image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
steps:
- checkout
- setup_remote_docker
- run:
name: Show Node.js and npm version
command: |
node -v
npm -v
- run:
name: Show Python and pip version
command: |
python --version
pip --version
- restore_cache:
key: dependency-cache2-{{ checksum "package.json" }}
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-npm-wee
name: Install npm dependencies
command: npm install
- save_cache:
key: dependency-cache2-{{ checksum "package.json" }}
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: Show installed npm dependencies
command: npm list --depth=1 || true
- restore_cache:
key: awscli-1.11.113
key: awscli-1.16.312
- run:
name: install-aws-cli
name: Install AWS CLI
command: |
virtualenv ~/venv
. ~/venv/bin/activate
pip install awscli==1.11.113
pip install awscli==1.16.312
- save_cache:
key: awscli-1.11.113
key: awscli-1.16.312
paths:
- ~/venv
- run:
name: login ecr and docker hub
name: Login AWS ECR and DockerHub
command: |
. ~/venv/bin/activate
cat > ~/.dockercfg << EOF
Expand All @@ -44,38 +56,38 @@ jobs:
login="$(aws ecr get-login --no-include-email)"
${login}
- deploy:
name: build and deploy
name: Build and deploy
command: |
. ~/venv/bin/activate
case $CIRCLE_BRANCH in
master)
awsTag="latest"
;;
*)
awsTag="${CIRCLE_BRANCH}"
awsTag="${CIRCLE_BRANCH//\//_}" # replace `/` with `_` in branch name
;;
esac
echo "using tag: --${awsTag}--"
node build.js --skipSaveImage --noDefaultTags --pushExtra=${awsTag} --pushTo=922145058410.dkr.ecr.eu-central-1.amazonaws.com/caleydo
- store_artifacts:
path: build
prefix: build
destination: build
- deploy:
name: cleanup untagged aws repo
name: Cleanup untagged AWS repositories
command: |
. ~/venv/bin/activate
export AWS_DEFAULT_REGION=eu-central-1
baseName=${CIRCLE_PROJECT_REPONAME%_product}
# list repos filter to just the one of this product and delete untagged ones
aws ecr describe-repositories --output text | cut -f5 | grep "caleydo/${baseName}" | while read line; do aws ecr list-images --repository-name $line --filter tagStatus=UNTAGGED --query 'imageIds[*]' --output text | while read imageId; do aws ecr batch-delete-image --output text --repository-name $line --image-ids imageDigest=$imageId; done; done
aws ecr describe-repositories --output text | cut -f6 | grep "caleydo/${baseName}" | while read line; do aws ecr list-images --repository-name $line --filter tagStatus=UNTAGGED --query 'imageIds[*]' --output text | while read imageId; do aws ecr batch-delete-image --output text --repository-name $line --image-ids imageDigest=$imageId; done; done
- deploy:
name: restart aws #assumes the task definition is called <reponame>-<branch>
name: Restart AWS task # assumes the task definition is called <reponame>-<branch>
command: |
. ~/venv/bin/activate
export AWS_DEFAULT_REGION=eu-central-1
# cleanup name by removing the _product suffix
baseName=${CIRCLE_PROJECT_REPONAME%_product}
awsFamily="${baseName}-${CIRCLE_BRANCH}"
awsFamily="${baseName}-${CIRCLE_BRANCH//\//_}" # replace `/` with `_` in branch name
echo "awsFamily --${awsFamily}--"
tasksExists=$(aws --output text ecs list-task-definitions --family-prefix ${awsFamily})
echo "existsTaskDefinition? --${tasksExists}--"
Expand All @@ -89,3 +101,29 @@ jobs:
fi
aws --output text ecs run-task --cluster caleydo --task-definition ${awsFamily} --started-by CircleCIAutoUpdate
fi
workflows:
version: 2
build-nightly:
triggers:
- schedule:
cron: "15 1 * * 1-5" # "At 01:15 on every day-of-week from Monday through Friday.”, see: https://crontab.guru/#15_1_*_*_1-5
filters:
branches:
only:
- develop
jobs:
- build
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

10 changes: 8 additions & 2 deletions .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
"generator-phovea": {
"type": "product",
"name": "gapminder_product",
"author": "Samuel Gratzl",
"author": "datavisyn",
"today": "Fri, 03 Feb 2017 08:30:49 GMT",
"githubAccount": "Caleydo"
"githubAccount": "datavisyn",
"promptValues": {
"authorName": "datavisyn",
"authorEmail": "[email protected]",
"authorUrl": "https://www.datavisyn.io/",
"githubAccount": "datavisyn"
}
}
}
44 changes: 0 additions & 44 deletions Jenkinsfile

This file was deleted.

Loading

0 comments on commit f84434e

Please sign in to comment.