Skip to content

Commit 714ee53

Browse files
committed
Support build tags
1 parent 04553ba commit 714ee53

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
ARG CLI_VERSION=2.10
2+
ARG PHP_VERSION=php7.3
3+
# Extend the Docksal CLI per https://docs.docksal.io/stack/extend-images/
4+
FROM docksal/cli:${CLI_VERSION}-${PHP_VERSION}
5+
6+
# Puppeteer dependencies taken from https://github.com/alekzonder/docker-puppeteer
7+
# Install addtional apt packages needed for pa11y and puppeteer
8+
# Added vim.
9+
RUN apt-get update && \
10+
apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
11+
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
12+
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
13+
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
14+
fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst \
15+
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget vim && \
16+
apt-get --purge remove && \
17+
apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
18+
19+
ARG HELM_VERSION=v2.12.3
20+
21+
# Next install tools from phase2/docker-gitlab-ci-workspace
22+
RUN curl -o /usr/local/bin/kubectl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
23+
chmod +x /usr/local/bin/kubectl && \
24+
curl -o ./install_helm.sh https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get && \
25+
chmod +x ./install_helm.sh && \
26+
./install_helm.sh -v ${HELM_VERSION} && \
27+
helm init --client-only
28+
29+
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
30+
python get-pip.py && \
31+
pip install awscli
32+
33+
# All further commands will be performed as the docker user.
34+
USER docker
35+
SHELL ["/bin/bash", "-c"]
36+
37+
# Remove ruby from Docksal CLI
38+
RUN \
39+
# Initialize the user environment (this loads rvm)
40+
. $HOME/.profile && \
41+
rvm remove ruby-${RUBY_VERSION_INSTALL}
42+
43+
# Install additional global npm dependencies
44+
RUN \
45+
# Initialize the user environment (this loads nvm)
46+
. $HOME/.profile && \
47+
# Install node packages
48+
npm install -g [email protected] pa11y@5 pa11y-ci@2 http-server
49+
50+
# IMPORTANT! Switching back to the root user as the last instruction.
51+
USER root

hooks/build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
echo "In build"
4+
printenv
5+
echo "Cur dir"
6+
pwd
7+
8+
cliVersion="$SOURCE_BRANCH"
9+
phpVersions="$DOCKERFILE_PATH"
10+
#docker build \
11+
# --build-arg CLI_VERSION=${cliVersion} \
12+
# --build-arg PHP_VERSION=${phpVersion} \
13+
# -t $IMAGE_NAME \
14+
# .

hooks/post_push

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
echo "Post Push"
4+
printenv
5+
6+
# Parse image name for repo name
7+
tagStart=$(expr index "$IMAGE_NAME" :)
8+
repoName=${IMAGE_NAME:0:tagStart-1}
9+
tag="test"
10+
11+
echo "repoName: $repoName"
12+
echo docker tag $IMAGE_NAME ${repoName}:${tag}
13+
echo docker push ${repoName}:${tag}

0 commit comments

Comments
 (0)