forked from ratify-project/ratify
-
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 #185 from susanshi/quickstart
Quickstart
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 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,36 @@ | ||
name: quick-start | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-quick-start: | ||
name: "Run quick start test" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Bootstrap e2e | ||
run: | | ||
mkdir -p $GITHUB_WORKSPACE/bin | ||
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | ||
make e2e-bootstrap KUBERNETES_VERSION=${{ matrix.KUBERNETES_VERSION }} | ||
make generate-certs | ||
- name: Run e2e with config policy | ||
run: | | ||
make e2e-deploy-helmfile | ||
make e2e-helmfile-deploy-released-ratify | ||
make test-quick-start | ||
- name: Save logs | ||
if: ${{ always() }} | ||
run: | | ||
kubectl logs -n gatekeeper-system -l app=ratify --tail=-1 > logs-ratify-preinstall-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json | ||
kubectl logs -n gatekeeper-system -l app.kubernetes.io/name=ratify --tail=-1 > logs-ratify-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | ||
if: ${{ always() }} | ||
with: | ||
name: e2e-logs | ||
path: | | ||
logs-*.json |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
BATS_TESTS_DIR=${BATS_TESTS_DIR:-test/bats/tests} | ||
WAIT_TIME=60 | ||
SLEEP_TIME=1 | ||
|
||
@test "base test without cert rotator" { | ||
teardown() { | ||
echo "cleaning up" | ||
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl delete pod demo --namespace default --force --ignore-not-found=true' | ||
} | ||
run kubectl run demo --image=ghcr.io/deislabs/ratify/notary-image:signed | ||
assert_success | ||
|
||
# validate unsigned fails | ||
kubectl run demo1 --image=ghcr.io/deislabs/ratify/notary-image:unsigned | ||
assert_failure | ||
} |