-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mardizzone/POS-1242: ci implementation and minor fixes (#156)
* dev: chg: POS-1240: replace role-to-assume in GH ci * dev: chg: POS-1242: Use GH runner IP * dev: chg: POS-1242: Change key permissions to 700 * dev: chg: POS-1242: query KeyMaterial only for aws key * dev: chg: POS-1242: edit smoke tests to run without docker / fail on ci error * dev: chg: POS-1242: use --monitor command to run smoke tests * dev: chg: POS-1242: fix lastStateID / validate cert and relative path * dev: del: POS-1242: remove old bash smoke_test file * dev: fix: certName and certPath mismatch fix * dev: chg: update dependencies and remove obsolete snyk security issues * dev: chg: change one ci step name * dev: add: POS-1241: tag resources to user / renaming of terraform configs
- Loading branch information
1 parent
f3d158e
commit f9706c3
Showing
10 changed files
with
1,081 additions
and
421 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ jobs: | |
path: matic-cli | ||
|
||
- name: Create .env file | ||
continue-on-error: true | ||
run: | | ||
cd matic-cli | ||
cp .env.example .env | ||
|
@@ -64,65 +63,66 @@ jobs: | |
sed -i 's,/absolute/path/to/your/,/home/runner/work/matic-cli/matic-cli/matic-cli/aws/,' .env | ||
sed -i 's,MATIC_CLI_BRANCH=master,MATIC_CLI_BRANCH=${{ github.head_ref || github.ref_name }},' .env | ||
- name: Get GitHub action runner IP | ||
id: ip | ||
uses: haythem/[email protected] | ||
|
||
- name: Create secret.tfvars | ||
run: | | ||
cd matic-cli | ||
touch secret.tfvars | ||
echo "SG_CIDR_BLOCKS=[\"${{ steps.ip.outputs.ipv4 }}/32\"]" >> secret.tfvars | ||
- name: Configure AWS credentials | ||
continue-on-error: true | ||
uses: aws-actions/configure-aws-credentials@master | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/GithubActionsRole | ||
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/MaticCLIGitHubActionsRole | ||
role-session-name: GithubActionsSession | ||
|
||
- name: Create aws key pair | ||
continue-on-error: true | ||
run: | | ||
cd matic-cli | ||
mkdir aws | ||
cd aws | ||
aws ec2 create-key-pair --key-name matic-cli-ci-key --key-type rsa --key-format pem --output text > matic-cli-ci-key.pem | ||
chmod 600 matic-cli-ci-key.pem | ||
aws ec2 create-key-pair --key-name matic-cli-ci-key --key-type rsa --key-format pem --query "KeyMaterial" --output text > matic-cli-ci-key.pem | ||
chmod 700 matic-cli-ci-key.pem | ||
- name: Setup node | ||
continue-on-error: true | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.17.1' | ||
|
||
- name: Install npm dependencies | ||
continue-on-error: true | ||
run: | | ||
cd matic-cli | ||
npm install --prefer-offline --no-audit --progress=false | ||
- name: Init devnet | ||
continue-on-error: true | ||
run: | | ||
cd matic-cli | ||
./bin/express-cli --init | ||
- name: Start devnet | ||
continue-on-error: true | ||
run: | | ||
cd matic-cli/deployments/devnet-1 | ||
ls -la | ||
../../bin/express-cli --start | ||
- name: Run smoke tests | ||
continue-on-error: true | ||
run: | | ||
cd matic-cli/deployments/devnet-1 | ||
../../bin/express-cli --send-state-sync | ||
cd - | ||
timeout 20m bash matic-cli/.github/smoke_test.sh | ||
timeout 20m ../../bin/express-cli --monitor exit | ||
- name: Destroy devnet | ||
continue-on-error: true | ||
if: always() | ||
run: | | ||
cd matic-cli/deployments/devnet-1 | ||
echo "Running --destroy" | ||
../../bin/express-cli --destroy | ||
- name: Delete aws key pair | ||
continue-on-error: true | ||
if: always() | ||
run: | | ||
cd matic-cli/aws | ||
|
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
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
Oops, something went wrong.