Navigation Menu

Skip to content

Commit

Permalink
ops: Renew CI scripts (#155)
Browse files Browse the repository at this point in the history
* Renew CI scripts

* Wip ensure-branch

* WIP

* Check branch

* Fix up ensure-branch

* Cosme [skip ci]

* Skip test for dev [skip ci]

* Impl release-staging

* Add master release

* Rename dir

* Fix path

* Wip is-release-ready

* Fix env var usage

* Wip master

* Sort deploy target

* Wip notify

* Rename

* Wip npm publish

* Wip publsh github

* Test persist/attach

* Fix yaml

* Fix yml again

* Finalize config.yaml

* Split release checker

* Impl slack notify

* Use promisify exec

* Use --no-save

* Impl create github release

* Fix up config

* Fix repo/owner

* Add comments

* Split functions

* Use identical config wip

* Use config staging

* Use config master

* Kick CI for test

* Fix up config

* Cover merge commit

* Fix yaml format

* Fix inconsistency in workflow filter

* Add comment [skip ci]
  • Loading branch information
Yuji Sugiura committed Mar 22, 2019
1 parent c32ffc3 commit 72e4d99
Show file tree
Hide file tree
Showing 26 changed files with 647 additions and 377 deletions.
17 changes: 0 additions & 17 deletions .circleci/check_is_new_release.sh

This file was deleted.

31 changes: 0 additions & 31 deletions .circleci/check_latest_version.sh

This file was deleted.

25 changes: 0 additions & 25 deletions .circleci/check_pr_branch.sh

This file was deleted.

47 changes: 0 additions & 47 deletions .circleci/common/upload_to_s3.sh

This file was deleted.

90 changes: 32 additions & 58 deletions .circleci/config.yml
@@ -1,92 +1,66 @@
version: 2
jobs:
test:
docker:
- image: skywayci/skyway-js-sdk
steps:
- checkout
- run: npm install

- run: npm run lint
- run: npm run test

build_deploy_staging:
ensure_branch:
docker:
- image: skywayci/skyway-js-sdk
steps:
- checkout
- run: npm install
- run: npm run build
- deploy:
name: Deploy ECL Staging
command: bash .circleci/deploy_staging.sh
- deploy:
name: Deploy GCP Staging
command: bash .circleci/deploy_gcp_staging.sh
- run:
name: Install extra deps for CI
command: npm install --no-save @octokit/rest
- run: node ./scripts/ensure-branch

build_deploy_master:
test:
docker:
- image: skywayci/skyway-js-sdk
steps:
- checkout
- run: npm install
- run: npm run lint
- run: npm run test
- run: npm run build
- deploy:
name: Create release
command: bash .circleci/deploy_master/create_release.sh
- deploy:
name: Deploy to s3
command: bash .circleci/deploy_master/deploy_s3.sh
- deploy:
name: Deploy to npm
command: bash .circleci/deploy_master/deploy_npm.sh
- deploy:
name: Send
command: bash .circleci/deploy_master/send_notification.sh
- persist_to_workspace:
root: .
paths:
- ./*

fail_if_target_is_master:
release_staging:
docker:
- image: skywayci/skyway-js-sdk
pre: apt-get install -y curl jq
steps:
- checkout
- run: bash .circleci/check_pr_branch.sh
- attach_workspace:
at: .
- run:
name: Install extra deps for CI
command: npm install --no-save replace-in-file aws-sdk
- run: node ./scripts/release-staging

check_latest_version:
release_master:
docker:
- image: skywayci/skyway-js-sdk
pre: apt-get install -y curl jq
steps:
- checkout
- run: bash .circleci/check_latest_version.sh
- attach_workspace:
at: .
- run:
name: Install extra deps for CI
command: npm install --no-save replace-in-file aws-sdk @octokit/rest @slack/client
- run: node ./scripts/release-master

workflows:
version: 2

test_and_deploy:
jobs:
- test
# PRs to master must come from the staging branch.
- fail_if_target_is_master:
filters:
branches:
ignore:
- staging
- master
# Make sure the package.json version and changelog are updaded.
- check_latest_version:
filters:
branches:
only: staging
# Build and deploy to the staging environment
- build_deploy_staging:
- ensure_branch
- test:
requires:
- ensure_branch
- release_staging:
requires:
- test
filters:
branches:
only: staging
# Build and deploy to the production environment
- build_deploy_master:
- release_master:
requires:
- test
filters:
Expand Down
34 changes: 0 additions & 34 deletions .circleci/deploy_gcp_staging.sh

This file was deleted.

55 changes: 0 additions & 55 deletions .circleci/deploy_master/create_release.sh

This file was deleted.

14 changes: 0 additions & 14 deletions .circleci/deploy_master/deploy_npm.sh

This file was deleted.

40 changes: 0 additions & 40 deletions .circleci/deploy_master/deploy_s3.sh

This file was deleted.

0 comments on commit 72e4d99

Please sign in to comment.