Skip to content

Commit

Permalink
version updates
Browse files Browse the repository at this point in the history
 upgraded container image to 20.04,  upgraded compose to v2. Sigh.
  • Loading branch information
shukriadams committed Aug 5, 2024
1 parent 4052a27 commit 5374c1d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
6 changes: 3 additions & 3 deletions build/live/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ docker tag shukriadams/tetrifact:latest shukriadams/tetrifact:$TAG
cd ..

if [ $SMOKETEST -eq 1 ]; then
docker-compose -f docker-compose-test.yml down
docker-compose -f docker-compose-test.yml up -d
docker compose -f docker-compose-test.yml down
docker compose -f docker-compose-test.yml up -d
sleep 5 # wait a few seconds to make sure app in container has started
STATUS=$(curl -s -o /dev/null -w "%{http_code}" localhost:49022)
docker-compose -f docker-compose-test.yml down
docker compose -f docker-compose-test.yml down
if [ "$STATUS" != "200" ]; then
echo "test container returned unexpected value ${STATUS}"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions build/live/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ set -e
# runs unit tests in tetrifact-build container

# kill any existing build container
docker-compose kill
docker compose kill

# start container from docker-compose file in this folder; this is for the tetrifact-build container
# (see https://github.com/shukriadams/tetrifact-build for details)
docker-compose up -d
docker compose up -d

# runs Tetrifact.Tests project in build container
docker exec tetrifactbuild sh -c "cd /tmp/tetrifact/src && dotnet test /p:AltCover=true"
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

# squelch tzdata prompt
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y wget \
&& apt-get install -y tzdata \
&& wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb \
&& sh -c 'dpkg -i packages-microsoft-prod.deb' \
&& apt-get install apt-transport-https -y \
&& apt-get update \
Expand Down
6 changes: 3 additions & 3 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ mkdir -p .artefacts


# kill any existing build container
docker-compose -f docker-compose-build.yml kill
docker compose -f docker-compose-build.yml kill

# build and start new build container. the dotnetcore sdk takes up 1.7 gig of space
# so we want to compile the app in a private build container, then copy the artefacts out to the
# leaner hosting container
docker-compose -f docker-compose-build.yml up -d
docker compose -f docker-compose-build.yml up -d


# copy source code into build container and compile it.
Expand All @@ -43,7 +43,7 @@ docker exec tetrifactbuild sh -c 'cd /tmp/tetrifact/Tetrifact.Web && dotnet publ
docker cp tetrifactbuild:/tmp/tetrifact/Tetrifact.Web/bin/Debug/netcoreapp3.1/publish/. ./.artefacts

# kill build container
docker-compose -f docker-compose-build.yml kill
docker compose -f docker-compose-build.yml kill

# build hosting container
docker build -t shukriadams/tetrifact .
Expand Down
7 changes: 5 additions & 2 deletions vagrant/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.1.5
sudo apt install p7zip-full

# docker
sudo mkdir -p /usr/libexec/docker/cli-plugins
sudo apt install docker.io -y
sudo apt install docker-compose -y
sudo usermod -aG docker vagrant
sudo wget https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 -O /usr/libexec/docker/cli-plugins/docker-compose
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose
echo "export PATH=/usr/libexec/docker/cli-plugins:$PATH" >> /home/vagrant/.bashrc

# force startup folder to vagrant project
echo "cd /vagrant/src" >> /home/vagrant/.bashrc

# set hostname, makes console easier to identify
sudo echo "tetrifact" > /etc/hostname
sudo echo "127.0.0.1 tetrifact" >> /etc/hosts
sudo echo "127.0.0.1 tetrifact" >> /etc/hosts
2 changes: 1 addition & 1 deletion vagrant/virtio/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vi: set ft=ruby :
Vagrant.configure("2") do |config|

config.vm.box = "generic/ubuntu1804"
config.vm.box = "generic/ubuntu2004"
config.vm.hostname = "tetrifact"
config.vm.synced_folder "./../..", "/vagrant", type: "nfs"
config.vm.network "forwarded_port", guest: 5000, host: 5000
Expand Down
2 changes: 1 addition & 1 deletion vagrant/virtualbox/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Vagrant.configure("2") do |config|

config.vm.box = "ubuntu/bionic64"
config.vm.box = "ubuntu/focal64"
config.vm.provision :shell, path: "./../provision.sh"
config.vm.synced_folder "./../..", "/vagrant"
config.vm.network "forwarded_port", guest: 5000, host: 5000
Expand Down

0 comments on commit 5374c1d

Please sign in to comment.