Skip to content
This repository was archived by the owner on May 17, 2022. It is now read-only.

Commit ac47c28

Browse files
authored
chore: use getstackhead/stackhead action (#2)
* style: use getstackhead/stackhead action * ci: use master branch of action * tests: use variables from main repository * style: set webserver and role from env
1 parent 90792d8 commit ac47c28

9 files changed

Lines changed: 10 additions & 242 deletions

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Get latest StackHead version
21-
run: git clone --depth 1 --branch master https://github.com/getstackhead/stackhead.git stackhead-repo
21+
run: "git clone --depth 1 --branch master https://github.com/getstackhead/stackhead.git stackhead-repo"
2222
- run: pip install -r ./requirements/pip.txt
2323
- run: ansible-playbook ./__tests__/test-tf-generation.yml
2424

@@ -38,8 +38,7 @@ jobs:
3838
INVENTORY_PATH: __tests__/inventory.yml
3939
steps:
4040
- uses: actions/checkout@v2
41-
- name: Get latest StackHead version
42-
run: git clone --depth 1 --branch feature/modularize_caddy https://github.com/getstackhead/stackhead.git stackhead-repo
41+
- run: pip install -r ./requirements/pip.txt
4342
- name: Print Ansible version
4443
run: ansible --version
4544
- uses: webfactory/ssh-agent@v0.2.0
@@ -77,22 +76,13 @@ jobs:
7776
proxied: 0
7877
token: "${{ secrets.CLOUDFLARE_TOKEN }}"
7978
zone: "${{ secrets.CLOUDFLARE_ZONE }}"
80-
- name: Add IP to known_hosts
81-
run: |
82-
ssh-keyscan -v -T 30 ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }} >> ~/.ssh/known_hosts
83-
- name: "Test step: Provision server"
84-
run: ./__tests__/steps/test_provision.sh
85-
env:
86-
IP: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}
87-
- name: "Test step: Deploy application"
88-
run: ./__tests__/steps/test_deploy.sh
89-
env:
90-
IP: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}
91-
- name: "Test step: Validate deployment"
92-
run: ./__tests__/steps/test_validate-deployment.sh
93-
- name: "Test step: Destroy deployment"
94-
run: ./__tests__/steps/test_destroy.sh
95-
#- uses: mxschmitt/action-tmate@v2
79+
- uses: "getstackhead/stackhead@master"
80+
with:
81+
ipaddress: ${{ steps.setup_server.outputs.hcloud_server_created_ipv4 }}
82+
domain: '${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}'
83+
domain2: 'sub.${{ env.DOMAIN_NAME }}.${{ env.DOMAIN_SUFFIX }}'
84+
webserver: '${{ env.WEBSERVER }}'
85+
rolename: '${{ env.ROLE_NAME }}'
9686
- name: Remove DNS record
9787
uses: saitho/delete-dns-record@saitho-patch-1
9888
if: always()

__tests__/ansible.dist.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

__tests__/inventory.dist.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

__tests__/projects/container.dist.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

__tests__/steps/test_deploy.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

__tests__/steps/test_destroy.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

__tests__/steps/test_provision.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

__tests__/steps/test_validate-deployment.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

__tests__/test-tf-generation.yml

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,8 @@
11
---
22
- hosts: localhost
33
connection: local
4-
vars:
5-
stackhead__tf_project_folder: "."
6-
stackhead__certificates_project_folder: ".stackhead/certificates/{{ project_name }}"
7-
stackhead__snakeoil_fullchain: ".stackhead/global_certificates/fullchain_snakeoil.pem"
8-
stackhead__snakeoil_privkey: ".stackhead/global_certificates/privkey_snakeoil.pem"
9-
project_name: test
10-
app_config:
11-
domains:
12-
- domain: example.com
13-
expose:
14-
- service: php
15-
internal_port: 5000
16-
external_port: 5000
17-
- service: nginx
18-
internal_port: 80
19-
external_port: 80
20-
security:
21-
authentication:
22-
- type: basic
23-
username: user1
24-
password: pass1
25-
- domain: test.example.com
26-
expose:
27-
- service: php
28-
internal_port: 5000
29-
external_port: 80
30-
security:
31-
authentication:
32-
- type: basic
33-
username: user1
34-
password: pass1
35-
- type: basic
36-
username: user2
37-
password: pass2
38-
container:
39-
registries:
40-
- username: dockerhub-user
41-
password: dockerhub-pass
42-
- username: myregistry-user
43-
password: myregistry-pass
44-
url: myregistry.com
45-
services:
46-
- name: data
47-
image: mycontainer:latest
48-
- name: nginx
49-
image: getstackhead/nginx:php
50-
environment:
51-
NGINX_PUBLIC_DIRECTORY: public
52-
DOCKER_PROXY_SERVICE_NAME: "$DOCKER_SERVICE_NAME['php']"
53-
volumes:
54-
- type: global
55-
src: data
56-
dest: /var/www/public/data
57-
mode: ro
58-
- type: global
59-
src: uploads
60-
dest: /var/www/public/uploads
61-
mode: ro
62-
volumes_from:
63-
- data:ro
64-
- name: php
65-
image: getstackhead/php:7.2
66-
volumes_from:
67-
- data
68-
volumes:
69-
- type: global
70-
src: fileadmin
71-
dest: /var/www/public/fileadmin
72-
- type: global
73-
src: uploads
74-
dest: /var/www/public/uploads
75-
- type: global
76-
src: typo3temp
77-
dest: /var/www/public/typo3temp
78-
- type: global
79-
src: var
80-
dest: /var/www/var
81-
- name: db
82-
image: mariadb
83-
environment:
84-
MYSQL_ROOT_PASSWORD: db
85-
MYSQL_DATABASE: db
86-
MYSQL_USER: db
87-
MYSQL_PASSWORD: db
88-
volumes:
89-
- type: local
90-
src: data
91-
dest: /var/lib/mysql
924
tasks:
5+
- include_vars: "../stackhead-repo/ansible/__tests__/variables.yml"
936
- set_fact:
947
containerapp__expose: "{{ containerapp__expose|default([]) + item.expose }}"
958
when: item.expose is defined and item.expose not in containerapp__expose|default([])

0 commit comments

Comments
 (0)