Skip to content

Commit

Permalink
adding a setup script and fixing bad docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Ximaz committed May 9, 2024
1 parent d0c9863 commit 872b5c4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: "ubuntu-latest"
if: "${{ needs.check-basics.outputs.continue == '1' }}"
container:
image: "ghcr.io/epitech/coding-style-checker:latest"
image: "epitechcontent/epitest-docker:latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4.1.1"
Expand Down Expand Up @@ -94,6 +94,11 @@ jobs:
- name: "Clean up"
run: "make fclean"

coding-style:
runs-on: "ubuntu-latest"
container:
image: "ghcr.io/epitech/coding-style-checker:latest"
steps:
- name: "Check coding style"
run: "/usr/local/bin/check.sh $(pwd) $(pwd)"

Expand All @@ -115,6 +120,7 @@ jobs:
run-tests:
needs:
- "basics"
- "coding-style"
runs-on: "ubuntu-latest"
container:
image: "epitechcontent/epitest-docker:latest"
Expand All @@ -132,6 +138,7 @@ jobs:
uses: "Ximaz/valgrind-action@v1.2.0"
with:
binary_path: "./${{ env.UNIT_TESTS }}"
valgrind_suppressions: "${{ env.VALGRIND_SUPPRESSIONS }}"

check-mirror-commits:
runs-on: "ubuntu-latest"
Expand Down
18 changes: 3 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,12 @@ branches.

## Clone this repository

To setup the workflow, you first need to clone this repository. You can use

```bash
git clone git@github.com:Ximaz/epitech-ci-cd <your_project_name>
```

Then you will have to change the origin URL. To do so, you can type the
following command :

To setup the workflow, you first need to clone this repository. You can copy
that one-line bash script, it will setup everyting for you :
```bash
cd <your_project_name>
# This must be YOUR repository, not the Epitech repository.
git remote set-url origin git@github.com:<USERNAME>/<REPOSITORY>
curl -sSL https://raw.githubusercontent.com/Ximaz/epitech-ci-cd/main/setup.bash | bash
```

Finally, you can remove the `README.md` file because it's the documentation
about this project, not your project's one.

## Repository's Variables

### ARTIFACTS
Expand Down
29 changes: 29 additions & 0 deletions setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#:/bin/bash -e

get_variable()
{
local DEFAULT="${1}"
local VARIABLE_NAME="${2}"

[[ "${DEFAULT}" == "" ]] && read DEFAULT -p "Specify the ${VARIABLE_NAME}: "
echo "${DEFAULT}"
}

main()
{
local PROJECT_NAME=$(get_variable "${CICD_PROJECT_NAME}" "project's name")
local REPOSITORY=$(get_variable "${CICD_REPOSITORY}" "repository's url")

[[ "${PROJECT_NAME}" != "" && "${REPOSITORY}" != "" ]] \
&& git clone "git@github.com:Ximaz/epitech-ci-cd" "${PROJECT_NAME}" \
&& cd "${PROJECT_NAME}" \
&& rm -rf .git README.md setup.bash \
&& git init . \
&& git branch -M main \
&& git remote add origin "${REPOSITORY}" \
&& git add .github .gitignore
unset -f get_variable
unset -f main
}

main

0 comments on commit 872b5c4

Please sign in to comment.