From f17dceb092da72d8d4e246e3fa5e77d919e361b3 Mon Sep 17 00:00:00 2001 From: Devon McCarty Date: Wed, 6 Mar 2024 13:59:13 -0500 Subject: [PATCH 1/3] Switch to GitHub Actions. --- .github/workflows/build-and-publish.yml | 37 +++++++++++++++++++++++++ codeship-services.yml | 5 ---- codeship-steps.yml | 22 --------------- dockercfg.encrypted | 2 -- 4 files changed, 37 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/build-and-publish.yml delete mode 100644 codeship-services.yml delete mode 100644 codeship-steps.yml delete mode 100644 dockercfg.encrypted diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..4237f6f --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,37 @@ +name: Build and Publish + +on: + push: + +jobs: + build-and-publish: + name: Build and Publish + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }} + tags: | + type=ref,event=branch + type=ref,event=tag + # set latest tag for master branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/codeship-services.yml b/codeship-services.yml deleted file mode 100644 index 9a8c223..0000000 --- a/codeship-services.yml +++ /dev/null @@ -1,5 +0,0 @@ -app: - build: - image: silintl/postgresql-backup-restore-fs - dockerfile: ./Dockerfile - cached: true diff --git a/codeship-steps.yml b/codeship-steps.yml deleted file mode 100644 index 76bd836..0000000 --- a/codeship-steps.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: push_branch - service: app - type: push - image_name: silintl/postgresql-backup-restore-fs - image_tag: "{{.Branch}}" - exclude: (master|main|snyk*) - registry: https://index.docker.io/v1/ - encrypted_dockercfg_path: dockercfg.encrypted - -- name: push_latest - service: app - type: push - image_name: silintl/postgresql-backup-restore-fs - image_tag: "latest" - tag: main - registry: https://index.docker.io/v1/ - encrypted_dockercfg_path: dockercfg.encrypted - -#- name: test -# service: app -# command: echo "Image was tested" - diff --git a/dockercfg.encrypted b/dockercfg.encrypted deleted file mode 100644 index b63d88a..0000000 --- a/dockercfg.encrypted +++ /dev/null @@ -1,2 +0,0 @@ -codeship:v2 -UpJlDtV3e4lG4+iN9VCPPW77GF8m/mtjHCMaQXfaKtl76F1N3f1Kb3+OuVVsOczWIH2pCvW5PivbcFVSaGD7t7qAuvrqJikuKKEzT0y0s6nNJe7lC5VWVaXadx7kFKJOXO4+1QXBakzf28Jwxf+okpPuJhygd5Vm9e0WpNwgAq3ggouUlg9qh6wUNlZvnbMLT58rICiu1D12wVkZdXaMLiKX9IDG4VER9MB9Sc7EjMEcigm1CFT9BwHUIvi2cyHr29Qua04qo+J1jwnkMHdJxprFZkOmKKXEiyMqgX7Om3P8m589uiHRr15SI0Iz \ No newline at end of file From 1db806b888ea7e6b1812df07f9ba6ff4b19ec191 Mon Sep 17 00:00:00 2001 From: Devon McCarty Date: Wed, 6 Mar 2024 13:59:23 -0500 Subject: [PATCH 2/3] Upgrade to postgres 14. --- Dockerfile | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5d0ae0..992cf1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM alpine:3.15 RUN apk update \ && apk add --no-cache \ bash \ - postgresql12-client + postgresql14-client COPY application/ /data/ WORKDIR /data diff --git a/docker-compose.yml b/docker-compose.yml index 85fa6a8..811f1bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: # POSTGRES_USER - superuser (default is 'postgres') # POSTGRES_DB - name of default database (default is value of POSTGRES_USER) db: - image: postgres:11.15-alpine3.15 + image: postgres:14.11-alpine3.19 volumes_from: - data ports: From 34e5ad0efc442c6e5dcd2b4da184cf2651b76712 Mon Sep 17 00:00:00 2001 From: Devon McCarty Date: Wed, 6 Mar 2024 15:13:22 -0500 Subject: [PATCH 3/3] Remove codeship references in dockerignore. --- .dockerignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index f1d320d..b6cf10a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,2 @@ *.aes -codeship-services.yml -codeship-steps.yml dockercfg