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 #21 from Caleydo/release-2.0.0
Browse files Browse the repository at this point in the history
Prepare Archiving
  • Loading branch information
Anita Steiner authored Nov 30, 2021
2 parents 2e4d79c + 519ac2a commit ab9ce5e
Show file tree
Hide file tree
Showing 16 changed files with 483 additions and 227 deletions.
81 changes: 29 additions & 52 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
version: 2
jobs:
build:
version: 2.1

executors:
node-executor:
working_directory: ~/phovea
docker:
- image: caleydo/phovea_circleci_python:v3.0
- image: docker:17.05.0-ce-git
- image: circleci/python:3.7.11-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python

orbs:
aws-ecr: circleci/[email protected]

jobs:
build:
executor: node-executor
steps:
- checkout
- setup_remote_docker
- setup_remote_docker
- aws-ecr/ecr-login
- run:
name: Show Node.js and npm version
command: |
Expand All @@ -17,78 +25,43 @@ jobs:
name: Show Python and pip version
command: |
python --version
pip --version
pip --version
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: deps1-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: Install npm dependencies
command: npm install
- save_cache:
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
- run:
name: Install AWS CLI
command: |
virtualenv ~/venv
. ~/venv/bin/activate
pip install awscli==1.11.113
- save_cache:
key: awscli-1.11.113
paths:
- ~/venv
- run:
name: Login AWS ECR and DockerHub
command: |
. ~/venv/bin/activate
cat > ~/.dockercfg << EOF
{
"https://index.docker.io/v1/": {
"auth": "$DOCKER_AUTH"
}
}
EOF
export AWS_DEFAULT_REGION=eu-central-1
login="$(aws ecr get-login --no-include-email)"
${login}
key: deps1-{{ .Branch }}-{{ checksum "package.json" }}
paths: ./node_modules
- deploy:
name: Build and deploy
command: |
. ~/venv/bin/activate
case $CIRCLE_BRANCH in
case "${CIRCLE_BRANCH}${CIRCLE_TAG}" in
master)
awsTag="latest"
;;
*)
awsTag="${CIRCLE_BRANCH}"
awsTag="${CIRCLE_BRANCH//\//_}${CIRCLE_TAG}" # replace `/` with `_` in branch name
;;
esac
echo "using tag: --${awsTag}--"
node build.js --skipSaveImage --skipTests --noDefaultTags --pushExtra=${awsTag} --pushTo=922145058410.dkr.ecr.eu-central-1.amazonaws.com/caleydo
node build.js --injectVersion --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 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 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 @@ -103,7 +76,7 @@ jobs:
aws --output text ecs run-task --cluster caleydo --task-definition ${awsFamily} --started-by CircleCIAutoUpdate
fi
workflows:
version: 2
version: 2.1
# build-nightly:
# triggers:
# - schedule:
Expand All @@ -117,12 +90,16 @@ workflows:
build-branch:
jobs:
- build:
context:
- org-global
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
context:
- org-global
filters:
branches:
ignore: /.*/
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @thinkh
40 changes: 29 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
/.tscache
/.idea
/build/
/dist/
node_modules/
/src/**/*.js
/tests/**/*.js
*.map
*.css
*.log
/tmp*/
# ignore all files and plugin repos of the workspace ...
.*
*.*
/*/
*
package-lock.json

# ... except all files relevant for the product build
!/.circleci/
!/.circleci/**/*
!/.github/
!/.github/**/*
!templates/
!templates/web/
!templates/web/**/*
!templates/api/
!templates/api/**/*
!.editorconfig
!.gitattributes
!.yo-rc.json
!ISSUE_TEMPLATE.md
!LICENSE
!README.md
!build.js
!package.json
!phovea_product.*
!Jenkinsfile
!docker_script.sh
!docker-compose-patch.*
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

46 changes: 0 additions & 46 deletions Jenkinsfile

This file was deleted.

14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
vega_clue_product [![Phovea][phovea-image]][phovea-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
DEPRECATED: vega_clue_product
=====================
[![Phovea][phovea-image]][phovea-url] [![Build Status][circleci-image]][circleci-url]


### DEPRECATION Information
Please note that this project has been archived and is no longer being maintained. There is an active development under https://github.com/datavisyn/tdp_core and we will also contribute our future changes to it.

Installation
------------
Expand Down Expand Up @@ -36,9 +38,5 @@ This repository is part of **[Phovea](http://phovea.caleydo.org/)**, a platform

[phovea-image]: https://img.shields.io/badge/Phovea-Product-FABC15.svg
[phovea-url]: https://phovea.caleydo.org
[npm-image]: https://badge.fury.io/js/vega_clue_product.svg
[npm-url]: https://npmjs.org/package/vega_clue_product
[travis-image]: https://travis-ci.org/Caleydo/vega_clue_product.svg?branch=master
[travis-url]: https://travis-ci.org/Caleydo/vega_clue_product
[daviddm-image]: https://david-dm.org/Caleydo/vega_clue_product/status.svg
[daviddm-url]: https://david-dm.org/Caleydo/vega_clue_product
[circleci-image]: https://circleci.com/gh/Caleydo/vega_clue_product.svg?style=shield
[circleci-url]: https://circleci.com/gh/Caleydo/vega_clue_product
Loading

0 comments on commit ab9ce5e

Please sign in to comment.