Skip to content

Commit ef6a486

Browse files
committed
Add Concourse pipeline
- Creates ci image - Builds pull requests - Builds main
1 parent ee29a02 commit ef6a486

19 files changed

+444
-110
lines changed

README.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ Please refer to the link:CONTRIBUTING.adoc[] for more details.
7171
== License
7272

7373
https://www.apache.org/licenses/LICENSE-2.0[Apache License v2.0]
74+

ci/docker-compose.yaml---

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: '3'
2+
3+
services:
4+
concourse-db:
5+
image: postgres
6+
environment:
7+
POSTGRES_DB: concourse
8+
POSTGRES_PASSWORD: concourse_pass
9+
POSTGRES_USER: concourse_user
10+
PGDATA: /database
11+
12+
concourse:
13+
image: rdclda/concourse:7.8.2
14+
command: quickstart
15+
privileged: true
16+
depends_on:
17+
- concourse-db
18+
ports: ["8080:8080"]
19+
environment:
20+
CONCOURSE_POSTGRES_HOST: concourse-db
21+
CONCOURSE_POSTGRES_USER: concourse_user
22+
CONCOURSE_POSTGRES_PASSWORD: concourse_pass
23+
CONCOURSE_POSTGRES_DATABASE: concourse
24+
# replace this with your external IP address
25+
CONCOURSE_EXTERNAL_URL: http://localhost:8080
26+
CONCOURSE_ADD_LOCAL_USER: test:test
27+
CONCOURSE_MAIN_TEAM_LOCAL_USER: test
28+
# instead of relying on the default "detect"
29+
CONCOURSE_WORKER_BAGGAGECLAIM_DRIVER: overlay
30+
CONCOURSE_CLIENT_SECRET: Y29uY291cnNlLXdlYgo=
31+
CONCOURSE_TSA_CLIENT_SECRET: Y29uY291cnNlLXdvcmtlcgo=
32+
CONCOURSE_X_FRAME_OPTIONS: allow
33+
CONCOURSE_CONTENT_SECURITY_POLICY: "*"
34+
CONCOURSE_CLUSTER_NAME: arm64
35+
CONCOURSE_WORKER_CONTAINERD_DNS_SERVER: "8.8.8.8"
36+
CONCOURSE_WORKER_RUNTIME: "containerd"

ci/docker-compose.yml--

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: '3'
2+
3+
services:
4+
concourse-db:
5+
image: postgres
6+
environment:
7+
POSTGRES_DB: concourse
8+
POSTGRES_PASSWORD: concourse_pass
9+
POSTGRES_USER: concourse_user
10+
PGDATA: /database
11+
12+
concourse:
13+
image: concourse/concourse
14+
command: quickstart
15+
privileged: true
16+
depends_on: [concourse-db]
17+
ports: ["8080:8080"]
18+
environment:
19+
CONCOURSE_POSTGRES_HOST: concourse-db
20+
CONCOURSE_POSTGRES_USER: concourse_user
21+
CONCOURSE_POSTGRES_PASSWORD: concourse_pass
22+
CONCOURSE_POSTGRES_DATABASE: concourse
23+
CONCOURSE_EXTERNAL_URL: http://localhost:8080
24+
CONCOURSE_ADD_LOCAL_USER: test:test
25+
CONCOURSE_MAIN_TEAM_LOCAL_USER: test
26+
# instead of relying on the default "detect"
27+
CONCOURSE_WORKER_BAGGAGECLAIM_DRIVER: overlay
28+
CONCOURSE_CLIENT_SECRET: Y29uY291cnNlLXdlYgo=
29+
CONCOURSE_TSA_CLIENT_SECRET: Y29uY291cnNlLXdvcmtlcgo=
30+
CONCOURSE_X_FRAME_OPTIONS: allow
31+
CONCOURSE_CONTENT_SECURITY_POLICY: "*"
32+
CONCOURSE_CLUSTER_NAME: tutorial
33+
CONCOURSE_WORKER_CONTAINERD_DNS_SERVER: "8.8.8.8"
34+
CONCOURSE_WORKER_RUNTIME: "containerd"

ci/images/ci-image/Dockerfile

+17-35
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,25 @@
11
FROM ubuntu:focal-20220801
2-
3-
ADD setup.sh /setup.sh
4-
ADD get-jdk-url.sh /get-jdk-url.sh
5-
ADD get-docker-url.sh /get-docker-url.sh
2+
#
3+
#VOLUME /var/run/docker.sock
4+
#
5+
###########################################################
6+
# JAVA
7+
###########################################################
8+
9+
ADD ./setup.sh /setup.sh
10+
ADD ./get-jdk-url.sh /get-jdk-url.sh
11+
ADD ./get-docker-url.sh /get-docker-url.sh
612
RUN ./setup.sh java17
713

814
ENV JAVA_HOME /opt/openjdk
9-
ENV PATH $JAVA_HOME/bin:$PATH
10-
ADD docker-lib.sh /docker-lib.sh
11-
12-
ADD build-release-scripts.sh /build-release-scripts.sh
13-
ADD releasescripts /release-scripts
14-
RUN ./build-release-scripts.sh
15-
16-
#INSTALL MAVEN
17-
ARG MAVEN_VERSION=3.6.3
18-
19-
# 2- Define a constant with the working directory
20-
ARG USER_HOME_DIR="/root"
21-
22-
# 4- Define the URL where maven can be downloaded from
23-
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
24-
25-
# 5- Create the directories, download maven, validate the download, install it, remove downloaded file and set links
26-
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
27-
&& echo "Downlaoding maven" \
28-
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
29-
\
30-
&& echo "Unziping maven" \
31-
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
32-
\
33-
&& echo "Cleaning and setting links" \
34-
&& rm -f /tmp/apache-maven.tar.gz \
35-
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
36-
37-
# 6- Define environmental variables required by Maven, like Maven_Home directory and where the maven repo is located
15+
ENV PATH $PATH:$JAVA_HOME/bin
3816
ENV MAVEN_HOME /usr/share/maven
3917
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
4018

41-
#ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ]
19+
#
20+
21+
4222

43-
CMD ["/bin/bash"]
23+
#ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh"]
24+
#ENTRYPOINT ["sh"]
25+
ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ]
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
FROM ubuntu:focal-20220801
22

3-
ADD setup.sh /setup.sh
3+
# Java 17
4+
ADD ./setup.sh /setup.sh
45
ADD get-jdk-url.sh /get-jdk-url.sh
5-
ADD get-docker-url.sh /get-docker-url.sh
6+
#ADD get-docker-url.sh /get-dockerdocker-url.sh
67
RUN ./setup.sh java17
78

9+
###########################################################
10+
# MAVEN
11+
###########################################################
12+
813
#INSTALL MAVEN
914
ARG MAVEN_VERSION=3.6.3
15+
1016
# 2- Define a constant with the working directory
1117
ARG USER_HOME_DIR="/root"
18+
1219
# 4- Define the URL where maven can be downloaded from
1320
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
21+
1422
# 5- Create the directories, download maven, validate the download, install it, remove downloaded file and set links
1523
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
1624
&& echo "Downlaoding maven" \
@@ -22,12 +30,12 @@ RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
2230
&& echo "Cleaning and setting links" \
2331
&& rm -f /tmp/apache-maven.tar.gz \
2432
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
33+
2534
# 6- Define environmental variables required by Maven, like Maven_Home directory and where the maven repo is located
2635
ENV MAVEN_HOME /usr/share/maven
2736
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
28-
2937
ENV JAVA_HOME /opt/openjdk
30-
ENV PATH $JAVA_HOME/bin:$PATH
31-
ADD docker-lib.sh /docker-lib.sh
3238

33-
ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ]
39+
COPY entrypoint.sh /bin/entrypoint.sh
40+
41+
ENTRYPOINT ["sh"]

ci/images/ci-image/build-release-scripts.sh

-7
This file was deleted.

ci/images/ci-image/entrypoint.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2021 - 2022 the original author or authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
set -e
19+
20+
#source /usr/local/bin/docker-lib.sh
21+
#start_docker
22+
mvn --version
23+
24+
exec "$@"

ci/images/ci-image/get-docker-url.sh

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
1817
set -e
1918

2019
version="20.10.17"

ci/images/ci-image/get-jdk-url.sh

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -e
44
case "$1" in
55
java17)
66
echo "https://github.com/bell-sw/Liberica/releases/download/17.0.4+8/bellsoft-jdk17.0.4+8-linux-amd64.tar.gz"
7+
# echo "https://github.com/bell-sw/Liberica/releases/download/17.0.4+8/bellsoft-jdk17.0.4+8-linux-aarch64.tar.gz"
8+
79
;;
810
java18)
911
echo "https://github.com/bell-sw/Liberica/releases/download/18.0.2+10/bellsoft-jdk18.0.2+10-linux-amd64.tar.gz"

ci/images/ci-image/setup.sh

+64-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ set -ex
77

88
export DEBIAN_FRONTEND=noninteractive
99
apt-get update
10-
apt-get install --no-install-recommends -y git curl jq tzdata ca-certificates # tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq
10+
apt-get install --no-install-recommends -y git curl jq tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq gnupg lsb-release software-properties-common python3-pip
11+
apt-get update
1112
ln -fs /usr/share/zoneinfo/UTC /etc/localtime
1213
dpkg-reconfigure --frontend noninteractive tzdata
1314
rm -rf /var/lib/apt/lists/*
@@ -37,17 +38,69 @@ if [[ $# -eq 2 ]]; then
3738
test -f /opt/openjdk-toolchain/bin/javac
3839
fi
3940

41+
############################################################
42+
## MAVEN
43+
############################################################
44+
45+
#INSTALL MAVEN
46+
MAVEN_VERSION=3.6.3
47+
48+
# 2- Define a constant with the working directory
49+
USER_HOME_DIR="/root"
50+
51+
# 4- Define the URL where maven can be downloaded from
52+
BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
53+
54+
# 5- Create the directories, download maven, validate the download, install it, remove downloaded file and set links
55+
mkdir -p /usr/share/maven /usr/share/maven/ref \
56+
&& echo "Downlaoding maven" \
57+
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
58+
\
59+
&& echo "Unziping maven" \
60+
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
61+
\
62+
&& echo "Cleaning and setting links" \
63+
&& rm -f /tmp/apache-maven.tar.gz \
64+
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
65+
66+
# 6- Define environmental variables required by Maven, like Maven_Home directory and where the maven repo is located
67+
68+
4069
###########################################################
4170
# DOCKER
4271
###########################################################
43-
#cd /
44-
#DOCKER_URL=$( ./get-docker-url.sh )
45-
#curl -L ${DOCKER_URL} | tar zx
46-
#mv /docker/* /bin/
47-
#chmod +x /bin/docker*
72+
#mkdir -p /etc/apt/keyrings
73+
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
74+
#echo \
75+
# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
76+
# $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
77+
#sudo apt-get update
78+
#sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
79+
#
4880
#
49-
#export ENTRYKIT_VERSION=0.4.0
50-
#curl -L https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz | tar zx
51-
#chmod +x entrykit && \
52-
#mv entrykit /bin/entrykit && \
53-
#entrykit --symlink
81+
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
82+
#APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
83+
#apt-key fingerprint 0EBFCD88
84+
#add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
85+
#apt-get update
86+
#apt-cache policy docker-ce
87+
#apt-get -y install docker-ce
88+
#usermod -aG docker root
89+
90+
91+
######
92+
93+
cd /
94+
DOCKER_URL=$( ./get-docker-url.sh )
95+
curl -L ${DOCKER_URL} | tar zx
96+
mv /docker/* /bin/
97+
chmod +x /bin/docker*
98+
99+
export ENTRYKIT_VERSION=0.4.0
100+
curl -L https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz | tar zx
101+
chmod +x entrykit && \
102+
mv entrykit /bin/entrykit && \
103+
entrykit --symlink
104+
105+
# Docker Compose
106+
pip3 install docker-compose

ci/multibranch-pipeline-template.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
resources:
2+
- name: branch
3+
type: git
4+
source:
5+
uri: ((github-repo-uri))
6+
branch: ((branch))

0 commit comments

Comments
 (0)