Deploy and Test #6
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
name: Deploy and Test | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Update Git Submodules | |
run: | | |
git submodule sync --recursive | |
git submodule update --recursive --init --force | |
git submodule update --remote --merge | |
- name: Export CLUSTER_PREFIX as GitHub Env Variable | |
run: echo "CLUSTER_PREFIX=lab-$(date +"%Y%m%d%H%M%S")" >> $GITHUB_ENV | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0.2.0 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
export_default_credentials: true | |
- name: Install gcloud components | |
run: | | |
gcloud components install beta --quiet | |
- name: Set up GKE Environment | |
run: | | |
bash setup-k8s.sh | |
- name: Set up Tooling | |
run: | | |
gcloud config set project neo4j-k8s-marketplace-public | |
docker pull gcr.io/cloud-marketplace-tools/k8s/dev | |
BIN_FILE="$HOME/bin/mpdev" | |
docker run \ | |
gcr.io/cloud-marketplace-tools/k8s/dev \ | |
cat /scripts/dev > "$BIN_FILE" | |
chmod +x "$BIN_FILE" | |
export REGISTRY=gcr.io/$(gcloud config get-value project | tr ':' '/') | |
- name: Build All Containers and Push to Staging Repo | |
run: make app/build | |
- name: Run Deployer Container to Test Deploy | |
run: | | |
mpdev install \ | |
--deployer=gcr.io/neo4j-k8s-marketplace-public/causal-cluster/deployer:4.4 \ | |
--parameters='{"name": "testdeploy", "namespace": "default", "image":"gcr.io/neo4j-k8s-marketplace-public/causal-cluster:4.4","coreServers":"3","readReplicaServers":"1"}' | |
- name: Run Tests | |
run: mpdev verify --deployer=gcr.io/neo4j-k8s-marketplace-public/causal-cluster/deployer:4.4 > VERIFY.log 2>&1 | |
- name: Upload Verify Log | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: verify-log | |
path: VERIFY.log | |
- name: Run Cleanup | |
run: bash cleanup-k8s.sh |