This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from Caleydo/release-2.0.0
Prepare Archiving
- Loading branch information
Showing
16 changed files
with
483 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | ||
|
@@ -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}--" | ||
|
@@ -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: | ||
|
@@ -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: /.*/ | ||
|
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @thinkh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.