Skip to content

Commit

Permalink
Merge pull request #9 from epiphany-platform/develop
Browse files Browse the repository at this point in the history
Merge with initial things
  • Loading branch information
toszo authored Jan 9, 2019
2 parents 73af629 + 33e1ba9 commit b33e922
Show file tree
Hide file tree
Showing 23 changed files with 3,172 additions and 27 deletions.
20 changes: 6 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,17 @@ epiphany.code-workspace
# **/login.sh
**/*.retry

# Data/ is the only place for data related files
# !build/**/*.tf
# !data/**/*.tf
# !data/**/*.yaml

# Ignore data folder as this is a part of separate repository - data repository
data

# /data/*.yaml files will be in a private repo
# These files will overlay the files in this repo as part of the build process so that the
# private repo takes precedence over the public repo

# Afterwards, remove all of the build folder except the ansible data from git
build/azure/infrastructure
build/aws
build/metal
build/vmware
build/vbox
build/*
core/build/azure/infrastructure
core/build/aws
core/build/metal
core/build/vmware
core/build/vbox
core/build/*

examples/**/bin/
examples/**/obj/
Expand Down
2 changes: 1 addition & 1 deletion core/bin/gen_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
set -eu

# Get the root of the Epiphany repo
export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

mkdir -p $REPO_ROOT/docs/home
mkdir -p $REPO_ROOT/docs/architecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

# Creates the REPO_ROOT env var for everything else to use...
# export REPO_ROOT=$(git rev-parse --show-toplevel)
# export REPO_ROOT=$(git rev-parse --show-toplevel)/core

set -e

Expand Down
2 changes: 1 addition & 1 deletion core/core/src/scripts/azure/gen_templates_azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set -e
TEMPLATES_BASE=core/src/templates/azure

# Get the root of the Epiphany repo
export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

COMMON_SCRIPTS_BASE=core/src/scripts/common
COMMON_TEMPLATES_BASE=core/src/templates/common
Expand Down
2 changes: 1 addition & 1 deletion core/core/src/scripts/azure/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Exit immediately if something goes wrong.
set -e

export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

COMMON_SCRIPTS_BASE=core/src/scripts/common
COMMON_TEMPLATES_BASE=core/src/templates/common
Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/azure/backend.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
set -e

{% if core.azure.terraform.backend.enable %}
export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

# Parameter 4 (data file) is optional

Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/azure/del_rg.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Exit immediately if something goes wrong.
set -e

export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

COMMON_SCRIPTS_BASE=core/src/scripts/common

Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/azure/del_sp.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Exit immediately if something goes wrong.
set -e

export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

COMMON_SCRIPTS_BASE=core/src/scripts/common

Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/azure/gen_sp.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Exit immediately if something goes wrong.
set -e

export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

# Parameter 4 (data file) is optional

Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/azure/login.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Exit immediately if something goes wrong.
set -e

export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

COMMON_SCRIPTS_BASE=core/src/scripts/common
COMMON_TEMPLATES_BASE=core/src/templates/common
Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/azure/release.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Exit immediately if something goes wrong.
set -e

export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

COMMON_SCRIPTS_BASE=core/src/scripts/common
COMMON_TEMPLATES_BASE=core/src/templates/common
Expand Down
2 changes: 1 addition & 1 deletion core/core/src/templates/common/ansible.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Exit immediately if something goes wrong.
set -e

export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

# Stops the 'cow' ascii art from showing!
export ANSIBLE_NOCOWS=1
Expand Down
2 changes: 1 addition & 1 deletion core/epiphany
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# Creates the REPO_ROOT env var for everything else to use...
export REPO_ROOT=$(git rev-parse --show-toplevel)
export REPO_ROOT=$(git rev-parse --show-toplevel)/core

# Exit immediately if anything goes wrong, instead of making things worse.
set -eu
Expand Down
2 changes: 1 addition & 1 deletion core/epiphany-simple-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ core:
resource_group: &resource_group
name: epi-quick
location: West Europe
subscription: YOUR-SUBSCRIPTION-NAME
subscription: YOUR-SUBSCRIPTION-NAME
ad:
name: epi-quick
standard:
Expand Down
39 changes: 39 additions & 0 deletions data/azure/infrastructure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Azure Data

This folder contains all of the different clusters that need to be generated. This root folder contains all templates `*.tf.j2` in Jinja2 template format.

Each sub-folder represents the classification of the cluster:

```text
infrastructure
\chef
\epiphany
\<whatever>
```

Within the given sub-folder you place the `data.yaml` file that is used to hold all of the data required for the given cluster. It contains data, options, etc. You can use a helper script called `gen_helper.sh` in the root of this folder. It calls the `gen_terraform_template.sh` script in the `/bin` folder. It's a helper script that makes it a little easier to use.

```text
infrastructure
\chef
data.yaml
\epiphany
data.yaml
\<whatever>
```

## Call EPIPHANY_UP

This script is a helper script that calls helper scripts based on values passed.

```text
# Assumes EPIPHANY_UP is in your path but it is most likely in the REPO_ROOT/bin
infrastructure
\epiphany
./EPIPHANY_UP $(pwd) ${PWD##*/}
```

The above command line only show 2 parameters because the third one is optional. The third parameter is the name of the data file which defaults to `data.yaml`. However, you can override the default for more flexibility. The data and output *.tf *must* reside in the same folder.

Also, `$pwd` means to pass in the current folder path; `${PWD##*/}` means to pass only the name of the current folder; `empty` but could contain the name of the data file.
Loading

0 comments on commit b33e922

Please sign in to comment.