Skip to content

Commit

Permalink
ref(14): Change project name in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanjerome committed Sep 10, 2023
1 parent 2c574e4 commit db85aeb
Show file tree
Hide file tree
Showing 20 changed files with 78 additions and 80 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ library identifier: "wizard@14-redesign-gitlab-ci-platform-for-testing", retriev
remote: 'https://github.com/scalastic/wizard.git',
credentialsId: 'wizard-github-token']) _

wildPipeline()
wizardPipeline()
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ wizard [options] [command]

### Command options

| Option | Description |
| --- | --- |
| -h, --help | Display help for command |
| -v, --version | Display version of Wild |
| -d, --debug | Display debug information |
| -q, --quiet | Do not display any output |
| Option | Description |
| --- |---------------------------------------|
| -h, --help | Display help for command |
| -v, --version | Display version of Wizard |
| -d, --debug | Display debug information |
| -q, --quiet | Do not display any output |
| -c, --config | Specify the configuration file to use |
| -p, --project | Specify the project directory to use |
| -l, --log | Specify the log file to use |
| -t, --trace | Specify the trace file to use |
| -e, --env | Specify the environment file to use |
| -i, --input | Specify the input file to use |
| -p, --project | Specify the project directory to use |
| -l, --log | Specify the log file to use |
| -t, --trace | Specify the trace file to use |
| -e, --env | Specify the environment file to use |
| -i, --input | Specify the input file to use |

## Project directory

Expand Down
4 changes: 2 additions & 2 deletions config/json-schema/workflow-schema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://scalastic.io/workflow.schema.json",
"title": "Wild",
"description": "A workflow definition in Wild",
"title": "Wizard",
"description": "A workflow definition in Wizard",
"version": "0.0.1",
"type": "object",
"properties": {
Expand Down
10 changes: 5 additions & 5 deletions contrib/build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash
#
# Inline Wild script and act as a wrapper.
# Inline Wizard script and act as a wrapper.
# This script is for release purposes.

set -euo pipefail

export WILD_CWD="${PWD}"
export WIZARD_CWD="${PWD}"

mkdir -p ./bin
rm -f ./bin/wizard
./src/lib/ext/inline.sh --in-file ./src/wizard.sh --out-file ./bin/wizard
grep -Ev "^[[:blank:]]*#[^!]|^[[:blank:]]*$" ./bin/wild > ./bin/wild.tmp
mv ./bin/wild.tmp ./bin/wild
chmod u+x ./bin/wild
grep -Ev "^[[:blank:]]*#[^!]|^[[:blank:]]*$" ./bin/wizard > ./bin/wizard.tmp
mv ./bin/wizard.tmp ./bin/wizard
chmod u+x ./bin/wizard

echo "ok"
2 changes: 1 addition & 1 deletion contrib/make_doc.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Generates Wild source code documentation.
# Generates Wizard source code documentation.

set -euo pipefail

Expand Down
8 changes: 4 additions & 4 deletions contrib/make_package_json.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Creates a package.json file for Wild
# Creates a package.json file for Wizard

export LANG=C

Expand All @@ -10,16 +10,16 @@ version() {

files() {
echo "["
files="$(find src -not -path "*lib/ext*" \( -type f -o -type l \) -exec echo " \"{}\"," \; | sort)"
files="$(find src -not -path "*lib/ext*" -not -name ".DS_Store" \( -type f -o -type l \) -exec echo " \"{}\"," \; | sort)"
echo "${files%,}"
echo " ]"
}

cat<<JSON
{
"name": "Wild",
"name": "Wizard",
"version": "$(version)",
"description": "Wild fills the missing link of the DevOps approach and its shift-left principal herein. With Wild the shifts are so close to the developer that they no longer exist.",
"description": "Welcome to Wizard, a versatile and magical framework that empowers you to effortlessly execute uniform integration scripts both locally and on your server.",
"homepage": "https://scalastic.io/en/",
"scripts": ["wizard"],
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion contrib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ is_prerelease() {
return 1
}

version=$(bin/wild --version)
version=$(bin/wizard --version)

confirm "Release $version?" || exit 0
run git tag -s -a "$version" -m "$version"
Expand Down
2 changes: 1 addition & 1 deletion docker/basic/ubi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM redhat/ubi9:9.2

LABEL Author="WILD by Scalastic"
LABEL Author="WIZARD by Scalastic"

RUN yum install jq -y
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL=bash

.PHONY: all build check metrics test coverage dev

all: package check metrics coverage doc
all: build package check metrics coverage doc

build:
contrib/build.sh
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"name": "Wild",
"version": "",
"description": "Wild fills the missing link of the DevOps approach and its shift-left principal herein. With Wild the shifts are so close to the developer that they no longer exist.",
"name": "Wizard",
"version": "0.0.1",
"description": "Welcome to Wizard, a versatile and magical framework that empowers you to effortlessly execute uniform integration scripts both locally and on your server.",
"homepage": "https://scalastic.io/en/",
"scripts": ["wizard"],
"license": "MIT",
"files": [
"src/.DS_Store",
"src/action/build/build.sh",
"src/lib/common.sh",
"src/lib/log.sh",
"src/lib/platform.sh",
"src/lib/project.sh",
"src/lib/tooling.sh",
"src/lib/workflow.sh",
"src/wild.sh"
"src/wizard.sh"
],
"install": "make install"
}
4 changes: 2 additions & 2 deletions resources/config/k8s/containers-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ metadata:
pipeline: jenkinsfile
spec:
containers:
- name: 'wild'
image: scalastic/wild
- name: 'wizard'
image: scalastic/wizard
command:
- cat
tty: true
Expand Down
12 changes: 6 additions & 6 deletions spec/banner.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
___ ___ _ _____ ____
/ _ \/ _ | | /| / / _ \/ / /
/ , _/ __ | |/ |/ / , _/_/_/
/_/|_/_/ |_|__/|__/_/|_(_|_)

WILD development by Scalastic 🤙
__ ___ _ ____ _ _ _
\ \ / (_)______ _ _ __ __| | / ___|___ _ __ | |_ _ __(_) |__
\ \ /\ / /| |_ / _` | '__/ _` | | | / _ \| '_ \| __| '__| | '_ \
\ V V / | |/ / (_| | | | (_| | | |__| (_) | | | | |_| | | | |_) |
\_/\_/ |_/___\__,_|_| \__,_| \____\___/|_| |_|\__|_| |_|_.__/
By Scalastic 🤙
4 changes: 2 additions & 2 deletions spec/lib/log_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Describe "Test that log.sh"
Include "./src/lib/log.sh"

setup() {
export WILD_CWD="${PWD}"
export LOG_PATH="${WILD_CWD}/../tmp/log"
export WIZARD_CWD="${PWD}"
export LOG_PATH="${WIZARD_CWD}/../tmp/log"
export LOG_LEVEL="${LOG_LEVEL_INFO}"
}

Expand Down
10 changes: 5 additions & 5 deletions spec/lib/project_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ Describe "Test that project.sh"
Include "./src/lib/project.sh"

setup() {
export WILD_CWD="${PWD}"
export LOG_PATH="${WILD_CWD}/tmp/log"
export WIZARD_CWD="${PWD}"
export LOG_PATH="${WIZARD_CWD}/tmp/log"
export LOG_LEVEL="${LOG_LEVEL_INFO}"
export CONFIG_PATH="${WILD_CWD}/test/config"
export CONFIG_PATH="${WIZARD_CWD}/test/config"
}

BeforeAll 'setup'

Describe "project_get_configuration_path"

It "returns the default configuration path if no path is specified"
export CONFIG_PATH="${WILD_CWD}/config"
export CONFIG_PATH="${WIZARD_CWD}/config"
When call project_get_configuration_path
The status should be success
The output should include "config/workflow-default.json"
The error should include "No project configuration file specified, use default"
End

It "returns the specified configuration path if a path is specified"
export CONFIG_PATH="${WILD_CWD}/test/config"
export CONFIG_PATH="${WIZARD_CWD}/test/config"
When call project_get_configuration_path "${CONFIG_PATH}/workflow-action.json"
The status should be success
The output should include "${CONFIG_PATH}/workflow-action.json"
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/tooling_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Describe "Test that tooling.sh"
setup() {
export LOG_PATH="${PWD}/log"
export LOG_LEVEL="${LOG_LEVEL_INFO}"
export WILD_CWD="${PWD}"
export WIZARD_CWD="${PWD}"
}
BeforeAll 'setup'

Expand Down
12 changes: 6 additions & 6 deletions spec/lib/workflow_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
Describe "Test that workflow.sh"

setup() {
export WILD_CWD="${PWD}"
export LOG_PATH="${WILD_CWD}/tmp/log"
export WIZARD_CWD="${PWD}"
export LOG_PATH="${WIZARD_CWD}/tmp/log"
export LOG_LEVEL="${LOG_LEVEL_DEBUG}"
export CONFIG_PATH="${WILD_CWD}/config"
export CONFIG_PATH="${WIZARD_CWD}/config"

mkdir -p "${WILD_CWD}/tmp/config"
mkdir -p "${WIZARD_CWD}/tmp/config"
}

BeforeAll 'setup'
Expand All @@ -29,9 +29,9 @@ Describe "Test that workflow.sh"
The stderr should be present # for logs redirected into stderr
End

It "returns a status failure when WILD_CWD is not set"
It "returns a status failure when WIZARD_CWD is not set"

BeforeRun 'unset WILD_CWD'
BeforeRun 'unset WIZARD_CWD'
BeforeRun 'JQ=FAKE_JQ'

When run workflow_check_prerequisites
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ext/gendoc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
#@desc This script is used to generate documentation for bash scripts used in Wild.
#@desc This script is used to generate documentation for bash scripts used in Wizard.

set -euo pipefail

Expand Down
10 changes: 5 additions & 5 deletions src/lib/workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ workflow_check_prerequisites () {

local status=0

if [ -z "${WILD_CWD:-}" ]; then
log_error "Missing WILD_CWD environment variable"
if [ -z "${WIZARD_CWD:-}" ]; then
log_error "Missing WIZARD_CWD environment variable"
status=1
fi

Expand All @@ -29,7 +29,7 @@ workflow_check_prerequisites () {
return 1
fi

log_debug "WILD_CWD is ${WILD_CWD}"
log_debug "WIZARD_CWD is ${WIZARD_CWD}"
log_debug "jq command is ${JQ}"
}

Expand All @@ -49,7 +49,7 @@ workflow_check_workflow_definition_path() {
path="config/workflow-default.json"
fi

if [ ! -f "${WILD_CWD}/${path}" ]; then
if [ ! -f "${WIZARD_CWD}/${path}" ]; then
log_fatal "Workflow definition file in ${path} does not exist"
exit 1
fi
Expand Down Expand Up @@ -96,7 +96,7 @@ workflow_load_action_definition() {

local action_definition
# shellcheck disable=SC2207
action_definition=($("$JQ" <"${WILD_CWD}/${workflow_definition_path}" -rc ".actions[] | select(.id == \"${action_id}\")"))
action_definition=($("$JQ" <"${WIZARD_CWD}/${workflow_definition_path}" -rc ".actions[] | select(.id == \"${action_id}\")"))

# shellcheck disable=SC2145
log_debug "Action definition is: ${action_definition[@]}"
Expand Down
25 changes: 12 additions & 13 deletions src/wild.sh → src/wizard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

set -euo pipefail

export WILD_CWD="${PWD}"
export LOG_PATH="${WILD_CWD}/tmp" && mkdir -p "${LOG_PATH}"
export WIZARD_CWD="${PWD}"
export LOG_PATH="${WIZARD_CWD}/tmp" && mkdir -p "${LOG_PATH}"
export CONFIG_PATH="./config"
# shellcheck disable=SC2034
VERSION="0.0.1"

# shellcheck disable=SC1091
source "${WILD_CWD}/src/lib/ext/getoptions.sh"
source "${WIZARD_CWD}/src/lib/ext/getoptions.sh"

parser_definition() {
setup REST help:usage -- "Usage: wizard.sh [options]... [arguments]..." ''
Expand All @@ -25,31 +25,30 @@ eval "$(getoptions parser_definition) exit 1"
if [ -n "${PARAM_DOCKER}" ] && [ "${PARAM_DOCKER}" -eq "1" ]; then
echo "Starting containers..."
# Build images
"${WILD_CWD}"/docker/build-all-images.sh
"${WIZARD_CWD}"/docker/build-all-images.sh
# Start containers
#docker container run \
# --mount type=bind,source="$WILD_CWD/config",target="/app/config"\
# --mount type=bind,source="$WIZARD_CWD/config",target="/app/config"\
# -td --name basic-wizard \
# scalastic/wizard:latest \
# /bin/bash
fi

# Import librairies
# shellcheck disable=SC1091
source "${WILD_CWD}/src/lib/log.sh"
source "${WIZARD_CWD}/src/lib/log.sh"
export LOG_LEVEL="$LOG_LEVEL_DEBUG"
# shellcheck disable=SC1091
source "${WILD_CWD}/src/lib/tooling.sh"
source "${WIZARD_CWD}/src/lib/tooling.sh"
tooling::set_jq

# shellcheck disable=SC1091
source "${WILD_CWD}/src/lib/platform.sh"
source "${WIZARD_CWD}/src/lib/platform.sh"
# shellcheck disable=SC1091
source "${WILD_CWD}/src/lib/project.sh"
source "${WIZARD_CWD}/src/lib/project.sh"
# shellcheck disable=SC1091
source "${WILD_CWD}/src/lib/workflow.sh"
source "${WIZARD_CWD}/src/lib/workflow.sh"


workflow_configuration_path=$(project::get_configuration_path)
# shellcheck disable=SC2034
used_containers_names=$(workflow::_get_workflows_containers_names "$workflow_configuration_path")
#workflow_configuration_path=$(project::get_configuration_path)
#used_containers_names=$(workflow::_get_workflows_containers_names "$workflow_configuration_path")
Loading

0 comments on commit db85aeb

Please sign in to comment.