Skip to content

Commit 39f3eb1

Browse files
committed
Initial commit
0 parents  commit 39f3eb1

File tree

63 files changed

+4371
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4371
-0
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
3+
** Please read the guidelines below. **
4+
5+
GitHub issues are reserved for bug reports.
6+
The best place to ask general questions or ask for community support is
7+
[on our Discourse](https://discourse.snowplowanalytics.com/).
8+
9+
-->
10+
11+
**Version**:
12+
13+
**Expected behavior**:
14+
15+
**Actual behavior**:
16+
17+
**Steps to reproduce**:
18+
19+
<!-- Please try to be as detailed as possible so that we can reproduce and fix the issue
20+
as quickly as possible. -->
21+
1.
22+
2.
23+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!--
2+
Thank you for contributing to Snowplow Postgres Loader!
3+
4+
You'll find a small checklist below which should help speed up the review process:
5+
6+
- [ ] Have you signed the [contributor license agreement](https://github.com/snowplow/snowplow/wiki/CLA)?
7+
- [ ] Have you read the [contributing guide](https://github.com/snowplow-incubator/snowplow-postgres-loader/blob/master/CONTRIBUTING.md)?
8+
- [ ] Have you added the appropriate unit tests?
9+
- [ ] Have you run the tests through `sbt test`?
10+
- [ ] Is your pull request against the `master` branch?
11+
-->
12+

.github/check_tag.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
tag=$1
6+
7+
project_version=$(sbt version -Dsbt.log.noformat=true | perl -ne 'print "$1\n" if /info.*(\d+\.\d+\.\d+[^\r\n]*)/' | tail -n 1 | tr -d '\n')
8+
9+
if [[ "${tag}" = "${project_version}" ]]; then
10+
echo "Tag version (${tag}) matches project version (${project_version}). Deploying!"
11+
else
12+
echo "Tag version (${tag}) doesn't match version in scala project (${project_version}). Aborting!"
13+
exit 1
14+
fi

.github/deploy_common.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
tag=$1
6+
7+
mkdir ~/.bintray/
8+
FILE=$HOME/.bintray/.credentials
9+
cat <<EOF >$FILE
10+
realm = Bintray API Realm
11+
host = api.bintray.com
12+
user = $BINTRAY_SNOWPLOW_MAVEN_USER
13+
password = $BINTRAY_SNOWPLOW_MAVEN_API_KEY
14+
EOF
15+
16+
sbt "project common" +publish
17+
echo "Snowplow Postgres: published to Bintray Maven"
18+
sbt "project common" +bintraySyncMavenCentral
19+
echo "Snowplow Postgres: synced to Maven Central"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"self": {
3+
"vendor": "me.chuwy",
4+
"name": "pg-test",
5+
"format": "jsonschema",
6+
"version": "1-0-0"
7+
},
8+
"properties": {
9+
"requiredString": { "type": "string" },
10+
"requiredUnion": { "type": ["string", "boolean"] },
11+
"nested": {
12+
"properties": {
13+
"a": { "type": "number" },
14+
"b": {}
15+
},
16+
"required": ["a"]
17+
},
18+
"someArray": { "type": "array" },
19+
"id": { "type": "string", "format": "uuid" }
20+
},
21+
"required": ["requiredString", "requiredUnion"]
22+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"self": {
3+
"vendor": "me.chuwy",
4+
"name": "pg-test",
5+
"format": "jsonschema",
6+
"version": "1-0-1"
7+
},
8+
"properties": {
9+
"requiredString": { "type": "string" },
10+
"requiredUnion": { "type": ["string", "boolean"] },
11+
"nested": {
12+
"properties": {
13+
"a": { "type": "number" },
14+
"b": {},
15+
"c": { "type": ["integer", "null"] }
16+
},
17+
"required": ["a"]
18+
},
19+
"someArray": { "type": "array" },
20+
"id": { "type": "string", "format": "uuid" },
21+
"someDate": { "type": "string", "format": "date-time" }
22+
},
23+
"required": ["requiredString", "requiredUnion"]
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"self": {
3+
"vendor": "me.chuwy",
4+
"name": "pg-test",
5+
"format": "jsonschema",
6+
"version": "1-0-2"
7+
},
8+
"properties": {
9+
"requiredString": { "type": "string" },
10+
"requiredUnion": { "type": ["string", "boolean"] },
11+
"nested": {
12+
"properties": {
13+
"a": { "type": "number" },
14+
"b": {},
15+
"c": { "type": ["integer", "null"] }
16+
},
17+
"required": ["a"]
18+
},
19+
"someArray": { "type": "array" },
20+
"id": { "type": "string", "format": "uuid" },
21+
"someDate": { "type": "string", "format": "date-time" },
22+
"bigInt": { "type": "integer", "maximum": 100000000000000 }
23+
},
24+
"required": ["requiredString", "requiredUnion"]
25+
}

.github/server.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Dummy Iglu Server configuration to assist in testing
2+
3+
repo-server {
4+
interface = "0.0.0.0"
5+
port = 8080
6+
idleTimeout = 5
7+
threadPool = {
8+
type = "global"
9+
}
10+
}
11+
12+
database {
13+
type = "dummy"
14+
}
15+
16+
debug = true

.github/start_environment.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ -z ${GITHUB_WORKSPACE+x} ]; then
6+
echo "GITHUB_WORKSPACE is unset";
7+
exit 1
8+
fi
9+
10+
IGLUCTL_ZIP="igluctl_0.7.2_rc1.zip"
11+
IGLUCTL_URI="http://dl.bintray.com/snowplow/snowplow-generic/$IGLUCTL_ZIP"
12+
IGLUCENTRAL_PATH="$GITHUB_WORKSPACE/iglu-central"
13+
SCHEMAS_PATH="$IGLUCENTRAL_PATH/schemas/"
14+
TEST_SCHEMAS="$GITHUB_WORKSPACE/.github/schemas/"
15+
POSTGRES_PASSWORD=mysecretpassword
16+
17+
git clone https://github.com/snowplow/iglu-central.git $IGLUCENTRAL_PATH
18+
19+
docker run \
20+
-p 8080:8080 \
21+
-v $GITHUB_WORKSPACE/.github:/iglu \
22+
--rm -d \
23+
snowplow-docker-registry.bintray.io/snowplow/iglu-server:0.6.1 \
24+
--config /iglu/server.conf
25+
26+
echo "Waiting for Iglu Server..."
27+
sleep 5
28+
29+
wget $IGLUCTL_URI
30+
unzip -j $IGLUCTL_ZIP
31+
32+
./igluctl static push \
33+
$SCHEMAS_PATH \
34+
http://localhost:8080/ \
35+
48b267d7-cd2b-4f22-bae4-0f002008b5ad \
36+
--public
37+
38+
./igluctl static push \
39+
$TEST_SCHEMAS \
40+
http://localhost:8080/ \
41+
48b267d7-cd2b-4f22-bae4-0f002008b5ad \
42+
--public

.github/workflows/snyk.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Snyk
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
security:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Run Snyk to check for vulnerabilities
15+
uses: snyk/actions/scala@master
16+
with:
17+
command: monitor
18+
args: --project-name=snowplow-postgres-loader
19+
env:
20+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

0 commit comments

Comments
 (0)