From a0c292f2a45c15cd8925c46ab1dcd136e6798c51 Mon Sep 17 00:00:00 2001 From: gbhu753 Date: Wed, 17 Jul 2024 22:48:56 +1200 Subject: [PATCH 1/3] Feat: Add curl to dev image --- .devcontainer/dockerfile/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/dockerfile/Dockerfile b/.devcontainer/dockerfile/Dockerfile index 7ed0f43..a56040a 100644 --- a/.devcontainer/dockerfile/Dockerfile +++ b/.devcontainer/dockerfile/Dockerfile @@ -15,6 +15,8 @@ RUN apk add --no-cache docker-compose # Install gh CLI RUN apk add --no-cache github-cli +#Install curl +RUN apk add --no-cache curl EXPOSE 3307 From 90c1ddfa68b69aa0fec2c898b2a4b43c9e1a2ccb Mon Sep 17 00:00:00 2001 From: gbhu753 Date: Wed, 17 Jul 2024 23:13:45 +1200 Subject: [PATCH 2/3] Feat: Add fly deployment toml --- backend/fly.production.toml | 4 ++++ backend/fly.staging.toml | 4 ++++ backend/yarn.lock | 40 ++++++++++------------------------ frontend/Dockerfile.production | 7 ++++++ frontend/Dockerfile.staging | 7 ++++++ frontend/fly.production.toml | 4 ++++ frontend/fly.staging.toml | 4 ++++ 7 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 backend/fly.production.toml create mode 100644 backend/fly.staging.toml create mode 100644 frontend/Dockerfile.production create mode 100644 frontend/Dockerfile.staging create mode 100644 frontend/fly.production.toml create mode 100644 frontend/fly.staging.toml diff --git a/backend/fly.production.toml b/backend/fly.production.toml new file mode 100644 index 0000000..b914145 --- /dev/null +++ b/backend/fly.production.toml @@ -0,0 +1,4 @@ +app = 'wdcc-aspa-api' +primary_region = 'syd' + +[build] \ No newline at end of file diff --git a/backend/fly.staging.toml b/backend/fly.staging.toml new file mode 100644 index 0000000..7952d44 --- /dev/null +++ b/backend/fly.staging.toml @@ -0,0 +1,4 @@ +app = 'wdcc-aspa-api-staging' +primary_region = 'syd' + +[build] \ No newline at end of file diff --git a/backend/yarn.lock b/backend/yarn.lock index 5b9cb4a..9db8d23 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -88,7 +88,7 @@ resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== -"@types/node@*", "@types/node@^20.12.7": +"@types/node@^20.12.7": version "20.12.7" resolved "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz" integrity sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg== @@ -263,7 +263,7 @@ create-require@^1.1.0: debug@2.6.9: version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" @@ -275,13 +275,6 @@ debug@^4: dependencies: ms "2.1.2" -debug@2.6.9: - version "2.6.9" - resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz" @@ -364,7 +357,7 @@ express-openapi@^12.1.3: openapi-framework "^12.1.3" openapi-types "^12.1.3" -express@^4.19.2, "express@>=4.0.0 || >=5.0.0-beta": +express@^4.19.2: version "4.19.2" resolved "https://registry.npmjs.org/express/-/express-4.19.2.tgz" integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== @@ -446,6 +439,11 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" @@ -605,13 +603,6 @@ lodash.merge@^4.6.1: resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - make-error@^1.1.1: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" @@ -649,14 +640,7 @@ mime@1.6.0: resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^3.1.2: +minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -826,7 +810,7 @@ picomatch@^2.0.4, picomatch@^2.2.1: resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -prisma@*, prisma@^5.13.0: +prisma@^5.13.0: version "5.13.0" resolved "https://registry.npmjs.org/prisma/-/prisma-5.13.0.tgz" integrity sha512-kGtcJaElNRAdAGsCNykFSZ7dBKpL14Cbs+VaQ8cECxQlRPDjBlMHNFYeYt0SKovAVy2Y65JXQwB3A5+zIQwnTg== @@ -1041,7 +1025,7 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typescript@^5.4.5, typescript@>=2.7: +typescript@^5.4.5: version "5.4.5" resolved "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== @@ -1056,7 +1040,7 @@ undici-types@~5.26.4: resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -unpipe@~1.0.0, unpipe@1.0.0: +unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== diff --git a/frontend/Dockerfile.production b/frontend/Dockerfile.production new file mode 100644 index 0000000..b16e267 --- /dev/null +++ b/frontend/Dockerfile.production @@ -0,0 +1,7 @@ +COPY --link . . + +# Set build time environment variables +ENV NEXT_API_URL="https://wdcc-aspa-api.fly.dev" + +# Build application +RUN yarn run build \ No newline at end of file diff --git a/frontend/Dockerfile.staging b/frontend/Dockerfile.staging new file mode 100644 index 0000000..cde3932 --- /dev/null +++ b/frontend/Dockerfile.staging @@ -0,0 +1,7 @@ +COPY --link . . + +# Set build time environment variables +ENV NEXT_API_URL="https://wdcc-aspa-api-staging.fly.dev" + +# Build application +RUN yarn run build \ No newline at end of file diff --git a/frontend/fly.production.toml b/frontend/fly.production.toml new file mode 100644 index 0000000..d1a1363 --- /dev/null +++ b/frontend/fly.production.toml @@ -0,0 +1,4 @@ +app = 'wdcc-aspa' +primary_region = 'syd' + +[build] \ No newline at end of file diff --git a/frontend/fly.staging.toml b/frontend/fly.staging.toml new file mode 100644 index 0000000..dd5392b --- /dev/null +++ b/frontend/fly.staging.toml @@ -0,0 +1,4 @@ +app = 'wdcc-aspa-staging' +primary_region = 'syd' + +[build] \ No newline at end of file From 78d2ce7bdab158582dadef43994f4787771f2432 Mon Sep 17 00:00:00 2001 From: gbhu753 Date: Wed, 17 Jul 2024 23:14:34 +1200 Subject: [PATCH 3/3] Fix: Deployment workflows --- .github/workflows/deploy.production.yml | 4 ++-- .github/workflows/deploy.staging.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.production.yml b/.github/workflows/deploy.production.yml index f3d426a..98280f6 100644 --- a/.github/workflows/deploy.production.yml +++ b/.github/workflows/deploy.production.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master - run: flyctl deploy --remote-only --config fly.production.toml - working-directory: ./web + working-directory: ./frontend env: FLY_API_TOKEN: ${{ secrets.FLY_WEB_PRODUCTION_API_TOKEN }} @@ -21,6 +21,6 @@ jobs: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master - run: flyctl deploy --remote-only --config fly.production.toml - working-directory: ./api + working-directory: ./backend env: FLY_API_TOKEN: ${{ secrets.FLY_API_PRODUCTION_API_TOKEN }} diff --git a/.github/workflows/deploy.staging.yml b/.github/workflows/deploy.staging.yml index a9af824..384a2d6 100644 --- a/.github/workflows/deploy.staging.yml +++ b/.github/workflows/deploy.staging.yml @@ -24,6 +24,6 @@ jobs: - uses: actions/checkout@v3 - uses: superfly/flyctl-actions/setup-flyctl@master - run: flyctl deploy --remote-only --config fly.staging.toml - working-directory: ./api + working-directory: ./backend env: FLY_API_TOKEN: ${{ secrets.FLY_API_STAGING_API_TOKEN }}