diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index ed974ba..f1c0a7b 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -3,7 +3,6 @@ name: Rust-test on: push: branches: - - main - service-eat - service-auth - service-drink @@ -20,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose + - name: Clean cache + run: cargo clean - name: Run tests - run: cargo test --verbose + run: cargo test diff --git a/.github/workflows/service-drink-deploy.yml b/.github/workflows/service-drink-deploy.yml index 6e296b5..cdff994 100644 --- a/.github/workflows/service-drink-deploy.yml +++ b/.github/workflows/service-drink-deploy.yml @@ -1,19 +1,27 @@ -name: Deploy Service Eat +name: Deploy Service Drink on: workflow_run: workflows: ["Rust-test"] + branches: [service-drink] types: - completed + workflow_dispatch: jobs: build-push-and-deploy: - runs-on: debian:bookworm@sha256:c2cedd7f80a4dd0f9f80d3699bd433ccf3de33ab63bfa2d4c4ba870c998222d6 + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 + with: + ref: service-drink - name: Build the Docker image - run: docker build . --file Dockerfile --tag d3spina/t-web-800:eat-latest + run: docker compose build + + - name: Tag image + run: docker tag drink:latest d3spina/t-web-800:drink-latest - name: Log in to Docker Hub uses: docker/login-action@v1 @@ -22,13 +30,26 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Push the Docker image - run: docker push d3spina/t-web-800:eat-latest + run: docker push d3spina/t-web-800:drink-latest + + - name: Install kubectl + run: | + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x kubectl + sudo mv kubectl /usr/local/bin/ - - name: Set up Kubeconfig - run: echo "${{ secrets.KUBE_CONFIG }}" | base64 --decode > $HOME/.kube/config + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Save DigitalOcean kubeconfig + run: doctl kubernetes cluster kubeconfig save k8s-1-29-1-do-0-fra1-1711363150093 - name: Deploy to Kubernetes run: | - kubectl apply -f deployment.yaml - kubectl apply -f service.yaml - kubectl rollout status deployment/eat -n eat + kubectl set image deployment/drink drink=${{ secrets.DOCKER_USERNAME }}/t-web-800:drink-latest --namespace drink + + - name: Check deploy + run: kubectl rollout status deployment/drink -n drink + diff --git a/.github/workflows/service-eat-deploy.yml b/.github/workflows/service-eat-deploy.yml new file mode 100644 index 0000000..983f740 --- /dev/null +++ b/.github/workflows/service-eat-deploy.yml @@ -0,0 +1,55 @@ +name: Deploy Service Eat + +on: + workflow_run: + workflows: ["Rust-test"] + branches: [service-eat] + types: + - completed + workflow_dispatch: + +jobs: + build-push-and-deploy: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + with: + ref: service-eat + + - name: Build the Docker image + run: docker compose build + + - name: Tag image + run: docker tag eat:latest d3spina/t-web-800:eat-latest + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Push the Docker image + run: docker push d3spina/t-web-800:eat-latest + + - name: Install kubectl + run: | + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x kubectl + sudo mv kubectl /usr/local/bin/ + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Save DigitalOcean kubeconfig + run: doctl kubernetes cluster kubeconfig save k8s-1-29-1-do-0-fra1-1711363150093 + + - name: Deploy to Kubernetes + run: | + kubectl set image deployment/eat eat=${{ secrets.DOCKER_USERNAME }}/t-web-800:eat-latest --namespace eat + + - name: Check deploy + run: kubectl rollout status deployment/eat -n eat + diff --git a/.github/workflows/service-enjoy-deploy.yml b/.github/workflows/service-enjoy-deploy.yml new file mode 100644 index 0000000..d126714 --- /dev/null +++ b/.github/workflows/service-enjoy-deploy.yml @@ -0,0 +1,55 @@ +name: Deploy Service Enjoy + +on: + workflow_run: + workflows: ["Rust-test"] + branches: [service-enjoy] + types: + - completed + workflow_dispatch: + +jobs: + build-push-and-deploy: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + with: + ref: service-enjoy + + - name: Build the Docker image + run: docker compose build + + - name: Tag image + run: docker tag enjoy:latest d3spina/t-web-800:enjoy-latest + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Push the Docker image + run: docker push d3spina/t-web-800:enjoy-latest + + - name: Install kubectl + run: | + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x kubectl + sudo mv kubectl /usr/local/bin/ + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Save DigitalOcean kubeconfig + run: doctl kubernetes cluster kubeconfig save k8s-1-29-1-do-0-fra1-1711363150093 + + - name: Deploy to Kubernetes + run: | + kubectl set image deployment/enjoy enjoy=${{ secrets.DOCKER_USERNAME }}/t-web-800:enjoy-latest --namespace enjoy + + - name: Check deploy + run: kubectl rollout status deployment/enjoy -n enjoy + diff --git a/.github/workflows/service-sleep-deploy.yml b/.github/workflows/service-sleep-deploy.yml new file mode 100644 index 0000000..e2e7ee7 --- /dev/null +++ b/.github/workflows/service-sleep-deploy.yml @@ -0,0 +1,55 @@ +name: Deploy Service Sleep + +on: + workflow_run: + workflows: ["Rust-test"] + branches: [service-sleep] + types: + - completed + workflow_dispatch: + +jobs: + build-push-and-deploy: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + with: + ref: service-sleep + + - name: Build the Docker image + run: docker compose build + + - name: Tag image + run: docker tag sleep:latest d3spina/t-web-800:sleep-latest + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Push the Docker image + run: docker push d3spina/t-web-800:sleep-latest + + - name: Install kubectl + run: | + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x kubectl + sudo mv kubectl /usr/local/bin/ + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Save DigitalOcean kubeconfig + run: doctl kubernetes cluster kubeconfig save k8s-1-29-1-do-0-fra1-1711363150093 + + - name: Deploy to Kubernetes + run: | + kubectl set image deployment/sleep sleep=${{ secrets.DOCKER_USERNAME }}/t-web-800:sleep-latest --namespace sleep + + - name: Check deploy + run: kubectl rollout status deployment/sleep -n sleep + diff --git a/target 2/.rustc_info.json b/target 2/.rustc_info.json new file mode 100644 index 0000000..b1dc8f3 --- /dev/null +++ b/target 2/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":8194272840735489872,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/d3spina/.rustup/toolchains/stable-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"vh\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.77.1 (7cf61ebde 2024-03-27)\nbinary: rustc\ncommit-hash: 7cf61ebde7b22796c69757901dd346d0fe70bd97\ncommit-date: 2024-03-27\nhost: aarch64-apple-darwin\nrelease: 1.77.1\nLLVM version: 17.0.6\n","stderr":""}},"successes":{}} \ No newline at end of file diff --git a/target 2/CACHEDIR.TAG b/target 2/CACHEDIR.TAG new file mode 100644 index 0000000..20d7c31 --- /dev/null +++ b/target 2/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/