From 5952e09d3fa717f1925dc20e62386425a9208628 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Thu, 23 Nov 2023 11:35:19 +0100 Subject: [PATCH] add ricochet-2 CI Signed-off-by: Matthias Gatto --- .github/workflows/pull-request.yml | 18 +++++++++ local_tests.sh | 60 ++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/pull-request.yml create mode 100755 local_tests.sh diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..8ce3bce --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,18 @@ +name: pull-request + +on: + pull_request: + branches: [ master ] + +jobs: + examples-test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: setup + run: | + sudo apt-get update --fix-missing + sudo apt search pulumi + sudo apt-get install -y -f -o Acquire::Retries=3 pulumi + - name: Local Tests + run: ./local_tests.sh diff --git a/local_tests.sh b/local_tests.sh new file mode 100755 index 0000000..313654e --- /dev/null +++ b/local_tests.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Copyright (c) Outscale SAS +# +# SPDX-License-Identifier: BSD-3-Clause + +export OSC_PASSWORD='ashita wa dochida' +export OSC_LOGIN=joe + +export OMI_ID="ami-90067666" + +export OSC_SECRET_KEY=0000001111112222223333334444445555555666 +export OSC_ACCESS_KEY=11112211111110000000 + +export OSC_USING_RICOCHET="oui" + +if [ "$#" -eq 0 ]; then + + if [ ! -d "osc-ricochet-2" ]; then + git clone https://github.com/outscale-mgo/osc-ricochet-2 + fi + + cd osc-ricochet-2 + pkill ricochet + + cargo build --profile 'sdks' + cargo run --profile 'sdks' -- ./ricochet-ssl.json &> /dev/null & + cd .. + + sleep 5 +fi + +set -e + +#make example-node-create-volumes +export GOPATH=$PWD +# a strong password is important +export PULUMI_CONFIG_PASSPHRASE=wololo +make provider build_python +cd examples/yaml + +pulumi stack init staging + +pulumi config set outscale:secretKeyId $OSC_SECRET_KEY +pulumi config set outscale:accessKeyId $OSC_ACCESS_KEY +pulumi config set outscale:region "eu-west-2" +pulumi config set outscale:insecure true +pulumi config set outscale:endpoints '[{"api": "127.0.0.1:3000"}]' + +set -eE + +MSG_BASE="Test" + +trap "echo [$MSG_BASE yaml pulumi up FAIL]" ERR +PATH=$PATH:$GOPATH/bin pulumi up --yes +echo "[$MSG_BASE yaml pulumi up OK]" +trap "echo [$MSG_BASE yaml pulumi down FAIL]" ERR +PATH=$PATH:$GOPATH/bin pulumi down --yes +echo "[$MSG_BASE yaml pulumi down OK]" +#make example-node-volumes