forked from splunk/docker-splunk
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 2.75 KB
/
splunk_image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: latest splunk image
on:
push:
branches:
- develop
paths:
- Makefile
- splunk/common-files/*
jobs:
splunk_image:
name: splunk_image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
submodules: true
- name: Check out splunk-ansible
uses: actions/checkout@v2
with:
repository: splunk/splunk-ansible
path: splunk-ansible
- name: set env files ;)
run: |
echo $(grep "SPLUNK_VERSION " Makefile | cut -d " " -f3) > tag_splunk_version
echo $(grep "SPLUNK_BUILD " Makefile | cut -d " " -f3) > tag_splunk_build
echo $(grep "SPLUNK_PRODUCT " Makefile | cut -d " " -f3) > tag_splunk_product
echo $(grep "IMAGE_VERSION ?" Makefile | cut -d " " -f3 | cut -d "\"" -f2) > tag_image_version
echo $(grep "SPLUNK_LINUX_BUILD_URL ?=" Makefile | cut -d " " -f3| cut -d "$" -f1) > tag_splunk_url_domain
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build splunk image uid 1000
run: docker build --file splunk/common-files/Dockerfile
--platform=linux/amd64
--build-arg SPLUNK_BASE_IMAGE=kruj0/redhat-8
--build-arg SPLUNK_BUILD_URL=$(cat tag_splunk_url_domain)$(cat tag_splunk_product)/releases/$(cat tag_splunk_version)/linux/$(cat tag_splunk_product)-$(cat tag_splunk_version)-$(cat tag_splunk_build)-Linux-x86_64.tgz
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/$(cat tag_splunk_product):$(cat tag_image_version)
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/$(cat tag_splunk_product):$(cat tag_splunk_version) .
- name: Build splunk image uid 501
run: docker build --file splunk/common-files/Dockerfile
--platform=linux/amd64
--build-arg SPLUNK_BASE_IMAGE=kruj0/redhat-8
--build-arg UID=501
--build-arg GID=501
--build-arg SPLUNK_BUILD_URL=$(cat tag_splunk_url_domain)$(cat tag_splunk_product)/releases/$(cat tag_splunk_version)/linux/$(cat tag_splunk_product)-$(cat tag_splunk_version)-$(cat tag_splunk_build)-Linux-x86_64.tgz
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/$(cat tag_splunk_product)501:$(cat tag_image_version)
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/$(cat tag_splunk_product)501:$(cat tag_splunk_version) .
- name: push splunk uid 1000
run: docker push --all-tags ${{ secrets.DOCKER_HUB_USERNAME }}/$(cat tag_splunk_product)
- name: push splunk uid 501
run: docker push --all-tags ${{ secrets.DOCKER_HUB_USERNAME }}/$(cat tag_splunk_product)501