From 6258de9f0fb8d4229bffd6260e39e18c8e3c1fdb Mon Sep 17 00:00:00 2001 From: Fabio Berchtold Date: Mon, 17 Jan 2022 12:32:05 +0100 Subject: [PATCH 1/7] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 45bf24c9..389e3c8f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +## Note: this project has been moved to https://github.com/swisscom/backman and will not be maintained here anymore. + # :minidisc: backman [![CircleCI](https://circleci.com/gh/swisscom/backman.svg?style=svg)](https://circleci.com/gh/swisscom/backman) From 83a14858da6da67323d727e675a705c9ec5110ac Mon Sep 17 00:00:00 2001 From: Michael Beutler Date: Wed, 27 Mar 2024 16:16:00 +0100 Subject: [PATCH 2/7] Upgraded `Dockerfile` to newer versions. - Upgraded base image from `ubuntu:20.04` to `ubuntu:22.04`. - Upgraded PostgreSQL client from `12` to `15`. - Upgraded Mongo client from `5.0.13` to `7.0.7`. - Upgraded Mongo database tools from `100.5.4` to `100.9.0`. + Added `docker build` support for non `x64/amd64` architectures using `--platform=linux/amd64 ubuntu`. --- Dockerfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6080ae9c..08595d5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM --platform=linux/amd64 ubuntu:22.04 ARG package_args='--allow-downgrades --allow-remove-essential --allow-change-held-packages --no-install-recommends' RUN echo "debconf debconf/frontend select noninteractive" | debconf-set-selections && \ @@ -17,7 +17,7 @@ WORKDIR /go/src/github.com/swisscom/backman COPY . . RUN go build -o backman -FROM ubuntu:20.04 +FROM --platform=linux/amd64 ubuntu:22.04 LABEL maintainer="JamesClonk " ARG package_args='--allow-downgrades --allow-remove-essential --allow-change-held-packages --no-install-recommends' @@ -27,13 +27,16 @@ RUN echo "debconf debconf/frontend select noninteractive" | debconf-set-selectio apt-get -y $package_args dist-upgrade && \ apt-get -y $package_args install curl wget ca-certificates gnupg tzdata -RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list -RUN wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - && \ - echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" > /etc/apt/sources.list.d/mongodb-org-5.0.list +RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \ + && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - +RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \ + gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \ + --dearmor && \ + echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | \ + tee /etc/apt/sources.list.d/mongodb-org-7.0.list RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - RUN apt-get -y $package_args update && \ - apt-get -y $package_args install mysql-client postgresql-client-12 mongodb-database-tools=100.5.4 mongodb-org-tools=5.0.13 mongodb-org-shell=5.0.13 redis-tools nodejs openssh-server bash vim-tiny && \ + apt-get -y $package_args install mysql-client postgresql-client-15 mongodb-database-tools=100.9.0 mongodb-org-tools=7.0.7 mongodb-org-shell=7.0.7 redis-tools nodejs openssh-server bash vim-tiny && \ apt-get clean && \ find /usr/share/doc/*/* ! -name copyright | xargs rm -rf && \ rm -rf \ From 66b448874183a1d22b88427944695d9136bb17ac Mon Sep 17 00:00:00 2001 From: Michael Beutler Date: Thu, 28 Mar 2024 22:20:34 +0100 Subject: [PATCH 3/7] Added additional tests. --- .circleci/config.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 77011330..87585037 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,7 @@ jobs: # postgres integration tests - run: - name: install Postgres client + name: install Postgres client v12 command: | sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list' wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - @@ -89,9 +89,18 @@ jobs: sudo apt-get -y install postgresql-client-12 - run: make postgres-test + - run: + name: install Postgres client v15 + command: | + sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - + sudo apt-get update + sudo apt-get -y install postgresql-client-15 + - run: make postgres-test + # mongodb integration tests - run: - name: install MongoDB client + name: install MongoDB client v5 command: | wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list @@ -99,6 +108,16 @@ jobs: sudo apt-get install -y mongodb-database-tools=100.5.1 mongodb-org-tools=5.0.5 mongodb-org-shell=5.0.5 - run: make mongodb-test + - run: + name: install MongoDB client v7 + command: | + RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor && \ + echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | \ + tee /etc/apt/sources.list.d/mongodb-org-7.0.list + sudo apt-get update + sudo apt-get install -y mongodb-database-tools=100.9.0 mongodb-org-tools=7.0.7 mongodb-org-shell=7.0.7 + - run: make mongodb-test + # redis integration tests - run: name: install Redis client From efaf045d325486bb20abb6f157d345cb515cfa6f Mon Sep 17 00:00:00 2001 From: Michael Beutler Date: Thu, 28 Mar 2024 22:32:15 +0100 Subject: [PATCH 4/7] Updated base container. --- .circleci/config.yml | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 87585037..4fb47461 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ jobs: build: docker: # primary image for building app - - image: cimg/go:1.16-node + - image: cimg/go:1.21-node # service images available at `host: localhost` - image: circleci/postgres:12-alpine @@ -79,16 +79,6 @@ jobs: chmod +x jq sudo mv jq /usr/local/bin/jq - # postgres integration tests - - run: - name: install Postgres client v12 - command: | - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - - sudo apt-get update - sudo apt-get -y install postgresql-client-12 - - run: make postgres-test - - run: name: install Postgres client v15 command: | @@ -98,16 +88,6 @@ jobs: sudo apt-get -y install postgresql-client-15 - run: make postgres-test - # mongodb integration tests - - run: - name: install MongoDB client v5 - command: | - wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list - sudo apt-get update - sudo apt-get install -y mongodb-database-tools=100.5.1 mongodb-org-tools=5.0.5 mongodb-org-shell=5.0.5 - - run: make mongodb-test - - run: name: install MongoDB client v7 command: | From f53c93cb8320e404da74f9ab98770050be49dcda Mon Sep 17 00:00:00 2001 From: Michael Beutler Date: Thu, 28 Mar 2024 22:38:33 +0100 Subject: [PATCH 5/7] Updated install command. --- .circleci/config.yml | 6 +++--- README.md | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4fb47461..8bd20063 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,9 +91,9 @@ jobs: - run: name: install MongoDB client v7 command: | - RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor && \ - echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | \ - tee /etc/apt/sources.list.d/mongodb-org-7.0.list + curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor && \ + sudo echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | \ + sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list sudo apt-get update sudo apt-get install -y mongodb-database-tools=100.9.0 mongodb-org-tools=7.0.7 mongodb-org-shell=7.0.7 - run: make mongodb-test diff --git a/README.md b/README.md index 879ea4b1..af2fa7df 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -## Note: this project has been moved to https://github.com/swisscom/backman and will not be maintained here anymore. - # :minidisc: backman [![CircleCI](https://circleci.com/gh/swisscom/backman/tree/master.svg?style=shield)](https://circleci.com/gh/swisscom/backman/?branch=master) From 52a00b62745f73432dcbbcff54454ec3ad8cdfd2 Mon Sep 17 00:00:00 2001 From: Michael Beutler Date: Thu, 28 Mar 2024 22:45:11 +0100 Subject: [PATCH 6/7] Updated `mongo` cli to `mongosh`. --- scripts/mongodb.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/mongodb.sh b/scripts/mongodb.sh index 951f5e20..7ed2ec15 100755 --- a/scripts/mongodb.sh +++ b/scripts/mongodb.sh @@ -37,7 +37,7 @@ retry() { # ============================================================================================= echo "waiting on mongodb ..." -retry 10 mongo --host 127.0.0.1 -u 'mongoadmin' -p 'super-secret' --authenticationDatabase admin --quiet --eval 'db.runCommand("ping").ok' +retry 10 mongosh --host 127.0.0.1 -u 'mongoadmin' -p 'super-secret' --authenticationDatabase admin --quiet --eval 'db.runCommand("ping").ok' echo "mongodb is up!" # ============================================================================================= @@ -72,7 +72,7 @@ fi curl -s http://john:doe@127.0.0.1:9990/api/v1/state/mongodb/my_mongodb | grep '"Status":"idle"' # write to mongodb -mongo --host 127.0.0.1 -u 'mongoadmin' -p 'super-secret' --authenticationDatabase admin < Date: Fri, 29 Mar 2024 11:06:04 +0100 Subject: [PATCH 7/7] Added `mongodb-mongosh=2.2.2` to test. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bd20063..37a14def 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,7 +95,7 @@ jobs: sudo echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | \ sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list sudo apt-get update - sudo apt-get install -y mongodb-database-tools=100.9.0 mongodb-org-tools=7.0.7 mongodb-org-shell=7.0.7 + sudo apt-get install -y mongodb-database-tools=100.9.0 mongodb-org-tools=7.0.7 mongodb-org-shell=7.0.7 mongodb-mongosh=2.2.2 - run: make mongodb-test # redis integration tests