Skip to content

Commit cb72b14

Browse files
authored
Adding build for testing images from devel. (#149)
1 parent a5ace2c commit cb72b14

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build the devel ce-dev base and controller images
2+
3+
# Run this workflow only on a push/merged PR to branch devel
4+
on:
5+
push:
6+
branches:
7+
- devel
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Install modules
15+
run: yarn
16+
# Uses https://oclif.io/
17+
- name: Pack the JS
18+
run: yarn oclif-dev pack
19+
# We build mkcert from source because releases are broken
20+
# The last step sets ce-dev config to NOT use sudo because this causes docker image push problems
21+
- name: Install build and publish dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y p7zip-full libnss3-tools wget
25+
cd /tmp
26+
wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
27+
sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz
28+
export PATH=$PATH:/usr/local/go/bin
29+
git clone https://github.com/FiloSottile/mkcert && cd mkcert
30+
go build -ldflags "-X main.Version=$(git describe --tags)"
31+
sudo mv ./mkcert /usr/local/bin && cd ../
32+
sudo chmod +x /usr/local/bin/mkcert
33+
rm -Rf mkcert
34+
mkdir -p ~/.config/ce-dev
35+
touch ~/.config/ce-dev/preferences-1.x.yml
36+
echo 'docker_bin: docker' > ~/.config/ce-dev/preferences-1.x.yml
37+
echo 'docker_compose_bin: docker compose' >> ~/.config/ce-dev/preferences-1.x.yml
38+
echo 'mkcert_bin: mkcert' >> ~/.config/ce-dev/preferences-1.x.yml
39+
- name: Build and push Docker images
40+
run: |
41+
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
42+
/bin/sh docker-images/export.sh devel --push

docker-images/export.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727
OWN_DIR=$( cd "$( dirname "$OWN" )" && pwd -P)
2828

2929
# Ensure we have a fresh image to start with.
30-
docker image pull debian:bullseye
30+
docker image pull debian:bullseye-slim
3131

3232
# Build base image.
3333
echo "Building base image."
@@ -45,8 +45,8 @@ if [ "$2" = "--push" ]; then
4545
docker image push "codeenigma/ce-dev-controller-1.x:$1"
4646
fi
4747

48-
# Build dind image.
49-
# echo "Building dind image"
48+
# Build DinD (Docker in Docker) image.
49+
# echo "Building DinD image"
5050
# sudo docker image build --compress "--label=ce-dev-dind-1.x:$1" --no-cache=true -t "codeenigma/ce-dev-dind-1.x:$1" "$OWN_DIR/dind" || exit 1
5151
# if [ "$2" = "--push" ]; then
5252
# echo "Publishing the image with docker image push codeenigma/ce-dev-dind-1.x:$1"

0 commit comments

Comments
 (0)