-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from entando/IT-339-busybox-init-container
IT-339 busybox init container
- Loading branch information
Showing
5 changed files
with
134 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,14 @@ | ||
{ | ||
"LABEL": { | ||
"name": "Wrong PR name", | ||
"color": "ec8400" | ||
}, | ||
"CHECKS": { | ||
"regexp": "[A-Z]{2,5}-[0-9]{1,5}" | ||
}, | ||
"MESSAGES": { | ||
"success": "All OK", | ||
"failure": "Failing PR test", | ||
"notice": "Please check the naming convention rules for naming PRs" | ||
} | ||
} |
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,83 @@ | ||
name: "Entando CI Docker images" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- synchronize | ||
- edited | ||
- labeled | ||
- unlabeled | ||
branches: | ||
- develop | ||
- release/* | ||
push: | ||
tags: | ||
- "v*" | ||
branches: | ||
- develop | ||
- release/* | ||
- ENG-* | ||
- ENGPM-* | ||
- IT-* | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
docker-buildx: | ||
name: Buildx | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PR | ||
id: check-pr | ||
uses: thehanimo/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
pass_on_octokit_error: false | ||
configuration_path: ".github/pr-title-checker-config.json" | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker meta-keycloak | ||
id: meta-keycloak | ||
uses: docker/metadata-action@v4 | ||
with: | ||
# List of Docker Images to use as base name for tags | ||
images: | | ||
entando/busybox-cds | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr,value={{head_ref}} | ||
type=ref,event=tag | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
type=raw,event=pr,value={{head_ref}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.ENTANDO_OPT_DOCKER_USERNAME }} | ||
password: ${{ secrets.ENTANDO_OPT_DOCKER_PASSWORD }} | ||
|
||
- name: Build busybox | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ steps.meta-keycloak.outputs.tags }} | ||
labels: ${{ steps.meta-keycloak.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 |
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,9 @@ | ||
FROM busybox:1.36.0 | ||
|
||
ENV REPO_PATH="https://raw.github.com/entando-ps/cds/entando720/entando-data/" \ | ||
ARCHIVE_NAME="entando720.tar.gz" \ | ||
FORCE_CDS=false | ||
|
||
COPY --chmod=0755 init.sh /init.sh | ||
|
||
ENTRYPOINT [ "/init.sh" ] |
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 |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# entando-init-busybox-cds | ||
Repository to manage the configuration of the CDS init container based on busybox | ||
|
||
## Environment Variables | ||
|
||
| Name | Default Value | Description | | ||
|-----------|----------------------------------------------------------------|-------------------------------------------------------------| | ||
| REPO_PATH | https://raw.github.com/entando-ps/cds/entando720/entando-data/ | The path of the GitHub repository used to store the archive | | ||
| ARCHIVE_NAME | entando720.tar.gz | The name of the archive containing all the Entando static resources | | ||
| FORCE_CDS | false | Needed to force the overwriting of the volume | | ||
|
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 @@ | ||
#!/usr/bin/env sh | ||
set -xe | ||
|
||
DIRECTORY="/entando-data/public" | ||
FINAL_PATH="$REPO_PATH$ARCHIVE_NAME" | ||
|
||
if [ ! -d "$DIRECTORY" ]; then | ||
wget --no-check-certificate "$FINAL_PATH" -P /tmp | ||
tar -xf /tmp/"$ARCHIVE_NAME" -C / | ||
rm /tmp/"$ARCHIVE_NAME" | ||
echo "entando-data has been initialized correctly" | ||
elif "$FORCE_CDS"; then | ||
wget --no-check-certificate "$FINAL_PATH" -P /tmp | ||
tar -xf /tmp/"$ARCHIVE_NAME" -C / | ||
rm /tmp/"$ARCHIVE_NAME" | ||
echo "entando-data has been overwritten correctly" | ||
else | ||
echo "entando-data is already in place..." | ||
fi |