Skip to content

Commit

Permalink
2.x: Updated filenames and pushing docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
DionisioFG committed Oct 28, 2024
1 parent a4212f3 commit 99b8117
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 16 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/devel-ubuntu-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: '2.x-devel: Ubuntu - Build and push ce-dev and ce-dev-controller images'

on:
push:
branches:
- 2.x-devel

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: '2.x-devel'
- name: Install modules
run: yarn install --production=false --global
- name: Pack the JS
run: yarn oclif pack tarballs --targets=linux-x64,linux-arm,linux-arm64,darwin-x64,darwin-arm64 --no-xz
- name: Rename the dist/* files
run: yarn renamedist
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install -y p7zip-full libnss3-tools wget
cd /tmp
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
git clone https://github.com/FiloSottile/mkcert && cd mkcert
go build -ldflags "-X main.Version=$(git describe --tags)"
sudo mv ./mkcert /usr/local/bin && cd ../
sudo chmod +x /usr/local/bin/mkcert
rm -Rf mkcert
mkdir -p ~/.config/ce-dev
touch ~/.config/ce-dev/preferences-2.x.yml
echo 'docker_bin: docker' > ~/.config/ce-dev/preferences-2.x.yml
echo 'docker_compose_bin: docker compose' >> ~/.config/ce-dev/preferences-2.x.yml
echo 'mkcert_bin: mkcert' >> ~/.config/ce-dev/preferences-2.x.yml
- name: Build ce-dev and ce-dev-controller
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
/bin/sh docker-images/export.sh --version 2.x-devel --image-name ce-dev --dockerfile-path base-devel --push
/bin/sh docker-images/export.sh --version 2.x-devel --image-name ce-dev-controller --dockerfile-path controller-devel --push
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: '2.x: Linux - Build ce_dev binaries, images and templates (test)'
name: '2.x-devel: Ubuntu - Test image builds on PR'

on:
push:
branches:
- 2.x-devel
pull_request:
types:
- opened
Expand All @@ -20,7 +17,7 @@ jobs:
- name: Install modules
run: yarn install --production=false --global
- name: Pack the JS
run: yarn oclif pack tarballs --targets=linux-x64,linux-arm,linux-arm64 --no-xz
run: yarn oclif pack tarballs --targets=linux-x64,linux-arm,linux-arm64,darwin-x64,darwin-arm64 --no-xz
- name: Rename the dist/* files
run: yarn renamedist
# We build mkcert from source because releases are broken
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: '2.x: Linux - Build ce_dev binaries, images and templates'
name: '2.x: Ubuntu - Build and push ce-dev and ce-dev-controller images'

on:
pull_request:
types:
- opened
push:
branches:
- 2.x

Expand All @@ -17,10 +15,9 @@ jobs:
- name: Install modules
run: yarn install --production=false --global
- name: Pack the JS
run: yarn oclif pack tarballs --targets=linux-x64,linux-arm,linux-arm64 --no-xz
run: yarn oclif pack tarballs --targets=linux-x64,linux-arm,linux-arm64,darwin-x64,darwin-arm64 --no-xz
- name: Rename the dist/* files
run: yarn renamedist
# We build mkcert from source because releases are broken
- name: Install test dependencies
run: |
sudo apt-get update
Expand All @@ -34,19 +31,16 @@ jobs:
sudo mv ./mkcert /usr/local/bin && cd ../
sudo chmod +x /usr/local/bin/mkcert
rm -Rf mkcert
mkdir -p ~/.config/ce-dev
touch ~/.config/ce-dev/preferences-2.x.yml
echo 'docker_bin: docker' > ~/.config/ce-dev/preferences-2.x.yml
echo 'docker_compose_bin: docker compose' >> ~/.config/ce-dev/preferences-2.x.yml
echo 'mkcert_bin: mkcert' >> ~/.config/ce-dev/preferences-2.x.yml
- name: Build and push Docker images
- name: Build ce-dev and ce-dev-controller
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
/bin/sh docker-images/export.sh --version 2.x --image-name ce-dev --dockerfile-path base --push
/bin/sh docker-images/export.sh --version 2.x --image-name ce-dev-controller --dockerfile-path controller --push
- name: Test templates with the previous images created
run: |
sudo chmod +x bin/run.js
/bin/sh templates/prebuild.sh --template ce-dev.compose.yml
- name: Publish new ce-dev binaries
uses: softprops/action-gh-release@v1
with:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/ubuntu-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: '2.x: Ubuntu - Test image builds on PR'

on:
pull_request:
types:
- opened
branches:
- 2.x

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: '2.x'
- name: Install modules
run: yarn install --production=false --global
- name: Pack the JS
run: yarn oclif pack tarballs --targets=linux-x64,linux-arm,linux-arm64,darwin-x64,darwin-arm64 --no-xz
- name: Rename the dist/* files
run: yarn renamedist
# We build mkcert from source because releases are broken
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install -y p7zip-full libnss3-tools wget
cd /tmp
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
git clone https://github.com/FiloSottile/mkcert && cd mkcert
go build -ldflags "-X main.Version=$(git describe --tags)"
sudo mv ./mkcert /usr/local/bin && cd ../
sudo chmod +x /usr/local/bin/mkcert
rm -Rf mkcert
mkdir -p ~/.config/ce-dev
touch ~/.config/ce-dev/preferences-2.x.yml
echo 'docker_bin: docker' > ~/.config/ce-dev/preferences-2.x.yml
echo 'docker_compose_bin: docker compose' >> ~/.config/ce-dev/preferences-2.x.yml
echo 'mkcert_bin: mkcert' >> ~/.config/ce-dev/preferences-2.x.yml
- name: Build ce-dev and ce-dev-controller
run: |
/bin/sh docker-images/export.sh --version 2.x --image-name ce-dev --dockerfile-path base
/bin/sh docker-images/export.sh --version 2.x --image-name ce-dev-controller --dockerfile-path controller
- name: Testing templates
run: |
sudo chmod +x bin/run.js
/bin/sh templates/prebuild.sh --template ce-dev.compose.yml

0 comments on commit 99b8117

Please sign in to comment.