Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .travis/sentry-release.sh → .github/sentry-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@ if [ "${SENTRY_AUTH_TOKEN}" != "" ]; then
SENTRY_AUTH_TOKEN_PUBLIC="<hidden>"
fi

if [ -z "${TRAVIS_COMMIT}" ]; then
TRAVIS_COMMIT=`git rev-parse HEAD`
if [ -z "${GITHUB_SHA}" ]; then
GITHUB_SHA=$(git rev-parse HEAD)
fi

echo "SENTRY_ORG: ${SENTRY_ORG}"
echo "SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN_PUBLIC}"
echo "SENTRY_SERVER_PROJECT: ${SENTRY_SERVER_PROJECT}"
echo "SENTRY_CLIENT_PROJECT: ${SENTRY_CLIENT_PROJECT}"
echo "SOURCEMAPSIO_REPO: ${SOURCEMAPSIO_REPO}"
echo "TRAVIS_COMMIT: ${TRAVIS_COMMIT}"
echo "GITHUB_SHA: ${GITHUB_SHA}"

curl https://sentry.io/api/0/organizations/${SENTRY_ORG}/releases/ \
-X POST \
-H "Authorization: Bearer ${SENTRY_AUTH_TOKEN}" \
-H 'Content-Type: application/json' \
-d "
{
\"version\": \"${TRAVIS_COMMIT}\",
\"version\": \"${GITHUB_SHA}\",
\"refs\": [{
\"repository\":\"${SOURCEMAPSIO_REPO}\",
\"commit\":\"${TRAVIS_COMMIT}\"
\"commit\":\"${GITHUB_SHA}\"
}],
\"projects\":[\"${SENTRY_SERVER_PROJECT}\", \"${SENTRY_CLIENT_PROJECT}\"]
}"
\"projects\":[\"${SENTRY_CLIENT_PROJECT}\"]
}"
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: deploy & test

on:
push:
branches:
- master
pull_request:

env:
NODE_OPTIONS: '--max-old-space-size=4096 --openssl-legacy-provider'

jobs:
test:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: make test

deploy:
# needs: test
# if: github.ref == 'refs/heads/master'
runs-on: 'ubuntu-latest'
environment: 'gcp - project=sourcemapsio'
steps:
- id: setup-gcloud
name: 'Setup gcloud'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 400.0.0'

- id: auth-gcloud
name: 'Auth gcloud'
env:
SERVICE_KEY_BASE64: ${{ secrets.GCLOUD_SERVICE_KEY }}
run: |
echo $SERVICE_KEY_BASE64 | base64 --decode > service-key.json
gcloud auth activate-service-account --key-file service-key.json

- id: checkout
name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- id: deploy
name: 'Deploy to GCP Cloud Functions'
env:
GCLOUD_APP_BUCKET: ${{ secrets.GCLOUD_APP_BUCKET }}
GCLOUD_DATA_BUCKET: ${{ secrets.GCLOUD_DATA_BUCKET }}
GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
GCLOUD_WWW_BUCKET: ${{ secrets.GCLOUD_WWW_BUCKET }}
REACT_APP_SENTRY_DSN: ${{ vars.REACT_APP_SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_CLIENT_PROJECT: ${{ secrets.SENTRY_CLIENT_PROJECT }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
run: |
make deploy
.github/sentry-release.sh
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

Binary file removed .travis/credentials.tar.gz.enc
Binary file not shown.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ test: test-install
npm test

test-install: echo-exports
npm install
npm install --prefix ./server
npm install --prefix ./client
npm install --legacy-peer-deps
npm install --legacy-peer-deps --prefix ./server
npm install --legacy-peer-deps --prefix ./client

# Launch a local development server for working on the
# React www app (points at deployed/production validation fn)
Expand Down Expand Up @@ -73,8 +73,12 @@ deploy-data: deploy-config
deploy-server: deploy-config
npm install --prefix ./server
npm run build
gcloud functions deploy ${GCLOUD_FN_NAME} --source server \
--stage-bucket ${GCLOUD_APP_BUCKET} --trigger-http --verbosity debug
gcloud functions deploy ${GCLOUD_FN_NAME} \
--source server \
--stage-bucket ${GCLOUD_APP_BUCKET} \
--trigger-http \
--verbosity debug \
--runtime nodejs18

# Deploy all
deploy: build-www deploy-config deploy-server deploy-data deploy-www
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sourcemaps.io [![Build Status](https://travis-ci.org/getsentry/sourcemaps.io.svg?branch=master)](https://travis-ci.org/getsentry/sourcemaps.io)
# sourcemaps.io [![deploy & test](https://github.com/getsentry/sourcemaps.io/actions/workflows/deploy.yml/badge.svg)](https://github.com/getsentry/sourcemaps.io/actions/workflows/deploy.yml)

_A re-write of [sourcemap-validator](https://github.com/mattrobenolt/sourcemap-validator) using React, Node, and Google Cloud Functions._

Expand Down Expand Up @@ -73,10 +73,22 @@ gcloud auth login
Then initiate the deploy:

```bash
# Used for deploy
export GCLOUD_PROJECT=myproject
export GCLOUD_APP_BUCKET=myproject-server
export GCLOUD_DATA_BUCKET=myproject-reports
export GCLOUD_WWW_BUCKET=myproject-web
export GCLOUD_SERVICE_KEY=<base64 encoded service-key json object>

# Used for reporting errors back to your sentry instance:
export REACT_APP_SENTRY_DSN=https://public@sentry.example.com/1
export SENTRY_DSN=https://public@sentry.example.com/1

# Used for creating a new release in your sentry instance:
export SENTRY_AUTH_TOKEN=sntrys_abcxyz
export SENTRY_CLIENT_PROJECT=MY-PROJECT
export SENTRY_ORG=MY-ORG

make deploy
```

Expand Down
3 changes: 2 additions & 1 deletion client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
]
},
"engines": {
"node": "16.14.2"
"node": "18.19.1",
"npm": "10.2.4"
},
"volta": {
"node": "16.14.2",
Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"singleQuote": true
},
"engines": {
"node": "16.14.2"
"node": "18.19.1",
"npm": "10.2.4"
},
"volta": {
"node": "16.14.2",
Expand Down
3 changes: 2 additions & 1 deletion server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"start": "npm run build && node dist/dev.js"
},
"engines": {
"node": "16.14.2"
"node": "18.19.1",
"npm": "10.2.4"
},
"volta": {
"node": "16.14.2",
Expand Down