44 pull_request :
55 branches :
66 - ' *'
7- workflow_dispatch :
8- inputs :
9- version :
10- description : ' Eramba Version (you can put any branch name)'
11- required : true
12- default : ' 3.x'
137
148jobs :
15- build_push :
16- name : Build and Push Eramba Docker Image [${{ matrix.build-type }}]
9+ simple_install :
10+ name : Simple Installation [${{ matrix.build-type }}]
1711 runs-on : ubuntu-22.04
18- # - self-hosted
19- # - Linux
20- # - ARM64
2112 strategy :
2213 fail-fast : false
23- # max-parallel: 1
2414 matrix :
2515 build-type :
26- - enterprise
16+ # - enterprise
2717 - community
2818
2919 steps :
30- - id : inputs
31- run : |
32- if ${{ github.event.inputs.version == '' }}; then
33- echo '::set-output name=version::3.x'
34- else
35- echo '::set-output name=version::${{ github.event.inputs.version }}'
36- fi
37-
38- - uses : webfactory/ssh-agent@v0.5.4
39- with :
40- ssh-private-key : |
41- ${{ secrets.SSH_PRIVATE_KEY }}
42- # ${{ secrets.SSH_RUNNERS_PRIVATE_KEY }}
43-
44- - name : Check out the repo
45- uses : actions/checkout@v3
46- with :
47- repository : eramba/eramba
48- path : eramba
49- ref : ${{ steps.inputs.outputs.version }}
50- ssh-key : ${{ secrets.SSH_PRIVATE_KEY }}
51-
52- - name : Actions for some reason delete all .gitkeep files with all remaining empty dirs, this reverts it.
53- working-directory : eramba
54- run : |
55- if git status | grep "app/upgrade/data/.gitkeep"; then
56- git checkout -f
57- fi
58- git status;
59-
60- - name : Setup build distribution type vars based on the matrix
61- id : build-type
62- run : |
63- if ${{ matrix.build-type == 'enterprise' }}; then
64- echo '::set-output name=image::ghcr.io/eramba/docker-enterprise'
65- exit 0
66- fi
67-
68- if ${{ matrix.build-type == 'community' }}; then
69- echo '::set-output name=image::ghcr.io/eramba/docker-community'
70- exit 0
71- fi
72-
73- - name : Set up Docker Buildx
74- id : buildx
75- uses : docker/setup-buildx-action@v2
76-
77-
78- - name : Cache Docker layers
79- uses : actions/cache@v3
80- with :
81- path : ${{ runner.temp }}/.buildx-cache
82- key : ${{ runner.os }}-buildx-${{ matrix.build-type }}-${{ github.sha }}
83- restore-keys : |
84- ${{ runner.os }}-buildx-
85-
86- - name : Log in to GitHub Container Registry
87- uses : docker/login-action@v2
88- with :
89- registry : ghcr.io
90- username : ${{ github.actor }}
91- password : ${{ secrets.TOKEN_INCREASED_PERMISSIONS }}
92-
93- - name : Extract metadata (tags, labels) for Docker
94- id : meta
95- uses : docker/metadata-action@v4
96- with :
97- github-token : ${{ secrets.GITHUB_TOKEN }}
98- images : ${{ steps.build-type.outputs.image }}
99-
100- - name : Composer install
101- working-directory : eramba
102- run : |
103- sudo apt install -y composer
104- composer install --no-interaction --ignore-platform-reqs --prefer-dist
105- composer require eramba/${{ matrix.build-type }}-pack:^1.0 --no-interaction --ignore-platform-reqs --prefer-dist
106-
10720 - name : Check out the repo
10821 uses : actions/checkout@v3
109- with :
110- path : docker
111-
112- - name : Copy docker source files to app/upgrade/vendor/eramba/docker to test it out
22+ #
23+ # - name: Log in to GitHub Container Registry
24+ # uses: docker/login-action@v2
25+ # with:
26+ # registry: ghcr.io
27+ # username: ${{ github.actor }}
28+ # password: ${{ secrets.TOKEN_INCREASED_PERMISSIONS }}
29+
30+ - name : Run Simple Install
11331 run : |
114- rm -rf eramba/app/upgrade/vendor/docker
115- cp -r docker eramba/app/upgrade/vendor/docker
116-
117- - name : Run docker compose
118- working-directory : eramba
119- run : |
120- docker container rm -f -v cron eramba mysql redis 2> /dev/null
121- docker volume rm -f eramba_app eramba_data eramba_db-data 2> /dev/null
122- docker volume rm -f eramba_v2_app eramba_v2_data eramba_v2_db-data 2> /dev/null
123- docker volume rm -f eramba-enterprise_app eramba-enterprise_data eramba-enterprise_db-data 2> /dev/null
124- docker volume rm -f eramba-community_app eramba-community_data eramba-community_db-data 2> /dev/null
125- docker volume rm -f eramba_v3_app eramba_v3_data eramba_v3_db-data 2> /dev/null
126- docker volume rm -f docker_app docker_data docker_db-data 2> /dev/null
32+ docker compose -f docker-compose.simple-install.yml down 2>&1
33+ docker system prune --force --volumes --all
12734
128- docker compose up -d
35+ docker compose -f docker-compose.simple-install.yml up -d
12936
13037 - name : Wait for apache to start
13138 timeout-minutes : 5
@@ -152,47 +59,13 @@ jobs:
15259 if docker exec -w /var/www/eramba/app/upgrade -u www-data eramba bin/cake system_health check; then
15360 exit 0
15461 fi
155-
62+
15663 exit 1
157- #
158- # - name: Cypress Tests Dependencies
159- # run: sudo apt-get install -y npm libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
160- #
161- # - name: Prepare cypress environmental
162- # id: cypress-environmental
163- # run: |
164- # if ${{ matrix.build-type == 'enterprise' }}; then
165- # echo '::set-output name=env-value::on'
166- # else
167- # echo '::set-output name=env-value::off'
168- # fi
16964
170- # - name: Cypress Tests
171- # uses: cypress-io/github-action@v4
172- # with:
173- # working-directory: eramba/app/upgrade
174- # browser: electron
175- # config: pageLoadTimeout=100000,baseUrl=http://localhost:8080
176- # record: true
177- # cache-key: type-${{ matrix.build-type }}-on-${{ runner.os }}
178- # env:
179- # CYPRESS_enterprise: ${{ steps.cypress-environmental.outputs.env-value }}
180- # # pass the Dashboard record key as an environment variable
181- # CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
182- # # pass GitHub token to allow accurately detecting a build vs a re-run build
183- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+ - name : Migrations Status Check On CRON Container (to determine if DB connection is working)
66+ run : |
67+ if docker exec -w /var/www/eramba/app/upgrade -u www-data cron bin/cake migrations status; then
68+ exit 0
69+ fi
18470
185- - name : Build Docker image
186- id : docker_build
187- uses : docker/build-push-action@v3
188- with :
189- context : eramba
190- github-token : ${{ secrets.GITHUB_TOKEN }}
191- file : eramba/Dockerfile
192- builder : ${{ steps.buildx.outputs.name }}
193- target : eramba
194- labels : ${{ steps.meta.outputs.labels }}
195- tags : ${{ steps.meta.outputs.tags }}
196- push : true
197- cache-from : type=registry,ref=${{ steps.build-type.outputs.image }}:buildcache
198- cache-to : type=registry,ref=${{ steps.build-type.outputs.image }}:buildcache,mode=max
71+ exit 1
0 commit comments