-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·54 lines (48 loc) · 2.2 KB
/
build.sh
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
#!/bin/bash
CODE_SERVER_VERSION="4.95.3"
IMAGE_VERSION="v${CODE_SERVER_VERSION}"
MAVEN_VERSION="3.9.9"
OCP_VERSION="4.16"
BUILD_DATE=$(date +"%Y-%m-%d")
cd initcontainer
podman build . \
--build-arg CODE_SERVER_VERSION=${CODE_SERVER_VERSION} \
--build-arg BUILD_DATE=${BUILD_DATE} \
--tag quay.io/gpte-devops-automation/codeserver-init:latest
podman tag quay.io/gpte-devops-automation/codeserver-init:latest quay.io/gpte-devops-automation/codeserver-init:${IMAGE_VERSION}
podman push quay.io/gpte-devops-automation/codeserver-init:latest
podman push quay.io/gpte-devops-automation/codeserver-init:${IMAGE_VERSION}
cd ../maincontainer
# Build for Java 11
JAVA_VERSION=11
podman build . \
--build-arg CODE_SERVER_VERSION=${CODE_SERVER_VERSION} \
--build-arg MAVEN_VERSION=${MAVEN_VERSION} \
--build-arg OCP_VERSION=${OCP_VERSION} \
--build-arg JAVA_VERSION="${JAVA_VERSION}" \
--build-arg BUILD_DATE=${BUILD_DATE} \
--tag quay.io/gpte-devops-automation/codeserver:${IMAGE_VERSION}-java${JAVA_VERSION}
podman push quay.io/gpte-devops-automation/codeserver:${IMAGE_VERSION}-java${JAVA_VERSION}
# Build for Java 17
JAVA_VERSION=17
podman build . \
--build-arg CODE_SERVER_VERSION=${CODE_SERVER_VERSION} \
--build-arg MAVEN_VERSION=${MAVEN_VERSION} \
--build-arg OCP_VERSION=${OCP_VERSION} \
--build-arg JAVA_VERSION="${JAVA_VERSION}" \
--build-arg BUILD_DATE=${BUILD_DATE} \
--tag quay.io/gpte-devops-automation/codeserver:${IMAGE_VERSION}-java${JAVA_VERSION}
podman push quay.io/gpte-devops-automation/codeserver:${IMAGE_VERSION}-java${JAVA_VERSION}
# Build for Java 21
JAVA_VERSION=21
podman build . \
--build-arg CODE_SERVER_VERSION=${CODE_SERVER_VERSION} \
--build-arg MAVEN_VERSION=${MAVEN_VERSION} \
--build-arg OCP_VERSION=${OCP_VERSION} \
--build-arg JAVA_VERSION="${JAVA_VERSION}" \
--build-arg BUILD_DATE=${BUILD_DATE} \
--tag quay.io/gpte-devops-automation/codeserver:${IMAGE_VERSION}-java${JAVA_VERSION}
podman push quay.io/gpte-devops-automation/codeserver:${IMAGE_VERSION}-java${JAVA_VERSION}
podman tag quay.io/gpte-devops-automation/codeserver:${IMAGE_VERSION}-java${JAVA_VERSION} quay.io/gpte-devops-automation/codeserver:latest
podman push quay.io/gpte-devops-automation/codeserver:latest
cd ..