Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pdr9rc committed Apr 2, 2021
1 parent 7ca05cb commit 0f12363
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

name: Trapdoor AWS SAR Deployment
on:
push:
branches: [ master ]
tags:
- '*.*.*'
pull_request:
branches: [ master ]
tags:
- '*.*.*'
jobs:
build:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v2
- name: setup dotnet
Expand Down Expand Up @@ -38,4 +39,7 @@ jobs:
aws s3 cp ./staging/app/trapdoor.zip s3://3cs-serverless-apps/trapdoor/ --content-type=application/zip
aws s3 cp sar.template s3://3cs-serverless-apps/trapdoor/
- name: Create new version in AWS SAR
run: aws serverlessrepo create-application-version --application-id "arn:aws:serverlessrepo:eu-central-1:756157594214:applications/Trapdoor" --semantic-version $(cat VERSION) --source-code-archive-url "https://3cs-serverless-apps.s3.eu-central-1.amazonaws.com/trapdoor/trapdoor.zip" --source-code-url "https://github.com/3CORESec/Trapdoor" --template-url "https://3cs-serverless-apps.s3.eu-central-1.amazonaws.com/trapdoor/sar.template"
run: |
temp=${{github.ref}}
temp=$(sed 's|refs/tags/||' <<< $temp)
aws serverlessrepo create-application-version --application-id "arn:aws:serverlessrepo:eu-central-1:756157594214:applications/Trapdoor" --semantic-version $temp --source-code-archive-url "https://3cs-serverless-apps.s3.eu-central-1.amazonaws.com/trapdoor/trapdoor.zip" --source-code-url "https://github.com/3CORESec/Trapdoor" --template-url "https://3cs-serverless-apps.s3.eu-central-1.amazonaws.com/trapdoor/sar.template"
1 change: 0 additions & 1 deletion Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ private void initConfig()
{
_alerts = new List<ISender>();
config = JsonConvert.DeserializeObject<Config>(File.ReadAllText("config.json"));
Console.WriteLine(JsonConvert.SerializeObject(config.Paths));
if (string.IsNullOrEmpty(config.SlackPath))
config.SlackPath = Environment.GetEnvironmentVariable("SLACKPATH");
if (string.IsNullOrEmpty(config.WebhookChannel))
Expand Down
2 changes: 0 additions & 2 deletions Slack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public string EditNotification(string payload, string text, string ts)
data["ts"] = ts;
data["attachments"] = payload;
var response = client.UploadValues("https://slack.com/api/chat.update", "POST", data);
Console.WriteLine($"Editing:{Encoding.UTF8.GetString(response)}");
return JsonConvert.DeserializeObject<dynamic>(Encoding.UTF8.GetString(response))["ts"];
}
public string SendNotification(string payload, string text)
Expand All @@ -42,7 +41,6 @@ public string SendNotification(string payload, string text)
data["text"] = text;
data["attachments"] = payload;
var response = client.UploadValues("https://slack.com/api/chat.postMessage", "POST", data);
Console.WriteLine($"Sending:{Encoding.UTF8.GetString(response)}");
return JsonConvert.DeserializeObject<dynamic>(Encoding.UTF8.GetString(response))["ts"];
}

Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

0 comments on commit 0f12363

Please sign in to comment.