diff --git a/.github/cdk/main.ts b/.github/cdk/main.ts index d5832f5a..99a32975 100644 --- a/.github/cdk/main.ts +++ b/.github/cdk/main.ts @@ -1,47 +1,53 @@ -import { App, CheckoutJob, Stack, Workflow } from "cdkactions"; +import { App, CheckoutJob, Stack, Workflow } from "cdkactions" import { CDKPublishStack } from "@pennlabs/kraken" -import { Construct } from "constructs"; -import { DjangoBaseDockerStack, DockerPublishStack, ShibbolethDockerStack } from "./docker"; +import { Construct } from "constructs" +import { + DjangoBaseDockerStack, + DockerPublishStack, + ShibbolethDockerStack, +} from "./docker" class TerraformLintStack extends Stack { - constructor(scope: Construct, name: string) { - super(scope, name); + constructor(scope: Construct, name: string) { + super(scope, name) - const workflow = new Workflow(this, 'terraform', { - name: 'Lint terraform files', - on: { - push: { - paths: ['terraform/**.tf'] - } - }, - }); + const workflow = new Workflow(this, "terraform", { + name: "Lint terraform files", + on: { + push: { + paths: ["terraform/**.tf"], + }, + }, + }) - new CheckoutJob(workflow, 'lint', { - runsOn: 'ubuntu-latest', - steps: [ - { - uses: 'hashicorp/setup-terraform@v1' - }, - { - run: 'terraform fmt -check -recursive terraform' - } - ], - }); - } + new CheckoutJob(workflow, "lint", { + runsOn: "ubuntu-latest", + steps: [ + { + uses: "hashicorp/setup-terraform@v1", + }, + { + run: "terraform fmt -check -recursive terraform", + }, + ], + }) + } } -const app = new App(); +const app = new App() // CDK stacks -new CDKPublishStack(app, 'kraken'); -new CDKPublishStack(app, 'kittyhawk'); +new CDKPublishStack(app, "kraken") +new CDKPublishStack(app, "kittyhawk") // Docker stacks -const dockerImages = ['datadog-agent', 'pg-s3-backup', 'team-sync']; -dockerImages.map(name => new DockerPublishStack(app, name)); -new DjangoBaseDockerStack(app, {pythonVersions: ['3.9.14', '3.8.5', '3.10.1']}); -new ShibbolethDockerStack(app); +const dockerImages = ["datadog-agent", "pg-s3-backup", "team-sync"] +dockerImages.map((name) => new DockerPublishStack(app, name)) +new DjangoBaseDockerStack(app, { + pythonVersions: ["3.9.14", "3.8.5", "3.10.1", "3.11"], +}) +new ShibbolethDockerStack(app) // Misc stacks -new TerraformLintStack(app, 'terraform'); -app.synth(); +new TerraformLintStack(app, "terraform") +app.synth() diff --git a/.github/cdk/package.json b/.github/cdk/package.json index 4f129eee..1b94a679 100644 --- a/.github/cdk/package.json +++ b/.github/cdk/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@pennlabs/kraken": "^0.8.10", - "cdkactions": "^0.2.0", + "cdkactions": "^0.2.3", "constructs": "^3.3.259" }, "devDependencies": { diff --git a/.github/cdk/yarn.lock b/.github/cdk/yarn.lock index 2bae83ac..560f8186 100644 --- a/.github/cdk/yarn.lock +++ b/.github/cdk/yarn.lock @@ -45,7 +45,7 @@ cdkactions-cli@^0.2.3: yaml "^1.10.0" yargs "^16.2.0" -cdkactions@^0.2.0, cdkactions@^0.2.3: +cdkactions@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/cdkactions/-/cdkactions-0.2.3.tgz#aa27bf720962376d54f8ef95cdfb0ab46458b966" integrity sha512-/DYQ2qsT6fzgZB+cmQjtPqR4aAWCqAytWbFpJK+iJLQ4jQrl6l4uMf01TLiWY3mAILS0YGlwPcoBbGvq9Jnz5g== diff --git a/.github/workflows/cdkactions_docker-django-base.yaml b/.github/workflows/cdkactions_docker-django-base.yaml index bcee4891..fc38e764 100644 --- a/.github/workflows/cdkactions_docker-django-base.yaml +++ b/.github/workflows/cdkactions_docker-django-base.yaml @@ -84,6 +84,32 @@ jobs: cache-to: type=local,dest=/tmp/.buildx-cache build-args: PYTHON_VERSION=3.10.1 tags: pennlabs/django-base:${{ github.sha }}-3.10.1 + publish-django-base-3-11: + name: Publish django-base-3-11 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: buildx-publish-django-base-3-11 + - uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build/Publish + uses: docker/build-push-action@v2 + with: + context: docker/django-base + file: docker/django-base/Dockerfile + push: ${{ github.ref == 'refs/heads/master' }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + build-args: PYTHON_VERSION=3.11 + tags: pennlabs/django-base:${{ github.sha }}-3.11 publish-django-base: name: Publish django-base runs-on: ubuntu-latest diff --git a/docker/django-base/Dockerfile b/docker/django-base/Dockerfile index 51b762e4..296d932c 100644 --- a/docker/django-base/Dockerfile +++ b/docker/django-base/Dockerfile @@ -1,4 +1,4 @@ -ARG PYTHON_VERSION=3.10.1 +ARG PYTHON_VERSION=3.10 FROM python:${PYTHON_VERSION}-slim-buster LABEL maintainer="Penn Labs"