-
Notifications
You must be signed in to change notification settings - Fork 6
111 lines (101 loc) · 4.92 KB
/
deploy.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: WebSphere Liberty s2i Image Deployment
on:
release:
types: [published]
workflow_dispatch:
env:
LANG: en_US.UTF-8
S2I_URI: https://api.github.com/repos/openshift/source-to-image/releases/tags/v1.3.9
CEKIT_VERSION: 4.8.0
DOCKER_USERID: ${{ secrets.DOCKER_USERID }}
LIBERTY_VERSION: ${{ github.event.release.tag_name }}
jobs:
wasci:
name: WebSphere Liberty s2i Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Docker configuration
if: env.DOCKER_USERID == ''
run: |
echo "Docker configuration is incomplete, push to dockerhub will be skipped. "
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install krb5-multidev libkrb5-dev
- name: Verify latest centos image is present
run: |
docker image ls | grep centos || true
docker pull quay.io/centos/centos:7
docker pull quay.io/centos7/s2i-base-centos7:centos7
docker image ls | grep centos
- name: Setup virtualenv and install cekit and required packages
run: |
sudo pip install virtualenv
mkdir ~/cekit${{ env.CEKIT_VERSION }}
virtualenv ~/cekit${{ env.CEKIT_VERSION }}
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
pip install cekit==${{ env.CEKIT_VERSION }} docker==5.0.3 docker-squash odcs behave lxml urllib3==1.26.15 packaging==21.3 requests==2.31.0
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
curl -s ${{ env.S2I_URI }} \
| grep browser_download_url \
| grep linux-amd64 \
| cut -d '"' -f 4 \
| wget -qi -
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version
- name: Build and Test
run: |
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
make
docker image ls
- name: Push to dockerhub
if: env.DOCKER_USERID != ''
run: |
LIBERTY_VERSION=${{ env.LIBERTY_VERSION }}
JAVA8_IMAGE_VERSION=${LIBERTY_VERSION}-java8
JAVA8_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java8
JAVA11_IMAGE_VERSION=${LIBERTY_VERSION}-java11
JAVA11_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java11
JAVA17_IMAGE_VERSION=${LIBERTY_VERSION}-java17
JAVA17_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java17
JAVA21_IMAGE_VERSION=${LIBERTY_VERSION}-java21
JAVA21_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java21
NAMESPACE=ibmcom
PLATFORM=websphere-liberty-s2i
IMAGE_NAME=${NAMESPACE}/${PLATFORM}
echo Pushing the following versions of image ${IMAGE_NAME} to docker hub:
echo ${JAVA8_IMAGE_VERSION}, ${JAVA8_RUNTIME_IMAGE_VERSION}, ${JAVA11_IMAGE_VERSION}, ${JAVA11_RUNTIME_IMAGE_VERSION}, ${JAVA17_IMAGE_VERSION}, ${JAVA17_RUNTIME_IMAGE_VERSION}, ${JAVA21_IMAGE_VERSION}, ${JAVA21_RUNTIME_IMAGE_VERSION}
docker login -u="${{ secrets.DOCKER_USERID }}" -p="${{ secrets.DOCKER_PASSWORD }}"
docker push ${IMAGE_NAME}:${JAVA8_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA8_IMAGE_VERSION} ${IMAGE_NAME}:java8
docker push ${IMAGE_NAME}:java8
docker push ${IMAGE_NAME}:${JAVA8_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA8_RUNTIME_IMAGE_VERSION} ${IMAGE_NAME}:runtime-java8
docker push ${IMAGE_NAME}:runtime-java8
docker push ${IMAGE_NAME}:${JAVA11_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA11_IMAGE_VERSION} ${IMAGE_NAME}:java11
docker push ${IMAGE_NAME}:java11
docker push ${IMAGE_NAME}:${JAVA11_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA11_RUNTIME_IMAGE_VERSION} ${IMAGE_NAME}:runtime-java11
docker push ${IMAGE_NAME}:runtime-java11
docker push ${IMAGE_NAME}:${JAVA17_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA17_IMAGE_VERSION} ${IMAGE_NAME}:java17
docker push ${IMAGE_NAME}:java17
docker push ${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION} ${IMAGE_NAME}:runtime-java17
docker push ${IMAGE_NAME}:runtime-java17
docker push ${IMAGE_NAME}:${JAVA21_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA21_IMAGE_VERSION} ${IMAGE_NAME}:java21
docker push ${IMAGE_NAME}:java21
docker push ${IMAGE_NAME}:${JAVA21_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA21_RUNTIME_IMAGE_VERSION} ${IMAGE_NAME}:runtime-java21
docker push ${IMAGE_NAME}:runtime-java21