Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 3 #9

Merged
merged 33 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f72fc77
project structure changes for stack endpoint
Aug 28, 2023
c9411cc
id field type to i32
Sep 1, 2023
eea24ba
test payload fields
Sep 3, 2023
09fdb06
validate add rating request, added server_valid
Sep 3, 2023
6d4fdf7
validate text field
Sep 5, 2023
880c9e6
health_check, cleanup
Sep 5, 2023
e94766a
import structure and files related to rating from dev branch
Sep 5, 2023
e6443f9
add.rs
Sep 10, 2023
956b2f6
still broken
Sep 11, 2023
86c810d
category enum to db
Sep 13, 2023
cabba79
fixes from dev, use AppState for the first tests
Sep 13, 2023
2211a6f
Json extractor instead Form
Sep 16, 2023
41f8de0
AppState requst handling
Sep 17, 2023
218ba56
Add rating implemented, database creds changed
Sep 17, 2023
2039789
github actions, telegram notifier and docker image build
Sep 17, 2023
725dca8
add rating fix from dev
Sep 17, 2023
4827c66
updates from issue-2
Sep 17, 2023
7a13f36
Update README.md
vsilent Sep 17, 2023
50c4892
product test fixture
Sep 17, 2023
2dd86eb
fixed bug primary key
smart--petea Sep 18, 2023
2d03a78
Merge pull request #5 from smart--petea/dev
vsilent Sep 18, 2023
af25284
fixed rating migration
smart--petea Sep 19, 2023
eea7c55
Merge pull request #6 from smart--petea/dev
vsilent Sep 19, 2023
46d6ec3
issue_enum - enum fixed
smart--petea Sep 20, 2023
ece5118
issue_enum: fetch product when adding a rating
smart--petea Sep 21, 2023
afd860b
issue_enum - removed rating column
smart--petea Sep 22, 2023
f32b190
issuue_enum - separate namespace for forms
smart--petea Sep 22, 2023
a8b3814
issue_enum
smart--petea Sep 24, 2023
d6b3b81
Merge pull request #7 from smart--petea/issue_enum
vsilent Sep 24, 2023
d8c32cb
Rating: check vote existence, query spans, json response
Sep 24, 2023
882f76a
issue-3 bearer_guard
smart--petea Sep 29, 2023
31f0ae7
issue-3. request state. user.id
smart--petea Sep 30, 2023
2311377
issue-3 response from user service
smart--petea Oct 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DATABASE_URL=postgres://postgres:postgres@localhost:5432/newsletter
DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
155 changes: 155 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Docker CICD

on:
push:
branches:
- master
- testing
pull_request:
branches:
- master

jobs:
cicd-linux-docker:
name: Cargo and npm build
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, clippy

- name: Cache cargo registry
uses: actions/[email protected]
with:
path: ~/.cargo/registry
key: docker-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-registry-
docker-

- name: Cache cargo index
uses: actions/[email protected]
with:
path: ~/.cargo/git
key: docker-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-index-
docker-

- name: Generate Secret Key
run: |
head -c16 /dev/urandom > src/secret.key

- name: Cache cargo build
uses: actions/[email protected]
with:
path: target
key: docker-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-build-
docker-

- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check

- name: Cargo test
if: ${{ always() }}
uses: actions-rs/cargo@v1
with:
command: test

- name: Rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt
command: fmt
args: --all -- --check

- name: Rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
command: clippy
args: -- -D warnings

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: npm install, build, and test
working-directory: ./web
run: |
npm install
npm run build
# npm test

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: dist-without-markdown
path: |
web/dist
!web/dist/**/*.md

- name: Display structure of downloaded files
run: ls -R web/dist

- name: Copy app files and zip
run: |
mkdir -p app/stacker/dist
cp target/release/stacker app/stacker
cp -a web/dist/. app/stacker
cp docker/prod/Dockerfile app/Dockerfile
cd app
touch .env
tar -czvf ../app.tar.gz .
cd ..

- name: Upload app archive for Docker job
uses: actions/[email protected]
with:
name: artifact-linux-docker
path: app.tar.gz

cicd-docker:
name: CICD Docker
runs-on: ubuntu-latest
needs: cicd-linux-docker
steps:
- name: Download app archive
uses: actions/download-artifact@v2
with:
name: artifact-linux-docker

- name: Extract app archive
run: tar -zxvf app.tar.gz

- name: Display structure of downloaded files
run: ls -R

- name: Docker build and publish
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: trydirect/stacker
add_git_labels: true
tag_with_ref: true
#no-cache: true
19 changes: 19 additions & 0 deletions .github/workflows/notifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Notifier
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

notifyTelegram:
runs-on: ubuntu-latest
steps:
- name: send custom message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
"Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}"
Loading
Loading