Skip to content

Commit d1f40f4

Browse files
authored
Merge pull request #24 from geerlingguy/github-actions-switch
Try to test container on GitHub Actions.
2 parents fa61a00 + 6c34de6 commit d1f40f4

File tree

5 files changed

+108
-83
lines changed

5 files changed

+108
-83
lines changed

.github/workflows/build.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
name: Build
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
schedule:
10+
- cron: "10 1 * * 0"
11+
12+
env:
13+
ANSIBLE_FORCE_COLOR: true
14+
15+
jobs:
16+
# Test the images build and work correctly.
17+
test:
18+
name: Test
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
solr_version:
23+
- '8.x'
24+
- '7.x'
25+
- '6.x'
26+
- '5.x'
27+
- '4.x'
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Set up Python 3.
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: '3.x'
36+
37+
- name: Install prerequisites.
38+
run: pip3 install ansible ansible-lint docker shyaml
39+
40+
- name: Install role dependencies.
41+
run: ansible-galaxy install -r requirements.yml
42+
43+
- name: Build the container.
44+
run: ansible-playbook --extra-vars="@vars/${{ matrix.solr_version }}.yml" main.yml
45+
46+
- name: Get the exact version of Solr used.
47+
run: |
48+
echo "exact_version=$(cat vars/${{ matrix.solr_version }}.yml | shyaml get-value solr_version)" >> $GITHUB_ENV
49+
50+
- name: Run the container.
51+
run: docker run -d --name=solr -p 8983:8983 geerlingguy/solr:${{ env.exact_version }}
52+
53+
- name: Verify solr is running.
54+
run: >
55+
docker exec solr ps -ax | grep -q "solr"
56+
&& (echo 'solr is running: pass' && exit 0)
57+
|| (echo 'solr is running: fail' && exit 1)
58+
59+
# If on master branch, build and release images.
60+
release:
61+
name: Release
62+
runs-on: ubuntu-latest
63+
needs: test
64+
if: github.ref == 'refs/heads/master'
65+
66+
steps:
67+
- uses: actions/checkout@v2
68+
69+
- name: Set up Python 3.
70+
uses: actions/setup-python@v2
71+
with:
72+
python-version: '3.x'
73+
74+
- name: Install prerequisites.
75+
run: pip3 install ansible ansible-lint docker shyaml
76+
77+
- name: Install role dependencies.
78+
run: ansible-galaxy install -r requirements.yml
79+
80+
- name: Build the container.
81+
run: ansible-playbook --extra-vars="@vars/${{ matrix.solr_version }}.yml" main.yml
82+
83+
- name: Get the exact version of Solr used.
84+
run: |
85+
echo "exact_version=$(cat vars/${{ matrix.solr_version }}.yml | shyaml get-value solr_version)" >> $GITHUB_ENV
86+
87+
- name: Login to DockerHub
88+
uses: docker/login-action@v1
89+
with:
90+
username: ${{ secrets.DOCKERHUB_USERNAME }}
91+
password: ${{ secrets.DOCKERHUB_TOKEN }}
92+
93+
- name: Build and push image.
94+
run: |
95+
# Push $solr_version tag.
96+
docker push geerlingguy/solr:${{ env.exact_version }}
97+
98+
# Push $solr_version tag.
99+
docker tag geerlingguy/solr:${{ env.exact_version }} geerlingguy/solr:${{ matrix.solr_version }}
100+
docker push geerlingguy/solr:${{ matrix.solr_version }}
101+
102+
# Push latest tag if building latest version.
103+
if [[ "${{ matrix.solr_version }}" == "8.x" ]]; then
104+
docker tag geerlingguy/solr:${{ env.exact_version }} geerlingguy/solr:latest
105+
docker push geerlingguy/solr:latest
106+
fi

.travis.yml

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

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Apache Solr Container (Built with Ansible)
22

3-
[![Build Status](https://travis-ci.org/geerlingguy/solr-container.svg?branch=master)](https://travis-ci.org/geerlingguy/solr-container) [![](https://images.microbadger.com/badges/image/geerlingguy/solr.svg)](https://microbadger.com/images/geerlingguy/solr "Get your own image badge on microbadger.com")
3+
[![CI](https://github.com/geerlingguy/solr-container/workflows/Build/badge.svg?branch=master&event=push)](https://github.com/geerlingguy/solr-container/actions?query=workflow%3ABuild) [![Docker pulls](https://img.shields.io/docker/pulls/geerlingguy/solr-container)](https://hub.docker.com/r/geerlingguy/solr-container/))
44

55
This project is composed of three main parts:
66

@@ -17,7 +17,6 @@ Currently maintained versions include:
1717
- `6.x`, `6.6.6`: Apache Solr 6.x
1818
- `5.x`, `5.5.5`: Apache Solr 5.x
1919
- `4.x`, `4.10.4`: Apache Solr 4.x
20-
- `3.x`, `3.6.2`: Apache Solr 3.x
2120

2221
## Standalone Usage
2322

@@ -96,14 +95,6 @@ Or, if using a Docker Compose file:
9695

9796
You can also mount volumes from a data container or elsewhere; the key is you will be able to both provide custom Solr configuration (`schema.xml`, `solrconfig.xml`, etc.), and also have a persistent `data` directory that lives outside the container.
9897

99-
### Apache Solr 3.x
100-
101-
There are a number of differences to keep in mind if using Apache Solr 3.x:
102-
103-
- Apache Solr 3.x doesn't support `core.properties` or core autodiscovery, so if you want to use a custom Solr core configuration, you should mount a volume into `/opt/solr/example/solr` with your Solr core configuration (`conf` and `data` dirs, at minimum).
104-
- At this time, multicore isn't officially supported under 3.x in this Docker container.
105-
- Apache Solr 3.x doesn't run in the foreground in the same way as 4+. You have to use the `command` `java -jar start.jar` inside the directory `/opt/solr/example` to start Solr in the foreground.
106-
10798
## Management with Ansible
10899

109100
### Prerequisites

vars/3.x.yml

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

vars/8.x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ java_packages:
44

55
solr_remove_cruft: true
66

7-
solr_version: "8.6.0"
7+
solr_version: "8.8.1"
88

99
container_working_dir: /
1010
container_start_command: '["/opt/solr/bin/solr", "start", "-f", "-force"]'

0 commit comments

Comments
 (0)