Skip to content

Commit c61e800

Browse files
gregharveyEmlynK
andauthored
Prometheus pr devel (#532)
* Need to check if is_local is defined in webserver meta dependencies. (#522) * Ce dev refactor pr 1.x (#518) * Making it easier to test with provision-target and ce-dev. * Moving the provision forcing var back to plays so _init has it. * Adding defaults vars and test script extra options. * Adding a web server test to CI. * examples string needs to be in quotes. * Making sure is_local and _ce_provision_force_play are available to the _init role. * Adding SSH keys to the provision user. * Adding a --force to the test script. * Explicitly adding vars to role. * Fixing _init behaviour and adding SSH key for web role. * Setting default PHP version to 7.4. * Looking up the generated ce-dev SSH key instead of hard-coding one. * We cannot run the ssh_server role locally, so excluding for tests of webserver role. * Trying to remove user_root.yml in case it's breaking CI. * Adding a verbose mode to the test script. * Exposing the command in the test script. * Trying hard-coded keys again. * Changing location of data dir for test containers. * Putting vars back and restricting CI to the 'web' example. * Adding backup handling to ldap_server. (#525) * Adding backup handling to ldap_server. * Improving SSL docs and handling perms for openldap and letsencrypt. * Cron user must be specified with file. * Running as root, do not need a 'sudo' in this cron. * Allowing 'gitLab' to disable Prometheus. * Booleans to use in jinja2 as strings must be cast as strings. * Tidying up CI and adding a GitLab test. * Fixing CI job description. Co-authored-by: EmlynK <emlyn.kinzett@codeenigma.com>
1 parent 3e932c6 commit c61e800

File tree

3 files changed

+87
-26
lines changed

3 files changed

+87
-26
lines changed

Diff for: .github/workflows/ce-provision-test.yml renamed to .github/workflows/ce-provision-build-docs.yml

+3-26
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Run tests and build docs
1+
name: Build docs
22

33
# Run this workflow every time a new commit pushed to your repository
44
on: pull_request
55

66
jobs:
77
# Set the job key. The key is displayed as the job name
88
# when a job name is not provided
9-
run-tests:
9+
build-docs:
1010
# Name the Job
11-
name: Run tests against Ansible code base
11+
name: Build the documentation
1212
# Set the type of machine to run on
1313
runs-on: ubuntu-20.04
1414

@@ -18,35 +18,12 @@ jobs:
1818
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
1919
uses: actions/checkout@v2
2020

21-
# Installs the ce-dev stack
22-
- name: Install ce-dev
23-
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
24-
run: |
25-
cd /tmp
26-
wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz
27-
sudo tar -C /usr/local -xzf go1.15.8.linux-amd64.tar.gz
28-
export PATH=$PATH:/usr/local/go/bin
29-
git clone https://github.com/FiloSottile/mkcert && cd mkcert
30-
go build -ldflags "-X main.Version=$(git describe --tags)"
31-
sudo mv ./mkcert /usr/local/bin && cd ../
32-
sudo chmod +x /usr/local/bin/mkcert
33-
rm -Rf mkcert
34-
curl -sL https://raw.githubusercontent.com/codeenigma/ce-dev/1.x/install.sh | /bin/sh -s -- linux
35-
3621
# Configures global Git variables for committing
3722
- name: Configure Git
3823
run: |
3924
git config --global user.email "sysadm@codeenigma.com"
4025
git config --global user.name "Code Enigma CI"
4126
42-
# Uses the ce-dev stack to run a test provision
43-
- name: Run a test provision
44-
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
45-
run: |
46-
git clone --branch 1.x https://github.com/codeenigma/ce-dev-ce-provision-config.git config
47-
/bin/bash ce-dev/ansible/test.sh --examples web --own-branch ${{ github.event.pull_request.base.ref }} --config-branch ${{ github.event.pull_request.base.ref }}
48-
shell: bash
49-
5027
# Builds the docs
5128
- name: Build documentation
5229
if: ${{ github.event.pull_request.head.ref != 'documentation' }}

Diff for: .github/workflows/ce-provision-test-gitlab.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run GitLab server test build
2+
3+
# Run this workflow every time a new commit pushed to your repository
4+
on: pull_request
5+
6+
jobs:
7+
# Set the job key. The key is displayed as the job name
8+
# when a job name is not provided
9+
test-gitlab:
10+
# Name the Job
11+
name: Run tests against Ansible code base
12+
# Set the type of machine to run on
13+
runs-on: ubuntu-20.04
14+
15+
steps:
16+
# Checks out a copy of your repository on the ubuntu-latest machine
17+
- name: Checkout code
18+
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
19+
uses: actions/checkout@v2
20+
21+
# Installs the ce-dev stack
22+
- name: Install ce-dev
23+
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
24+
run: |
25+
cd /tmp
26+
wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz
27+
sudo tar -C /usr/local -xzf go1.15.8.linux-amd64.tar.gz
28+
export PATH=$PATH:/usr/local/go/bin
29+
git clone https://github.com/FiloSottile/mkcert && cd mkcert
30+
go build -ldflags "-X main.Version=$(git describe --tags)"
31+
sudo mv ./mkcert /usr/local/bin && cd ../
32+
sudo chmod +x /usr/local/bin/mkcert
33+
rm -Rf mkcert
34+
curl -sL https://raw.githubusercontent.com/codeenigma/ce-dev/1.x/install.sh | /bin/sh -s -- linux
35+
36+
# Uses the ce-dev stack to run a test provision
37+
- name: Run a test provision
38+
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
39+
run: |
40+
git clone --branch 1.x https://github.com/codeenigma/ce-dev-ce-provision-config.git config
41+
/bin/bash ce-dev/ansible/test.sh --examples gitlab --own-branch ${{ github.event.pull_request.base.ref }} --config-branch ${{ github.event.pull_request.base.ref }}
42+
shell: bash

Diff for: .github/workflows/ce-provision-test-web.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run web server test build
2+
3+
# Run this workflow every time a new commit pushed to your repository
4+
on: pull_request
5+
6+
jobs:
7+
# Set the job key. The key is displayed as the job name
8+
# when a job name is not provided
9+
test-web:
10+
# Name the Job
11+
name: Run tests against Ansible code base
12+
# Set the type of machine to run on
13+
runs-on: ubuntu-20.04
14+
15+
steps:
16+
# Checks out a copy of your repository on the ubuntu-latest machine
17+
- name: Checkout code
18+
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
19+
uses: actions/checkout@v2
20+
21+
# Installs the ce-dev stack
22+
- name: Install ce-dev
23+
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
24+
run: |
25+
cd /tmp
26+
wget https://golang.org/dl/go1.15.8.linux-amd64.tar.gz
27+
sudo tar -C /usr/local -xzf go1.15.8.linux-amd64.tar.gz
28+
export PATH=$PATH:/usr/local/go/bin
29+
git clone https://github.com/FiloSottile/mkcert && cd mkcert
30+
go build -ldflags "-X main.Version=$(git describe --tags)"
31+
sudo mv ./mkcert /usr/local/bin && cd ../
32+
sudo chmod +x /usr/local/bin/mkcert
33+
rm -Rf mkcert
34+
curl -sL https://raw.githubusercontent.com/codeenigma/ce-dev/1.x/install.sh | /bin/sh -s -- linux
35+
36+
# Uses the ce-dev stack to run a test provision
37+
- name: Run a test provision
38+
if: ${{ github.event.pull_request.head.ref != 'documentation' }}
39+
run: |
40+
git clone --branch 1.x https://github.com/codeenigma/ce-dev-ce-provision-config.git config
41+
/bin/bash ce-dev/ansible/test.sh --examples web --own-branch ${{ github.event.pull_request.base.ref }} --config-branch ${{ github.event.pull_request.base.ref }}
42+
shell: bash

0 commit comments

Comments
 (0)