-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from travis to github actions (close #47)
- Loading branch information
Showing
10 changed files
with
140 additions
and
157 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
deploy_docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: coursier/cache-action@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
|
||
- name: Get current version | ||
id: ver | ||
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
|
||
- name: Stage the Docker build | ||
run: sbt docker:stage | ||
|
||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: snowplow/snowplow-google-cloud-storage-loader | ||
tags: | | ||
type=raw,value=latest,enable=${{ !contains(steps.ver.outputs.tag, 'rc') }} | ||
type=raw,value=${{ steps.ver.outputs.tag }} | ||
flavor: | | ||
latest=false | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Push image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: target/docker/stage | ||
file: target/docker/stage/Dockerfile | ||
platforms: linux/amd64,linux/arm64/v8 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: true |
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,37 @@ | ||
name: lacework | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: coursier/cache-action@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Get current version | ||
id: ver | ||
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
|
||
- name: Install lacework scanner | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install curl | ||
curl -L https://github.com/lacework/lacework-vulnerability-scanner/releases/latest/download/lw-scanner-linux-amd64 -o lw-scanner | ||
chmod +x lw-scanner | ||
- name: Build docker images | ||
run: sbt docker:publishLocal | ||
|
||
- name: Scan image | ||
env: | ||
LW_ACCESS_TOKEN: ${{ secrets.LW_ACCESS_TOKEN }} | ||
LW_ACCOUNT_NAME: ${{ secrets.LW_ACCOUNT_NAME }} | ||
LW_SCANNER_SAVE_RESULTS: ${{ !contains(steps.version.outputs.tag, 'rc') }} | ||
run: ./lw-scanner image evaluate snowplow/snowplow-google-cloud-storage-loader ${{ steps.ver.outputs.tag }} --build-id ${{ github.run_id }} --no-pull |
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,25 @@ | ||
name: Snyk | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
security: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Snyk | ||
run: sudo npm install -g snyk | ||
|
||
- name: Add correct sbt-dependency-graph version | ||
run: mkdir -p $HOME/.sbt/1.0/plugins && echo 'addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")' >> $HOME/.sbt/1.0/plugins/plugins.sbt | ||
|
||
- name: Run Snyk to check for vulnerabilities | ||
run: snyk monitor --project-name=snowplow-google-cloud-storage-loader |
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,16 @@ | ||
name: test | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: coursier/cache-action@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Run tests | ||
run: sbt test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -42,9 +42,8 @@ lazy val macroSettings = Seq( | |
) | ||
|
||
import com.typesafe.sbt.packager.docker._ | ||
dockerRepository := Some("snowplow-docker-registry.bintray.io") | ||
dockerUsername := Some("snowplow") | ||
dockerBaseImage := "snowplow-docker-registry.bintray.io/snowplow/k8s-dataflow:0.1.0" | ||
dockerBaseImage := "snowplow/k8s-dataflow:0.1.0" | ||
Docker / maintainer := "Snowplow Analytics Ltd. <[email protected]>" | ||
Docker / daemonUser := "snowplow" | ||
dockerCommands := dockerCommands.value.map{ | ||
|