Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
fix: updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-cardenas-coding committed Mar 22, 2024
1 parent 456fbf1 commit c663818
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 134 deletions.
111 changes: 53 additions & 58 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ name: Release

on:
push:
branches: [ main ]
branches: [main]


permissions:
permissions:
contents: write
packages: write


env:
GITHUB_TOKEN: ${{ github.token }}
SVU_VERSION: 1.11.0
Expand All @@ -28,7 +26,7 @@ jobs:
with:
fetch-depth: 0

- name: get-tags
- name: get-tags
run: git fetch --force --tags

- name: Get svu
Expand Down Expand Up @@ -74,18 +72,17 @@ jobs:
GORELEASER_PREVIOUS_TAG: ${{ needs.tag.outputs.PREV_VERSION }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: git fetch --force --tags

- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.22"
check-latest: true


- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
Expand All @@ -94,56 +91,54 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


Docker:
needs: [tag,goreleaser]
needs: [tag, goreleaser]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: '1.21'
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2


- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/[email protected]
id: build-and-push
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
build-args: |
VERSION=${{ needs.tag.outputs.VERSION }}
- uses: sigstore/[email protected]

- name: Image Signing
run: |
cosign sign --yes \
-a "repo=${{ github.repository }}" \
-a "workflow=${{ github.workflow }}" \
-a "ref=${{ github.sha }}" \
-a "owner=Spectro Cloud" \
--key env://COSIGN_PRIVATE_KEY --recursive "${TAGS}@${DIGEST}"
env:
TAGS: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/[email protected]
id: build-and-push
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
build-args: |
VERSION=${{ needs.tag.outputs.VERSION }}
- uses: sigstore/[email protected]

- name: Image Signing
run: |
cosign sign --yes \
-a "repo=${{ github.repository }}" \
-a "workflow=${{ github.workflow }}" \
-a "ref=${{ github.sha }}" \
-a "owner=Spectro Cloud" \
--key env://COSIGN_PRIVATE_KEY --recursive "${TAGS}@${DIGEST}"
env:
TAGS: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

FROM golang:1.21.5-alpine3.18 as builder
FROM golang:1.22.1-alpine3.19 as builder

ARG VERSION

Expand Down
34 changes: 17 additions & 17 deletions deployment/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions deployment/terraform/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
terraform {
required_providers {
spectrocloud = {
version = ">= 0.16.0"
version = ">= 0.17.4"
source = "spectrocloud/spectrocloud"
}
random = {
version = ">= 3.5.1"
version = ">= 3.6.0"
source = "hashicorp/random"
}
}
}

provider "spectrocloud" {
project_name = var.project
}
}
93 changes: 44 additions & 49 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,81 +4,79 @@ To get started, use the following steps.

## Software Requirements


If you want to work on Spectromate, you will need to install the following software and actions completed.

:warning: This project uses Go Modules making it safe to work with it outside of your existing GOPATH

- [Docker](https://docs.docker.com/get-docker/) v20.10.0 or greater.

* [Docker](https://docs.docker.com/get-docker/) v20.10.0 or greater.

* [Go](https://golang.org/doc/install) 1.20 or greater.
- [Go](https://golang.org/doc/install) 1.21 or greater.

* [Ngrok](https://ngrok.com/download) v3.2.2 or greater.
- [Ngrok](https://ngrok.com/download) v3.2.2 or greater.

* [A Slack App](https://api.slack.com/apps) available that has access to your target workspace.
- [A Slack App](https://api.slack.com/apps) available that has access to your target workspace.

## Setup

The following instructions assume a directory in your home directory outside of the standard GOPATH.

1. Clone the repository by using the following command.

```shell
$ mkdir -p $HOME/projects/spectromate/; cd $HOME/projects/spectromate/
$ git clone [email protected]:spectrocloud/spectromate.git
```
```shell
$ mkdir -p $HOME/projects/spectromate/; cd $HOME/projects/spectromate/
$ git clone [email protected]:spectrocloud/spectromate.git
```

2. Issue the command `make init`. This command will download all the required project dependencies.

```shell
make init
```
```shell
make init
```

3. The following command is used to set up the local development support dependencies, such as Redis and Ngork.

```shell
make start
```
```shell
make start
```

4. Copy the URL Ngrok exposed in the output.
4. Copy the URL Ngrok exposed in the output.

```shell
$ make start
Starting the application and ngrok...
[+] Running 3/3
✔ Network docs-slack-bot_default Created 0.0s
✔ Container docs-slack-bot-redis-1 Started 0.3s
✔ Container docs-slack-bot-redis-cli-1 Started 0.5s
Ngrok URL: https://76ac-184-179-188-29.ngrok-free.app
```
```shell
$ make start
Starting the application and ngrok...
[+] Running 3/3
✔ Network docs-slack-bot_default Created 0.0s
✔ Container docs-slack-bot-redis-1 Started 0.3s
✔ Container docs-slack-bot-redis-cli-1 Started 0.5s
Ngrok URL: https://76ac-184-179-188-29.ngrok-free.app
```

5. Create a `env` file at the root of the project.

```shell
touch .env
```
```shell
touch .env
```

6. Populate the **.env** file with your respective credentials.

```shell
export SLACK_SIGNING_SECRET=....
export MENDABLE_API_KEY=....
```
```shell
export SLACK_SIGNING_SECRET=....
export MENDABLE_API_KEY=....
```

7. Start the local server.

```shell
make server
```
```shell
make server
```

8. Source the `.env` file.

```shell
source .env
```

9. Navigate to your [Slack app ](https://api.slack.com/apps) and open up your app's details page.
```shell
source .env
```

9. Navigate to your [Slack app ](https://api.slack.com/apps) and open up your app's details page.

10. You will access both elements highlighted in the image. Start with the first element, by clicking on the left **Main Menu** and selecting **Slash Command**.

Expand All @@ -90,28 +88,25 @@ The following instructions assume a directory in your home directory outside of

12. Save your changes and navigate back to the main details page.

13. From the left **Main Menu**, select **Interactivity & Shortcuts**.

14. Toggle the **Interactvity** button to **On**.
14. Toggle the **Interactvity** button to **On**.

15. Use your Ngrok URL and paste the URL into the text input box. Append `/api/v1/slack/actions` to the end of the URL and save your changes.

![View of the interactivity options view](../static/images/slack_interactivity_view.png)

16. Navigate to a Slack channel and issue the Slack command `/docs help`.

You should receive an output similar to the following.

![View of the Slack command in use](../static/images/slack_command_issued.png)

You now have a functional test application connected to your local workstation.
You now have a functional test application connected to your local workstation.

17. Stop the local server by pressing the `Ctrl` + `C`.

Make your changes and start the server with the `make server` command to test the new behavior.
Make your changes and start the server with the `make server` command to test the new behavior.

```shell
make server
Expand All @@ -125,10 +120,10 @@ go run main.go

```

## Testing

Add test cases to new functions and new commands. Invoke the Go tests from the root namespace. The pipeline will invoke the Go tests as well.

```shell
go test -race ./...
```
```
Loading

0 comments on commit c663818

Please sign in to comment.