Skip to content

Commit

Permalink
feat: add greenmask
Browse files Browse the repository at this point in the history
  • Loading branch information
achauve committed May 31, 2024
1 parent 075f2ce commit 2c8b7d0
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/greenmask.tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.ref }}-${{ github.event_name }}
jobs:
build:
uses: ./.github/workflows/workflow.build.yaml
secrets: inherit
with:
name: greenmask

version_test:
container: "docker://ghcr.io/socialgouv/docker/s3-client:sha-${{ github.sha }}"
name: Test Version
needs: [build]
runs-on: ubuntu-latest
steps:
- run: greenmask --version

name: "s3-client"
on:
push:
tags:
- "greenmask@**"
31 changes: 31 additions & 0 deletions .github/workflows/greenmask.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.ref }}-${{ github.event_name }}
jobs:
build:
uses: ./.github/workflows/workflow.build.yaml
secrets: inherit
with:
name: s3-client

version_test:
container: "docker://ghcr.io/socialgouv/docker/greenmask:sha-${{ github.sha }}"
name: Test Version
needs: [build]
runs-on: ubuntu-latest
steps:
- run: greenmask --version

name: "s3-client"
on:
push:
branches:
- "**"
- "!master"
- "!alpha"
- "!beta"
paths:
- "greenmask/**"
- ".github/workflows/greenmask.yaml"
- ".github/workflows/greenmask.tag.yaml"
- ".github/workflows/workflow.build.yaml"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $ docker pull ghcr.io/socialgouv/docker/<image>
| **s3-client** | `docker pull ghcr.io/socialgouv/docker/s3-client` | [![README](https://img.shields.io/badge/README--green.svg)](./s3-client/README.md) |
| **wait-for-http** | `docker pull ghcr.io/socialgouv/docker/wait-for-http` | [![README](https://img.shields.io/badge/README--green.svg)](./wait-for-http/README.md) |
| **wait-for-postgres** | `docker pull ghcr.io/socialgouv/docker/wait-for-postgres` | [![README](https://img.shields.io/badge/README--green.svg)](./wait-for-postgres/README.md) |
| **greenmask** | `docker pull ghcr.io/socialgouv/docker/greenmask` | [![README](https://img.shields.io/badge/README--green.svg)](./greenmask/README.md) |

<br>
<br>
Expand Down
10 changes: 10 additions & 0 deletions greenmask/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions greenmask/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Swap the comments on the following lines if you don't wish to use zero-installs
# Documentation here: https://yarnpkg.com/features/zero-installs
!.yarn/cache
#.pnp.*
22 changes: 22 additions & 0 deletions greenmask/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG NODE_VERSION=20.14-slim@sha256:a16301294ba66d2ad22d3beded4a52720f96ab208c1db0973c034d0127a4ccb0
FROM node:$NODE_VERSION

# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -yq --no-install-recommends wget ca-certificates postgresql-common \
&& rm -rf /var/lib/apt/lists/*

RUN /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y

# hadolint ignore=DL3008,DL3059
RUN apt-get update \
&& apt-get install -yq --no-install-recommends postgresql-client-15 \
&& rm -rf /var/lib/apt/lists/*

# install greenmask cli
RUN wget https://github.com/GreenmaskIO/greenmask/releases/download/v0.1.14/greenmask-linux-amd64.tar.gz \
&& tar -xvf greenmask-linux-amd64.tar.gz \
&& mv greenmask /usr/local/bin/greenmask

USER 1000

9 changes: 9 additions & 0 deletions greenmask/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# greenmask

https://greenmask.io/

Image with:

- `greenmask`
- `node`
- `pg_dump`
12 changes: 12 additions & 0 deletions greenmask/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "s3-client",
"version": "1.2.0",
"packageManager": "[email protected]",
"scripts": {
"build": "docker build -t ${SG_DOCKER_IMAGE:-'socialgouv_docker_psql'} .",
"test": "yarn test:e2e && yarn test:structure",
"test:e2e": "$(yarn bin:bats) tests/*",
"test:structure": "$(yarn bin:container-structure-test) test --image ${SG_DOCKER_IMAGE:-'socialgouv_docker_psql'} --config tests/container-structure-test.yml -v debug"
},
"private": true
}
15 changes: 15 additions & 0 deletions greenmask/tests/container-structure-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schemaVersion: "2.0.0"

commandTests:
- name: "greenmask --version"
command: "greenmask"
args: ["--version"]
expectedOutput: ["greenmask version v\\d+\\d+\\d+ .*"]
- name: "pg_dump --version"
command: "pg_dump"
args: ["--version"]
expectedOutput: ["psql \\(PostgreSQL\\) \\d+\\.\\d+"]
- name: "node --version"
command: "node"
args: ["--version"]
expectedOutput: ["v\\d+\\.\\d+\\.\\d+"]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"datasette",
"git",
"check-cluster-images",
"s3-client"
"s3-client",
"greenmask"
],
"packageManager": "[email protected]",
"private": true
Expand Down

0 comments on commit 2c8b7d0

Please sign in to comment.