Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
COMPOSE_PROJECT_NAME=socialgouv_docker_ci-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
ARG UBUNTU_VERSION=latest | ||
ARG GOMPLATE_VERSION=v3.6.0-slim | ||
|
||
FROM hairyhenderson/gomplate:$GOMPLATE_VERSION as gomplate | ||
FROM ubuntu:$UBUNTU_VERSION | ||
|
||
ARG NODE_VERSION=16 | ||
ARG KUBECTL_VERSION=1.20.1 | ||
ARG KUSTOMIZE_VERSION=3.5.2 | ||
ARG HELM_VERSION=3.4.2 | ||
|
||
# install gomplate | ||
COPY --from=gomplate /gomplate /usr/local/bin/gomplate | ||
|
||
# install dependencies | ||
RUN apt-get update -yq && \ | ||
apt-get -y install \ | ||
curl \ | ||
wget \ | ||
gnupg \ | ||
bash \ | ||
jq \ | ||
sed \ | ||
grep \ | ||
git \ | ||
unzip \ | ||
postgresql-client | ||
|
||
# install kubectl | ||
RUN wget -q -O /dev/shm/kubectl \ | ||
"https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ | ||
&& chmod +x /dev/shm/kubectl \ | ||
&& mv /dev/shm/kubectl /usr/local/bin/kubectl | ||
|
||
# install kustomize | ||
RUN wget -q -O /dev/shm/kustomize.tar \ | ||
"https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz" \ | ||
&& tar xvzf /dev/shm/kustomize.tar \ | ||
&& mv /kustomize /usr/local/bin/kustomize | ||
|
||
# install helm | ||
RUN wget -q -O /dev/shm/helm.tar.gz \ | ||
"https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" \ | ||
&& tar xvzf /dev/shm/helm.tar.gz \ | ||
&& mv /linux-amd64/helm /usr/local/bin/helm | ||
|
||
# install nodejs | ||
RUN apt-get update -yq && \ | ||
curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ | ||
apt-get -y install nodejs | ||
|
||
# install deno | ||
RUN curl -fsSL https://deno.land/x/install/install.sh | sh | ||
|
||
USER 1000 | ||
ENTRYPOINT [ "/bin/sh", "-c" ] | ||
CMD [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
|
||
DOCKER_COMPOSE = docker-compose | ||
|
||
all: test build lint | ||
|
||
lint: | ||
$(DOCKER_COMPOSE) run --rm lint | ||
|
||
build: lint | ||
$(DOCKER_COMPOSE) build | ||
|
||
test: build test_structure | ||
|
||
test_structure: | ||
$(DOCKER_COMPOSE) run --rm test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# ci-runner | ||
|
||
> Generic toolbox for CI runner, for example on github action | ||
## Use it in github actions | ||
|
||
```yaml | ||
jobs: | ||
my-cool-job: | ||
name: The Cool Job | ||
runs-on: ghcr.io/socialgouv/docker/ci-runner | ||
steps: | ||
- name: Apply manifest | ||
run: kubectl apply -f ${{ github.action_path }} | ||
``` | ||
|
||
```sh | ||
$ docker run --rm ghcr.io/socialgouv/docker/ci-runner | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
services: | ||
alpine: | ||
build: | ||
context: . | ||
deploy: | ||
replicas: 0 | ||
|
||
# | ||
|
||
lint: | ||
image: ghcr.io/hadolint/hadolint:v2.8.0-alpine | ||
entrypoint: hadolint | ||
command: Dockerfile | ||
volumes: | ||
- .:/home/socialgouv | ||
working_dir: /home/socialgouv | ||
|
||
test: | ||
image: gcr.io/gcp-runtimes/container-structure-test:v1.11.0 | ||
depends_on: | ||
alpine: | ||
condition: service_started | ||
command: > | ||
test | ||
--config tests/container-structure-test.yml | ||
--image ${COMPOSE_PROJECT_NAME}_alpine | ||
-v debug | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- .:/home/socialgouv | ||
working_dir: /home/socialgouv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
schemaVersion: "2.0.0" | ||
|
||
metadataTest: | ||
entrypoint: ["sh", "-c"] | ||
|
||
commandTests: | ||
- name: "kubectl version" | ||
command: "kubectl" | ||
args: ["version"] | ||
expectedOutput: ["Client Version: version.Info{Major:\"1\".*"] |