Skip to content

Commit 864d5ac

Browse files
committed
Updating to 1.6.4 and adding Dockerfile/gitlab-ci.yml
1 parent e79e18f commit 864d5ac

File tree

3 files changed

+77
-10
lines changed

3 files changed

+77
-10
lines changed

.gitlab-ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
image: docker
2+
3+
before_script:
4+
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
5+
6+
build:
7+
stage: build
8+
script:
9+
- docker pull $CI_REGISTRY_IMAGE:latest || true
10+
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG --tag $CI_REGISTRY_IMAGE:latest .
11+
- test -n "$CI_COMMIT_TAG" && docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
12+
- docker push $CI_REGISTRY_IMAGE
13+
- docker run --name $CI_COMMIT_SHORT_SHA -d $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
14+
- mkdir -p build
15+
- docker cp $CI_COMMIT_SHORT_SHA:/build/'*' build/
16+
- docker kill $CI_COMMIT_SHORT_SHA
17+
18+
artifacts:
19+
paths:
20+
- build/*.deb

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
ARG UBUNTU_VERSION=18.04
2+
ARG LIBRETS_VERSION
3+
4+
FROM ubuntu:$UBUNTU_VERSION AS builder
5+
6+
ENV LIBRETS_VERSION=${LIBRETS_VERSION:-1.6.4}
7+
8+
RUN apt -y update
9+
RUN apt -y install wget devscripts
10+
RUN apt -y install debhelper python-dev python3-dev python-all python3-all libexpat1-dev libcurl4-openssl-dev libboost-dev libboost-filesystem-dev libantlr-dev swig libcppunit-dev dh-autoreconf dh-python
11+
RUN apt -y install default-jdk-headless
12+
#openjdk-7-jre-headless | openjdk-7-jre | default-jre-headless | default-jdk-headless
13+
14+
RUN mkdir -p libRETS-${LIBRETS_VERSION}/debian
15+
COPY . libRETS-${LIBRETS_VERSION}/debian
16+
RUN wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/${LIBRETS_VERSION}.tar.gz
17+
RUN mv ${LIBRETS_VERSION}.tar.gz librets_${LIBRETS_VERSION}.orig.tar.gz
18+
RUN tar xf librets_${LIBRETS_VERSION}.orig.tar.gz
19+
WORKDIR libRETS-${LIBRETS_VERSION}
20+
RUN debuild --no-sign
21+
WORKDIR ..
22+
RUN mkdir -p build
23+
RUN mv *.deb build/
24+
25+
FROM ubuntu:$UBUNTU_VERSION
26+
27+
RUN mkdir -p build
28+
COPY --from=builder build/* build/
29+
# may fail due to dependencies, fixed in next line
30+
RUN dpkg -i build/*.deb || true
31+
RUN apt --fix-broken -y install

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,34 @@ There is a PPA for Ubuntu Trusty at:
1919
Building
2020
--------
2121

22-
NOTE: This asumes the 1.6.2 version. If you are building a different version,
22+
NOTE: This asumes the 1.6.4 version. If you are building a different version,
2323
Change the version number in the commands below and **ALSO** change
24-
"debian/changelog" where it says "1.6.2" to the version you are building.
24+
"debian/changelog" where it says "1.6.4" to the version you are building.
2525

2626
Steps to build deb files:
2727

2828
- Download the libRETS tar file from the above URL
2929

3030
```bash
31-
wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.2.tar.gz
31+
wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.4.tar.gz
3232
```
3333

3434
- Rename into Debian-compatible format
3535

3636
```bash
37-
mv 1.6.2.tar.gz librets_1.6.2.orig.tar.gz
37+
mv 1.6.4.tar.gz librets_1.6.4.orig.tar.gz
3838
```
3939

4040
- Extract tar file
4141

4242
```bash
43-
tar xf librets_1.6.2.orig.tar.gz
43+
tar xf librets_1.6.4.orig.tar.gz
4444
```
4545

4646
- Clone this repository to "debian" sub-directory
4747

4848
```bash
49-
cd libRETS-1.6.2
49+
cd libRETS-1.6.4
5050
git clone https://github.com/realgo/librets-package debian
5151
```
5252

@@ -56,12 +56,28 @@ git clone https://github.com/realgo/librets-package debian
5656
Sample run:
5757

5858
```bash
59-
wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.2.tar.gz
60-
mv 1.6.2.tar.gz librets_1.6.2.orig.tar.gz
61-
tar xf librets_1.6.2.orig.tar.gz
62-
cd libRETS-1.6.2
59+
wget https://github.com/NationalAssociationOfRealtors/libRETS/archive/1.6.4.tar.gz
60+
mv 1.6.4.tar.gz librets_1.6.4.orig.tar.gz
61+
tar xf librets_1.6.4.orig.tar.gz
62+
cd libRETS-1.6.4
6363
git clone https://github.com/realgo/librets-package debian
6464
debuild
6565
cd ..
6666
sudo dpkg -i *.deb
6767
```
68+
69+
Docker
70+
------
71+
72+
You can build the Debian package within an Ubuntu container and a Ubuntu
73+
container with the deb packages installed:
74+
75+
```docker build -t ubuntu-librets:1.6.4 .```
76+
77+
You can now use "ubuntu-librets" as a docker image with librets packages
78+
installed. You can also run the container to copy off the deb files from the
79+
container:
80+
81+
```docker run --name librets-packages ubuntu-librets:1.6.4
82+
docker cp librets-packages:build/* .
83+
docker kill librets-packages```

0 commit comments

Comments
 (0)